Przeglądaj źródła

* rewrote the system handling

florian 23 lat temu
rodzic
commit
eb2ca8d10f
57 zmienionych plików z 2358 dodań i 1683 usunięć
  1. 6 3
      compiler/aggas.pas
  2. 5 2
      compiler/assemble.pas
  3. 46 1
      compiler/compiler.pas
  4. 7 4
      compiler/comprsrc.pas
  5. 9 6
      compiler/export.pas
  6. 5 2
      compiler/finput.pas
  7. 7 4
      compiler/fppu.pas
  8. 7 4
      compiler/gendef.pas
  9. 8 5
      compiler/i386/ag386att.pas
  10. 6 3
      compiler/i386/ag386int.pas
  11. 9 6
      compiler/i386/ag386nsm.pas
  12. 5 2
      compiler/i386/popt386.pas
  13. 7 4
      compiler/i386/ra386.pas
  14. 5 2
      compiler/i386/ra386att.pas
  15. 90 0
      compiler/i_amiga.pas
  16. 90 0
      compiler/i_atari.pas
  17. 108 0
      compiler/i_beos.pas
  18. 244 0
      compiler/i_fbsd.pas
  19. 108 0
      compiler/i_go32v2.pas
  20. 451 0
      compiler/i_linux.pas
  21. 142 0
      compiler/i_macos.pas
  22. 108 0
      compiler/i_nwm.pas
  23. 120 0
      compiler/i_os2.pas
  24. 90 0
      compiler/i_palmos.pas
  25. 109 0
      compiler/i_sunos.pas
  26. 110 0
      compiler/i_wdosx.pas
  27. 125 0
      compiler/i_win32.pas
  28. 12 9
      compiler/import.pas
  29. 5 2
      compiler/ncgutil.pas
  30. 7 4
      compiler/ogcoff.pas
  31. 5 2
      compiler/ogelf.pas
  32. 10 7
      compiler/options.pas
  33. 7 1
      compiler/paramgr.pas
  34. 5 2
      compiler/pdecsub.pas
  35. 6 3
      compiler/pdecvar.pas
  36. 6 3
      compiler/pexports.pas
  37. 5 2
      compiler/pexpr.pas
  38. 24 21
      compiler/pmodules.pas
  39. 5 2
      compiler/powerpc/agppcgas.pas
  40. 10 7
      compiler/powerpc/cgcpu.pas
  41. 5 2
      compiler/psub.pas
  42. 15 12
      compiler/scandir.pas
  43. 71 136
      compiler/systems.pas
  44. 6 51
      compiler/targets/t_amiga.pas
  45. 6 51
      compiler/targets/t_atari.pas
  46. 8 72
      compiler/targets/t_beos.pas
  47. 17 212
      compiler/targets/t_fbsd.pas
  48. 6 69
      compiler/targets/t_go32v2.pas
  49. 25 424
      compiler/targets/t_linux.pas
  50. 5 101
      compiler/targets/t_macos.pas
  51. 8 70
      compiler/targets/t_nwm.pas
  52. 7 79
      compiler/targets/t_os2.pas
  53. 5 51
      compiler/targets/t_palmos.pas
  54. 8 71
      compiler/targets/t_sunos.pas
  55. 9 72
      compiler/targets/t_wdosx.pas
  56. 11 88
      compiler/targets/t_win32.pas
  57. 12 9
      compiler/x86/cgx86.pas

+ 6 - 3
compiler/aggas.pas

@@ -609,7 +609,7 @@ var
                   AsmWrite('.globl'#9);
                   AsmWriteLn(tai_symbol(hp).sym.name);
                 end;
-               if target_info.target in [target_i386_linux,target_i386_beos] then
+               if target_info.system in [system_i386_linux,system_i386_beos] then
                 begin
                    AsmWrite(#9'.type'#9);
                    AsmWrite(tai_symbol(hp).sym.name);
@@ -634,7 +634,7 @@ var
 
            ait_symbol_end :
              begin
-               if target_info.target in [target_i386_linux,target_i386_beos] then
+               if target_info.system in [system_i386_linux,system_i386_beos] then
                 begin
                   s:=target_asm.labelprefix+'e'+tostr(symendcount);
                   inc(symendcount);
@@ -796,7 +796,10 @@ var
 end.
 {
   $Log$
-  Revision 1.7  2002-07-07 09:52:32  florian
+  Revision 1.8  2002-07-26 21:15:37  florian
+    * rewrote the system handling
+
+  Revision 1.7  2002/07/07 09:52:32  florian
     * powerpc target fixed, very simple units can be compiled
     * some basic stuff for better callparanode handling, far from being finished
 

+ 5 - 2
compiler/assemble.pas

@@ -1106,7 +1106,7 @@ Implementation
                end;
              ait_symbol_end :
                begin
-                 if target_info.target in [target_i386_linux,target_i386_beos] then
+                 if target_info.system in [system_i386_linux,system_i386_beos] then
                   begin
                     Tai_symbol_end(hp).sym.size:=objectalloc.sectionsize-Tai_symbol_end(hp).sym.address;
                     UsedAsmSymbolListInsert(Tai_symbol_end(hp).sym);
@@ -1596,7 +1596,10 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.38  2002-07-10 07:24:40  jonas
+  Revision 1.39  2002-07-26 21:15:37  florian
+    * rewrote the system handling
+
+  Revision 1.38  2002/07/10 07:24:40  jonas
     * memory leak fixes from Sergey Korshunoff
 
   Revision 1.37  2002/07/01 18:46:21  peter

+ 46 - 1
compiler/compiler.pas

@@ -125,6 +125,48 @@ uses
   ,cputarg
   { cpu parameter handling }
   ,cpupara
+  { system information for source system }
+  { the information about the target os  }
+  { are pulled in by the t_* units       }
+{$ifdef amiga}
+  ,i_amiga
+{$endif amiga}
+{$ifdef atari}
+  ,i_atari
+{$endif atari}
+{$ifdef beos}
+  ,i_beos
+{$endif beos}
+{$ifdef fbds}
+  ,i_fbsd
+{$endif fbds}
+{$ifdef go32v2}
+  ,i_go32v2
+{$endif go32v2}
+{$ifdef linux}
+  ,i_linux
+{$endif linux}
+{$ifdef macos}
+  ,i_macos
+{$endif macos}
+{$ifdef nwm}
+  ,i_nwm
+{$endif nwm}
+{$ifdef os2}
+  ,i_os2
+{$endif os2}
+{$ifdef palmos}
+  ,i_palmos
+{$endif palmos}
+{$ifdef sunos}
+  ,i_sunos
+{$endif sunos}
+{$ifdef wdosx}
+  ,i_wdosx
+{$endif wdosx}
+{$ifdef win32}
+  ,i_win32
+{$endif win32}
   ;
 
 function Compile(const cmd:string):longint;
@@ -349,7 +391,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.32  2002-07-11 14:41:27  florian
+  Revision 1.33  2002-07-26 21:15:37  florian
+    * rewrote the system handling
+
+  Revision 1.32  2002/07/11 14:41:27  florian
     * start of the new generic parameter handling
 
   Revision 1.31  2002/07/04 19:00:23  florian

+ 7 - 4
compiler/comprsrc.pas

@@ -124,11 +124,11 @@ var
   hr : presourcefile;
 begin
 (* OS/2 (EMX) must be processed elsewhere (in the linking/binding stage). *)
-  if target_info.target <> target_i386_os2 then
+  if target_info.system<>system_i386_os2 then
    While not current_module.ResourceFiles.Empty do
     begin
-      case target_info.target of
-        target_i386_win32,target_i386_wdosx:
+      case target_info.system of
+        system_i386_win32,system_i386_wdosx:
           hr:=new(presourcefile,init(current_module.ResourceFiles.getfirst));
         else
           Message(scan_e_resourcefiles_not_supported);
@@ -142,7 +142,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.14  2002-05-18 13:34:06  peter
+  Revision 1.15  2002-07-26 21:15:37  florian
+    * rewrote the system handling
+
+  Revision 1.14  2002/05/18 13:34:06  peter
     * readded missing revisions
 
   Revision 1.13  2002/05/16 19:46:35  carl

+ 9 - 6
compiler/export.pas

@@ -66,10 +66,10 @@ type
    TExportLibClass=class of TExportLib;
 
 var
-  CExportLib : array[ttarget] of TExportLibClass;
+  CExportLib : array[tsystem] of TExportLibClass;
   ExportLib  : TExportLib;
 
-procedure RegisterExport(t:ttarget;c:TExportLibClass);
+procedure RegisterExport(t:tsystem;c:TExportLibClass);
 procedure InitExport;
 procedure DoneExport;
 
@@ -155,7 +155,7 @@ end;
                                  Init/Done
 *****************************************************************************}
 
-procedure RegisterExport(t:ttarget;c:TExportLibClass);
+procedure RegisterExport(t:tsystem;c:TExportLibClass);
 begin
   CExportLib[t]:=c;
 end;
@@ -163,8 +163,8 @@ end;
 
 procedure InitExport;
 begin
-  if assigned(CExportLib[target_info.target]) then
-   exportlib:=CExportLib[target_info.target].Create
+  if assigned(CExportLib[target_info.system]) then
+   exportlib:=CExportLib[target_info.system].Create
   else
    exportlib:=TExportLib.Create;
 end;
@@ -180,7 +180,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.20  2002-07-01 18:46:22  peter
+  Revision 1.21  2002-07-26 21:15:37  florian
+    * rewrote the system handling
+
+  Revision 1.20  2002/07/01 18:46:22  peter
     * internal linker
     * reorganized aasm layer
 

+ 5 - 2
compiler/finput.pas

@@ -632,7 +632,7 @@ uses
          if AllowOutput and (OutputFile<>'') and (compile_level=1) then
           n:=OutputFile;
          staticlibfilename:=stringdup(p+target_info.staticlibprefix+n+target_info.staticlibext);
-         if target_info.target in [target_i386_WIN32,target_i386_wdosx] then
+         if target_info.system in [system_i386_WIN32,system_i386_wdosx] then
            sharedlibfilename:=stringdup(p+n+target_info.sharedlibext)
          else
            sharedlibfilename:=stringdup(p+target_info.sharedlibprefix+n+target_info.sharedlibext);
@@ -698,7 +698,10 @@ uses
 end.
 {
   $Log$
-  Revision 1.16  2002-07-01 18:46:22  peter
+  Revision 1.17  2002-07-26 21:15:37  florian
+    * rewrote the system handling
+
+  Revision 1.16  2002/07/01 18:46:22  peter
     * internal linker
     * reorganized aasm layer
 

+ 7 - 4
compiler/fppu.pas

@@ -161,7 +161,7 @@ uses
            exit;
          end;
       { check the target processor }
-        if ttargetcpu(ppufile.header.cpu)<>target_cpu then
+        if tsystemcpu(ppufile.header.cpu)<>target_cpu then
          begin
            ppufile.free;
            ppufile:=nil;
@@ -169,7 +169,7 @@ uses
            exit;
          end;
       { check target }
-        if ttarget(ppufile.header.target)<>target_info.target then
+        if tsystem(ppufile.header.target)<>target_info.system then
          begin
            ppufile.free;
            ppufile:=nil;
@@ -788,7 +788,7 @@ uses
          ppufile.header.interface_checksum:=ppufile.interface_crc;
          ppufile.header.compiler:=wordversion;
          ppufile.header.cpu:=word(target_cpu);
-         ppufile.header.target:=word(target_info.target);
+         ppufile.header.target:=word(target_info.system);
          ppufile.header.flags:=flags;
          ppufile.writeheader;
 
@@ -1173,7 +1173,10 @@ uses
 end.
 {
   $Log$
-  Revision 1.16  2002-05-16 19:46:36  carl
+  Revision 1.17  2002-07-26 21:15:37  florian
+    * rewrote the system handling
+
+  Revision 1.16  2002/05/16 19:46:36  carl
   + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
   + try to fix temp allocation (still in ifdef)
   + generic constructor calls

+ 7 - 4
compiler/gendef.pas

@@ -112,8 +112,8 @@ begin
   if ioresult<>0 then
    exit;
 {$ifdef i386}
-  case target_info.target of
-    target_i386_Os2 :
+  case target_info.system of
+    system_i386_Os2 :
       begin
         write(t,'NAME '+inputfile);
         if usewindowapi then
@@ -125,7 +125,7 @@ begin
         writeln(t,'STACKSIZE'#9+tostr(stacksize));
         writeln(t,'HEAPSIZE'#9+tostr(heapsize));
       end;
-  target_i386_win32, target_i386_wdosx :
+  system_i386_win32, system_i386_wdosx :
     begin
       if description<>'' then
         writeln(t,'DESCRIPTION '+''''+description+'''');
@@ -160,7 +160,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.10  2002-05-18 13:34:08  peter
+  Revision 1.11  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+
+  Revision 1.10  2002/05/18 13:34:08  peter
     * readded missing revisions
 
   Revision 1.9  2002/05/16 19:46:36  carl

+ 8 - 5
compiler/i386/ag386att.pas

@@ -255,7 +255,7 @@ interface
             idtxt  : 'AS';
             asmbin : 'as';
             asmcmd : '-o $OBJ $ASM';
-            supported_target : target_any;
+            supported_target : system_any;
             outputbinary: false;
             allowdirect : true;
             externals : false;
@@ -275,7 +275,7 @@ interface
             idtxt  : 'AS_AOUT';
             asmbin : 'as';
             asmcmd : '-o $OBJ $ASM';
-            supported_target : target_i386_os2;
+            supported_target : system_i386_os2;
             outputbinary: false;
             allowdirect : true;
             externals : false;
@@ -295,7 +295,7 @@ interface
             idtxt  : 'ASW';
             asmbin : 'asw';
             asmcmd : '-o $OBJ $ASM';
-            supported_target : target_i386_win32;
+            supported_target : system_i386_win32;
             outputbinary: false;
             allowdirect : true;
             externals : false;
@@ -316,7 +316,7 @@ interface
             idtxt  : 'ASWDOSX';
             asmbin : 'asw';
             asmcmd : '-o $OBJ $ASM';
-            supported_target : target_i386_wdosx;
+            supported_target : system_i386_wdosx;
             outputbinary: false;
             allowdirect : true;
             externals : false;
@@ -340,7 +340,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.24  2002-07-07 09:52:33  florian
+  Revision 1.25  2002-07-26 21:15:42  florian
+    * rewrote the system handling
+
+  Revision 1.24  2002/07/07 09:52:33  florian
     * powerpc target fixed, very simple units can be compiled
     * some basic stuff for better callparanode handling, far from being finished
 

+ 6 - 3
compiler/i386/ag386int.pas

@@ -783,7 +783,7 @@ ait_stab_function_name : ;
             idtxt  : 'TASM';
             asmbin : 'tasm';
             asmcmd : '/m2 /ml $ASM $OBJ';
-            supported_target : target_any; { what should I write here ?? }
+            supported_target : system_any; { what should I write here ?? }
             outputbinary: false;
             allowdirect : true;
             externals : true;
@@ -803,7 +803,7 @@ ait_stab_function_name : ;
             idtxt  : 'MASM';
             asmbin : 'masm';
             asmcmd : '/c /Cp $ASM /Fo$OBJ';
-            supported_target : target_any; { what should I write here ?? }
+            supported_target : system_any; { what should I write here ?? }
             outputbinary: false;
             allowdirect : true;
             externals : true;
@@ -823,7 +823,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.22  2002-07-01 18:46:29  peter
+  Revision 1.23  2002-07-26 21:15:43  florian
+    * rewrote the system handling
+
+  Revision 1.22  2002/07/01 18:46:29  peter
     * internal linker
     * reorganized aasm layer
 

+ 9 - 6
compiler/i386/ag386nsm.pas

@@ -793,7 +793,7 @@ interface
             idtxt  : 'NASMCOFF';
             asmbin : 'nasm';
             asmcmd : '-f coff -o $OBJ $ASM';
-            supported_target : target_i386_go32v2;
+            supported_target : system_i386_go32v2;
             outputbinary: false;
             allowdirect : true;
             externals : true;
@@ -813,7 +813,7 @@ interface
             idtxt  : 'NASMWIN32';
             asmbin : 'nasm';
             asmcmd : '-f win32 -o $OBJ $ASM';
-            supported_target : target_i386_win32;
+            supported_target : system_i386_win32;
             outputbinary: false;
             allowdirect : true;
             externals : true;
@@ -833,7 +833,7 @@ interface
             idtxt  : 'NASMOBJ';
             asmbin : 'nasm';
             asmcmd : '-f obj -o $OBJ $ASM';
-            supported_target : target_any; { what should I write here ?? }
+            supported_target : system_any; { what should I write here ?? }
             outputbinary: false;
             allowdirect : true;
             externals : true;
@@ -853,7 +853,7 @@ interface
             idtxt  : 'NASMWDOSX';
             asmbin : 'nasm';
             asmcmd : '-f win32 -o $OBJ $ASM';
-            supported_target : target_i386_wdosx;
+            supported_target : system_i386_wdosx;
             outputbinary: false;
             allowdirect : true;
             externals : true;
@@ -874,7 +874,7 @@ interface
             idtxt  : 'NASMELF';
             asmbin : 'nasm';
             asmcmd : '-f elf -o $OBJ $ASM';
-            supported_target : target_i386_linux;
+            supported_target : system_i386_linux;
             outputbinary: false;
             allowdirect : true;
             externals : true;
@@ -898,7 +898,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.21  2002-07-01 18:46:29  peter
+  Revision 1.22  2002-07-26 21:15:43  florian
+    * rewrote the system handling
+
+  Revision 1.21  2002/07/01 18:46:29  peter
     * internal linker
     * reorganized aasm layer
 

+ 5 - 2
compiler/i386/popt386.pas

@@ -1332,7 +1332,7 @@ Begin
                 End;
               A_POP:
                 Begin
-                  if target_info.target=target_i386_go32v2 then
+                  if target_info.system=system_i386_go32v2 then
                    begin
                      { Transform a series of pop/pop/pop/push/push/push to }
                      { 'movl x(%esp),%reg' for go32v2 (not for the rest,   }
@@ -2044,7 +2044,10 @@ End.
 
 {
   $Log$
-  Revision 1.29  2002-07-01 18:46:34  peter
+  Revision 1.30  2002-07-26 21:15:43  florian
+    * rewrote the system handling
+
+  Revision 1.29  2002/07/01 18:46:34  peter
     * internal linker
     * reorganized aasm layer
 

+ 7 - 4
compiler/i386/ra386.pas

@@ -196,7 +196,7 @@ end;
 
 Procedure FWaitWarning;
 begin
-  if (target_info.target=target_i386_GO32V2) and (cs_fp_emulation in aktmoduleswitches) then
+  if (target_info.system=system_i386_GO32V2) and (cs_fp_emulation in aktmoduleswitches) then
    Message(asmr_w_fwait_emu_prob);
 end;
 
@@ -601,8 +601,8 @@ begin
      So I think its at least a good idea to add a warning
      if someone uses this in assembler code
      FPC itself does not use it at all PM }
-   if (opcode=A_ENTER) and ((target_info.target=target_i386_linux) or
-        (target_info.target=target_i386_FreeBSD)) then
+   if (opcode=A_ENTER) and ((target_info.system=system_i386_linux) or
+        (target_info.system=system_i386_FreeBSD)) then
      begin
        message(asmr_w_enter_not_supported_by_linux);
      end;
@@ -669,7 +669,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.22  2002-07-01 18:46:34  peter
+  Revision 1.23  2002-07-26 21:15:44  florian
+    * rewrote the system handling
+
+  Revision 1.22  2002/07/01 18:46:34  peter
     * internal linker
     * reorganized aasm layer
 

+ 5 - 2
compiler/i386/ra386att.pas

@@ -1988,7 +1988,7 @@ Begin
         Begin
           Consume(AS_ALIGN);
           l1:=BuildConstExpression(false,false);
-          if (target_info.target in [target_i386_GO32V2]) then
+          if (target_info.system in [system_i386_GO32V2]) then
             begin
                l2:=1;
                if (l1>=0) and (l1<=16) then
@@ -2129,7 +2129,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.25  2002-07-01 18:46:34  peter
+  Revision 1.26  2002-07-26 21:15:44  florian
+    * rewrote the system handling
+
+  Revision 1.25  2002/07/01 18:46:34  peter
     * internal linker
     * reorganized aasm layer
 

+ 90 - 0
compiler/i_amiga.pas

@@ -0,0 +1,90 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for AmigaOS
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for the AmigaOS. }
+unit i_amiga;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_m68k_amiga_info : tsysteminfo =
+          (
+            system       : target_m68k_Amiga;
+            name         : 'Commodore Amiga';
+            shortname    : 'amiga';
+            flags        : [];
+            cpu          : cpu_m68k;
+            short_name   : 'AMIGA';
+            unit_env     : '';
+            extradefines : '';
+            sharedlibext : '.library';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '';
+            scriptext    : '';
+            smartext     : '.sl';
+            unitext      : '.ppa';
+            unitlibext   : '.ppl';
+            asmext       : '.asm';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            staticlibprefix : '';
+            sharedlibprefix : '';
+            Cprefix      : '_';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_m68k_as;
+            assemextern  : as_m68k_as;
+            link         : ld_m68k_amiga;
+            linkextern   : ld_m68k_amiga;
+            ar           : ar_m68k_ar;
+            res          : res_none;
+            script       : script_amiga;
+            endian       : endian_big;
+            stackalignment : 2;
+            maxCrecordalignment : 4;
+            heapsize     : 128*1024;
+            stacksize    : 8192;
+            DllScanSupported:false;
+            use_function_relative_addresses : false
+          );
+
+  implementation
+
+initialization
+{$ifdef cpu68}
+  {$ifdef AMIGA}
+    set_source_info(system_m68k_Amiga);
+  {$endif amiga}
+{$endif cpu68}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 90 - 0
compiler/i_atari.pas

@@ -0,0 +1,90 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for atari
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for atari. }
+unit i_atari;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_m68k_atari_info : tsysteminfo =
+          (
+            system       : target_m68k_Atari;
+            name         : 'Atari ST/STE';
+            shortname    : 'atari';
+            flags        : [];
+            cpu          : cpu_m68k;
+            short_name   : 'ATARI';
+            unit_env     : '';
+            extradefines : '';
+            sharedlibext : '.dll';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '.tpp';
+            defext       : '';
+            scriptext    : '';
+            smartext     : '.sl';
+            unitext      : '.ppt';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            staticlibprefix : '';
+            sharedlibprefix : '';
+            Cprefix      : '_';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_m68k_as;
+            assemextern  : as_m68k_as;
+            link         : ld_m68k_atari;
+            linkextern   : ld_m68k_atari;
+            ar           : ar_m68k_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_big;
+            stackalignment : 2;
+            maxCrecordalignment : 4;
+            heapsize     : 16*1024;
+            stacksize    : 8192;
+            DllScanSupported:false;
+            use_function_relative_addresses : false
+          );
+
+  implementation
+
+initialization
+{$ifdef cpu68}
+  {$ifdef atari}
+    set_source_info(system_m68k_atari_info);
+  {$endif atari}
+{$endif cpu68}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 108 - 0
compiler/i_beos.pas

@@ -0,0 +1,108 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for BeOS
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for BeOS. }
+unit i_beos;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_i386_beos_info : tsysteminfo =
+          (
+            system       : system_i386_BeOS;
+            name         : 'Beos for i386';
+            shortname    : 'Beos';
+            flags        : [tf_under_development];
+            cpu          : cpu_i386;
+            unit_env     : 'BEOSUNITS';
+            extradefines : '';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_i386_as;
+            assemextern  : as_i386_as;
+            link         : ld_i386_beos;
+            linkextern   : ld_i386_beos;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 8192;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+  implementation
+
+initialization
+{$ifdef cpu86}
+  {$ifdef beos}
+    set_source_info(system_i386_beos_info);
+  {$endif beos}
+{$endif cpu86}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 244 - 0
compiler/i_fbsd.pas

@@ -0,0 +1,244 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for FreeBSD/NetBSD
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for FreeBSD/NetBSD. }
+unit i_fbsd;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_i386_freebsd_info : tsysteminfo =
+          (
+            system       : system_i386_FreeBSD;
+            name         : 'FreeBSD/ELF for i386';
+            shortname    : 'FreeBSD';
+            flags        : [];
+            cpu          : cpu_i386;
+            unit_env     : 'BSDUNITS';
+            extradefines : 'UNIX;BSD';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_i386_elf32;
+            assemextern  : as_i386_as;
+            link         : ld_i386_freebsd;
+            linkextern   : ld_i386_freebsd;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize    : 256*1024;
+            stacksize   : 262144;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+       system_i386_netbsd_info : tsysteminfo =
+          (
+            system       : system_i386_NetBSD;
+            name         : 'NetBSD for i386';
+            shortname    : 'NetBSD';
+            flags        : [tf_under_development];
+            cpu          : cpu_i386;
+            unit_env     : 'BSDUNITS';
+            extradefines : 'UNIX;BSD';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '_';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_i386_as;
+            assemextern  : as_i386_as;
+            link         : ld_i386_freebsd;
+            linkextern   : ld_i386_freebsd;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 1;
+                varalignmin     : 0;
+                varalignmax     : 1;
+                localalignmin   : 0;
+                localalignmax   : 1;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize    : 256*1024;
+            stacksize   : 262144;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+       system_m68k_netbsd_info : tsysteminfo =
+          (
+            system       : system_m68k_NetBSD;
+            name         : 'NetBSD for m68k';
+            shortname    : 'NetBSD';
+            flags        : [tf_under_development];
+            cpu          : cpu_m68k;
+            unit_env     : 'BSDUNITS';
+            extradefines : 'UNIX;BSD';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_m68k_as;
+            assemextern  : as_m68k_as;
+            link         : ld_m68k_freebsd;
+            linkextern   : ld_m68k_freebsd;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_big;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 1;
+                varalignmin     : 0;
+                varalignmax     : 1;
+                localalignmin   : 0;
+                localalignmax   : 1;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize    : 256*1024;
+            stacksize   : 262144;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+  implementation
+
+initialization
+{$ifdef cpu86}
+  {$ifdef FreeBSD}
+     set_source_info(system_i386_FreeBSD_info);
+  {$endif}
+  {$ifdef NetBSD}
+     set_source_info(system_i386_NetBSD_info);
+  {$endif}
+{$endif cpu86}
+{$ifdef cpu68}
+  {$ifdef NetBSD}
+     set_source_info(system_m68k_NetBSD_info);
+  {$endif NetBSD}
+{$endif cpu68}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 108 - 0
compiler/i_go32v2.pas

@@ -0,0 +1,108 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for go32v2
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for go32v2. }
+unit i_go32v2;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_i386_go32v2_info : tsysteminfo =
+          (
+            system       : system_i386_GO32V2;
+            name         : 'GO32 V2 DOS extender';
+            shortname    : 'Go32v2';
+            flags        : [];
+            cpu          : cpu_i386;
+            unit_env     : 'GO32V2UNITS';
+            extradefines : 'DPMI';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '.exe';
+            defext       : '.def';
+            scriptext    : '.bat';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.dll';
+            staticlibext : '.a';
+            staticlibprefix : '';
+            sharedlibprefix : '';
+            sharedClibext : '.dll';
+            staticClibext : '.a';
+            staticClibprefix : '';
+            sharedClibprefix : '';
+            Cprefix      : '_';
+            newline      : #13#10;
+            dirsep       : '\';
+            files_case_relevent : false;
+            assem        : as_i386_coff;
+            assemextern  : as_i386_as;
+            link         : ld_i386_coff;
+            linkextern   : ld_i386_go32v2;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_dos;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 2;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 2048*1024;
+            stacksize    : 262144;
+            DllScanSupported : false;
+            use_function_relative_addresses : true
+          );
+
+  implementation
+
+initialization
+{$ifdef cpu86}
+  {$ifdef go32v2}
+    set_source_info(system_i386_go32v2_info);
+  {$endif go32v2}
+{$endif cpu86}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 451 - 0
compiler/i_linux.pas

@@ -0,0 +1,451 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for linux
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for linux. }
+unit i_linux;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_i386_linux_info : tsysteminfo =
+          (
+            system       : system_i386_LINUX;
+            name         : 'Linux for i386';
+            shortname    : 'Linux';
+            flags        : [];
+            cpu          : cpu_i386;
+            unit_env     : 'LINUXUNITS';
+            extradefines : 'UNIX';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_i386_elf32;
+            assemextern  : as_i386_as;
+            link         : ld_i386_linux;
+            linkextern   : ld_i386_linux;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 262144;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+       system_m68k_linux_info : tsysteminfo =
+          (
+            system       : system_m68k_linux;
+            name         : 'Linux for m68k';
+            shortname    : 'linux';
+            flags        : [];
+            cpu          : cpu_m68k;
+            unit_env     : 'LINUXUNITS';
+            extradefines : 'UNIX';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_m68k_as;
+            assemextern  : as_m68k_as;
+            link         : ld_m68k_linux;
+            linkextern   : ld_m68k_linux;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_big;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 128*1024;
+            stacksize    : 32*1024*1024;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+       system_powerpc_linux_info : tsysteminfo =
+          (
+            system       : system_powerpc_LINUX;
+            name         : 'Linux for PowerPC';
+            shortname    : 'linux';
+            flags        : [];
+            cpu          : cpu_powerpc;
+            unit_env     : '';
+            extradefines : 'UNIX';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.s';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_powerpc_as;
+            assemextern  : as_powerpc_as;
+            link         : ld_powerpc_linux;
+            linkextern   : ld_powerpc_linux;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_big;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 32*1024*1024;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+       system_alpha_linux_info : tsysteminfo =
+          (
+            system       : system_alpha_LINUX;
+            name         : 'Linux for Alpha';
+            shortname    : 'linux';
+            flags        : [];
+            cpu          : cpu_alpha;
+            unit_env     : 'LINUXUNITS';
+            extradefines : 'UNIX';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_alpha_as;
+            assemextern  : as_alpha_as;
+            link         : ld_alpha_linux;
+            linkextern   : ld_alpha_linux;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 32*1024*1024;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+       system_x86_64_linux_info : tsysteminfo =
+          (
+            system       : system_i386_LINUX;
+            name         : 'Linux for x86-64';
+            shortname    : 'linux';
+            flags        : [];
+            cpu          : cpu_x86_64;
+            unit_env     : 'LINUXUNITS';
+            extradefines : 'UNIX';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_i386_elf32;
+            assemextern  : as_i386_as;
+            link         : ld_i386_linux;
+            linkextern   : ld_i386_linux;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 1;
+                varalignmin     : 0;
+                varalignmax     : 1;
+                localalignmin   : 0;
+                localalignmax   : 1;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 16;
+            heapsize     : 256*1024;
+            stacksize    : 16*1024;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+       system_SPARC_linux_info : tsysteminfo =
+          (
+            system       : system_SPARC_Linux;
+            name         : 'Linux for SPARC';
+            shortname    : 'linux';
+            flags        : [];
+            cpu          : cpu_SPARC;
+            unit_env     : 'LINUXUNITS';
+            extradefines : 'UNIX';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_SPARC_elf32;
+            assemextern  : as_SPARC_as;
+            link         : ld_SPARC_linux;
+            linkextern   : ld_SPARC_linux;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 262144;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+  implementation
+
+initialization
+{$ifdef CPU86}
+  {$ifdef linux}
+    { some FreeBSD versions define linux as well }
+    {$ifndef FreeBSD}
+      set_source_info(system_i386_linux_info);
+    {$endif FreeBSD}
+  {$endif}
+{$endif CPU86}
+{$ifdef CPU68}
+  {$ifdef linux}
+    set_source_info(system_m68k_linux_info);
+  {$endif linux}
+{$endif CPU68}
+{$ifdef CPU86_64}
+  {$ifdef linux}
+    set_source_info(system_x86_64_linux_info);
+  {$endif linux}
+{$endif CPU86_64}
+{$ifdef CPUALPHA}
+  {$ifdef linux}
+    set_source_info(system_sparc_linux_info);
+  {$endif linux}
+{$endif CPUALPHA}
+{$ifdef CPUSPARC}
+  {$ifdef linux}
+    set_source_info(system_sparc_linux_info);
+  {$endif linux}
+{$endif CPUSPARC}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 142 - 0
compiler/i_macos.pas

@@ -0,0 +1,142 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for MacOS
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for MacOS. }
+unit i_macos;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_m68k_macos_info : tsysteminfo =
+          (
+            system       : system_m68k_Mac;
+            name         : 'Macintosh m68k';
+            shortname    : 'mac';
+            flags        : [];
+            cpu          : cpu_m68k;
+            short_name   : 'MACOS';
+            unit_env     : '';
+            extradefines : '';
+            sharedlibext : 'Lib';
+            staticlibext : 'Lib';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '';
+            scriptext    : '';
+            smartext     : '.sl';
+            unitext      : '.ppt';
+            unitlibext   : '.ppl';
+            asmext       : '.a';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            staticlibprefix : '';
+            sharedlibprefix : '';
+            Cprefix      : '_';
+            newline      : #13;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_m68k_mpw;
+            assemextern  : as_m68k_mpw;
+            link         : ld_m68k_mac;
+            linkextern   : ld_m68k_mac;
+            ar           : ar_m68k_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_big;
+            stackalignment : 2;
+            maxCrecordalignment : 4;
+            size_of_longint : 4;
+            heapsize     : 128*1024;
+            stacksize    : 8192;
+            DllScanSupported:false;
+            use_function_relative_addresses : false
+          );
+
+     const
+       system_powerpc_macos_info : tsysteminfo =
+          (
+            system       : system_powerpc_MACOS;
+            name         : 'MacOs (PowerPC)';
+            shortname    : 'MacOs/PPC';
+            flags        : [];
+            cpu          : cpu_powerpc;
+            short_name   : 'MACOS';
+            unit_env     : '';
+            extradefines : '';
+            sharedlibext : 'Lib';
+            staticlibext : 'Lib';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '';
+            scriptext    : '';
+            smartext     : '.sl';
+            unitext      : '.ppt';
+            unitlibext   : '.ppl';
+            asmext       : '.a';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            staticlibprefix : '';
+            sharedlibprefix : '';
+            Cprefix      : '';
+            newline      : #13;
+            assem        : as_powerpc_mpw;
+            assemextern  : as_powerpc_mpw;
+            link         : ld_powerpc_macos;
+            linkextern   : ld_powerpc_macos;
+            ar           : ar_powerpc_ar;
+            res          : res_powerpc_mpw;
+            script       : script_unix;
+            endian       : endian_big;
+            stackalignment : 8;
+            maxCrecordalignment : 32;
+            size_of_longint : 4;
+            heapsize     : 256*1024;
+            stacksize    : 8192;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+  implementation
+
+initialization
+{$ifdef cpu68}
+  {$ifdef macos}
+    set_source_info(system_m68k_macos_info);
+  {$endif macos}
+{$endif cpu68}
+{$ifdef cpupowerpc}
+  {$ifdef macos}
+    set_source_info(system_powerpc_macos_info);
+  {$endif macos}
+{$endif cpupowerpc}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 108 - 0
compiler/i_nwm.pas

@@ -0,0 +1,108 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for Netware modules
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for Netware modules. }
+unit i_nwm;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_i386_netware_info : tsysteminfo =
+          (
+            system       : system_i386_netware;
+            name         : 'Netware for i386';
+            shortname    : 'Netware';
+            flags        : [];
+            cpu          : cpu_i386;
+            unit_env     : 'NETWAREUNITS';
+            extradefines : '';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '.nlm';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppn';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.on';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.nlm';
+            staticlibext : '.a';
+            staticlibprefix : '';
+            sharedlibprefix : '';
+            sharedClibext : '.nlm';
+            staticClibext : '.a';
+            staticClibprefix : '';
+            sharedClibprefix : '';
+            Cprefix      : '';
+            newline      : #13#10;
+            dirsep       : '\';
+            files_case_relevent : false;
+            assem        : as_i386_elf32;
+            assemextern  : as_i386_as;
+            link         : ld_i386_netware;
+            linkextern   : ld_i386_netware;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 1;
+                varalignmin     : 0;
+                varalignmax     : 1;
+                localalignmin   : 0;
+                localalignmax   : 1;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 8192;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+  implementation
+
+initialization
+{$ifdef CPU86}
+  {$ifdef netware}
+    set_source_info(target_i386_netware_info);
+  {$endif netware}
+{$endif CPU86}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 120 - 0
compiler/i_os2.pas

@@ -0,0 +1,120 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for OS/2
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for OS/2. }
+unit i_os2;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       res_emxbind_info : tresinfo =
+          (
+            id     : res_emxbind;
+            resbin : 'emxbind';
+            rescmd : '-b -r $RES $OBJ'
+            (* Not really used - see TLinkeros2.SetDefaultInfo in t_os2.pas. *)
+          );
+
+       system_i386_os2_info : tsysteminfo =
+          (
+            system       : system_i386_OS2;
+            name         : 'OS/2 via EMX';
+            shortname    : 'OS2';
+            flags        : [tf_need_export];
+            cpu          : cpu_i386;
+            unit_env     : 'OS2UNITS';
+            extradefines : '';
+            sourceext    : '.pas';
+            pasext       : '.pp';
+            exeext       : '.exe';
+            defext       : '.def';
+            scriptext    : '.cmd';
+            smartext     : '.sl';
+            unitext      : '.ppo';
+            unitlibext   : '.ppl';
+            asmext       : '.so2';
+            objext       : '.oo2';
+            resext       : '.res';
+            resobjext    : '.oor';
+            sharedlibext : '.ao2';
+            staticlibext : '.ao2';
+            staticlibprefix : '';
+            sharedlibprefix : '';
+            sharedClibext : 'dll';
+            staticClibext : '.a';
+            staticClibprefix : '';
+            sharedClibprefix : '';
+            Cprefix      : '_';
+            newline      : #13#10;
+            dirsep       : '\';
+            files_case_relevent : false;
+            assem        : as_i386_as_aout;
+            assemextern  : as_i386_as_aout;
+            link         : ld_i386_os2;
+            linkextern   : ld_i386_os2;
+            ar           : ar_gnu_ar;
+            res          : res_emxbind;
+            script       : script_dos;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 256*1024;
+            DllScanSupported:true;
+            use_function_relative_addresses : false
+          );
+
+
+  implementation
+
+initialization
+{$ifdef CPU86}
+  {$ifdef os2}
+    set_source_info(system_i386_os2_info);
+    { OS/2 via EMX can be run under DOS as well }
+    if (OS_Mode=osDOS) or (OS_Mode=osDPMI) then
+      source_info.scriptext := '.bat';
+  {$endif os2}
+{$endif CPU86}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 90 - 0
compiler/i_palmos.pas

@@ -0,0 +1,90 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for PalmOS
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for PalmOS. }
+unit i_palmos;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_m68k_palmos_info : tsysteminfo =
+          (
+            system       : system_m68k_PalmOS;
+            name         : 'PalmOS';
+            shortname    : 'palmos';
+            flags        : [tf_code_small,tf_static_a5_based];
+            cpu          : cpu_m68k;
+            short_name   : 'PALMOS';
+            unit_env     : 'PALMUNITS';
+            extradefines : '';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            Cprefix      : '_';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_m68k_as;
+            assemextern  : as_m68k_as;
+            link         : ld_m68k_palmos;
+            linkextern   : ld_m68k_palmos;
+            ar           : ar_m68k_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_big;
+            stackalignment : 2;
+            maxCrecordalignment : 4;
+            heapsize     : 128*1024;
+            stacksize    : 8192;
+            DllScanSupported:false;
+            use_function_relative_addresses : false
+          );
+
+  implementation
+
+initialization
+{$ifdef cpu68}
+  {$ifdef palmos}
+    set_source_info(system_m68k_palmos_info);
+  {$endif palmos}
+{$endif cpu68}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 109 - 0
compiler/i_sunos.pas

@@ -0,0 +1,109 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for SunOS
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for SunOS. }
+unit i_sunos;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_i386_sunos_info : tsysteminfo =
+          (
+            system       : system_i386_sunos;
+            name         : 'SunOS/ELF for i386';
+            shortname    : 'SunOS';
+            flags        : [tf_under_development];
+            cpu          : cpu_i386;
+            unit_env     : 'SUNOSUNITS';
+            extradefines : 'UNIX;SOLARIS;LIBC';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            files_case_relevent : true;
+            assem        : as_i386_as;
+            assemextern  : as_i386_as;
+            link         : ld_i386_sunos;
+            linkextern   : ld_i386_sunos;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 1;
+                varalignmin     : 0;
+                varalignmax     : 1;
+                localalignmin   : 0;
+                localalignmax   : 1;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 262144;
+            DllScanSupported:false;
+            use_function_relative_addresses : true
+          );
+
+
+  implementation
+
+initialization
+{$ifdef CPU86}
+  {$ifdef sunos}
+    set_source_info(system_i386_sunos_info);
+  {$endif sunos}
+{$endif CPU86}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 110 - 0
compiler/i_wdosx.pas

@@ -0,0 +1,110 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for win32
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for wdosx. }
+unit i_wdosx;
+
+  interface
+
+    uses
+       systems;
+
+    const
+       system_i386_wdosx_info : tsysteminfo =
+          (
+            system       : system_i386_wdosx;
+            name         : 'WDOSX DOS extender';
+            shortname    : 'WDOSX';
+            flags        : [];
+            cpu          : cpu_i386;
+            unit_env     : 'WDOSXUNITS';
+            extradefines : 'MSWINDOWS';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '.exe';
+            defext       : '.def';
+            scriptext    : '.bat';
+            smartext     : '.sld';
+            unitext      : '.ppd';
+            unitlibext   : '.ppl';
+            asmext       : '.sd';
+            objext       : '.od';
+            resext       : '.rc';
+            resobjext    : '.odr';
+            sharedlibext : '.dll';
+            staticlibext : '.ad';
+            staticlibprefix : 'libp';
+            sharedlibprefix : '';
+            sharedClibext : '.dll';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : '';
+            Cprefix      : '_';
+            newline      : #13#10;
+            dirsep       : '\';
+            files_case_relevent : false;
+            assem        : as_i386_pecoffwdosx;
+            assemextern  : as_i386_aswdosx;
+            link         : ld_i386_wdosx;
+            linkextern   : ld_i386_wdosx;
+            ar           : ar_gnu_arw;
+            res          : res_gnu_windres;
+            script       : script_dos;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 16
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 32*1024*1024;
+            DllScanSupported:true;
+            use_function_relative_addresses : true
+          );
+
+  implementation
+
+initialization
+{$ifdef CPU86}
+  {$ifdef WIN32}
+    {$ifdef WDOSX}
+      set_source_info(system_i386_wdosx_info);
+    {$endif WDOSX}
+  {$endif WIN32}
+{$endif CPU86}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 125 - 0
compiler/i_win32.pas

@@ -0,0 +1,125 @@
+{
+    $Id$
+    Copyright (c) 1998-2002 by Peter Vreman
+
+    This unit implements support information structures for win32
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+{ This unit implements support information structures for win32. }
+unit i_win32;
+
+  interface
+
+    uses
+       systems;
+
+    const
+      ar_gnu_arw_info : tarinfo =
+          (
+            id    : ar_gnu_arw;
+            arcmd : 'arw rs $LIB $FILES'
+          );
+
+    const
+      res_gnu_windres_info : tresinfo =
+          (
+            id     : res_gnu_windres;
+            resbin : 'windres';
+            rescmd : '--include $INC -O coff -o $OBJ $RES'
+          );
+
+    const
+       system_i386_win32_info : tsysteminfo =
+          (
+            system       : system_i386_WIN32;
+            name         : 'Win32 for i386';
+            shortname    : 'Win32';
+            flags        : [];
+            cpu          : cpu_i386;
+            unit_env     : 'WIN32UNITS';
+            extradefines : 'MSWINDOWS';
+            sourceext    : '.pp';
+            pasext       : '.pas';
+            exeext       : '.exe';
+            defext       : '.def';
+            scriptext    : '.bat';
+            smartext     : '.slw';
+            unitext      : '.ppw';
+            unitlibext   : '.ppl';
+            asmext       : '.sw';
+            objext       : '.ow';
+            resext       : '.rc';
+            resobjext    : '.owr';
+            sharedlibext : '.dll';
+            staticlibext : '.aw';
+            staticlibprefix : 'libp';
+            sharedlibprefix : '';
+            sharedClibext : '.dll';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : '';
+            Cprefix      : '_';
+            newline      : #13#10;
+            dirsep       : '\';
+            files_case_relevent : false;
+            assem        : as_i386_pecoff;
+            assemextern  : as_i386_asw;
+            link         : ld_i386_win32;
+            linkextern   : ld_i386_win32;
+            ar           : ar_gnu_arw;
+            res          : res_gnu_windres;
+            script       : script_dos;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 0;
+                localalignmax   : 4;
+                paraalign       : 4;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 16
+              );
+            first_parm_offset : 8;
+            heapsize     : 256*1024;
+            stacksize    : 262144;
+            DllScanSupported:true;
+            use_function_relative_addresses : true
+          );
+
+  implementation
+
+initialization
+{$ifdef CPU86}
+  {$ifdef WIN32}
+    {$ifndef WDOSX}
+      set_source_info(system_i386_win32_info);
+    {$endif WDOSX}
+  {$endif WIN32}
+{$endif CPU86}
+end.
+{
+  $Log$
+  Revision 1.1  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+}

+ 12 - 9
compiler/import.pas

@@ -79,12 +79,12 @@ type
    TDLLScannerClass=class of TDLLScanner;
 
 var
-  CImportLib  : array[ttarget] of TImportLibClass;
-  CDLLScanner : array[ttarget] of TDLLScannerClass;
+  CImportLib  : array[tsystem] of TImportLibClass;
+  CDLLScanner : array[tsystem] of TDLLScannerClass;
   ImportLib   : TImportLib;
 
-procedure RegisterImport(t:ttarget;c:TImportLibClass);
-procedure RegisterDLLScanner(t:ttarget;c:TDLLScannerClass);
+procedure RegisterImport(t:tsystem;c:TImportLibClass);
+procedure RegisterDLLScanner(t:tsystem;c:TDLLScannerClass);
 procedure InitImport;
 procedure DoneImport;
 
@@ -207,13 +207,13 @@ end;
                                  Init/Done
 *****************************************************************************}
 
-procedure RegisterImport(t:ttarget;c:TImportLibClass);
+procedure RegisterImport(t:tsystem;c:TImportLibClass);
 begin
   CImportLib[t]:=c;
 end;
 
 
-procedure RegisterDLLScanner(t:ttarget;c:TDLLScannerClass);
+procedure RegisterDLLScanner(t:tsystem;c:TDLLScannerClass);
 begin
   CDLLScanner[t]:=c;
 end;
@@ -221,8 +221,8 @@ end;
 
 procedure InitImport;
 begin
-  if assigned(CImportLib[target_info.target]) then
-   importlib:=CImportLib[target_info.target].Create
+  if assigned(CImportLib[target_info.system]) then
+   importlib:=CImportLib[target_info.system].Create
   else
    importlib:=TImportLib.Create;
 end;
@@ -237,7 +237,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.18  2002-07-01 18:46:22  peter
+  Revision 1.19  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+
+  Revision 1.18  2002/07/01 18:46:22  peter
     * internal linker
     * reorganized aasm layer
 

+ 5 - 2
compiler/ncgutil.pas

@@ -1229,7 +1229,7 @@ implementation
            if (aktprocdef.proctypeoption=potype_proginit) then
             begin
               { initialize profiling for win32 }
-              if (target_info.target in [target_I386_WIN32,target_I386_wdosx]) and
+              if (target_info.system in [system_i386_win32,system_i386_wdosx]) and
                  (cs_profile in aktmoduleswitches) then
                 cg.a_call_name(list,'__monstartup');
 
@@ -1629,7 +1629,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.24  2002-07-25 17:58:24  carl
+  Revision 1.25  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+
+  Revision 1.24  2002/07/25 17:58:24  carl
     + FPURESULTREG -> FPU_RESULT_REG
 
   Revision 1.23  2002/07/20 11:57:54  florian

+ 7 - 4
compiler/ogcoff.pas

@@ -1674,7 +1674,7 @@ const go32v2stub : array[0..2047] of byte=(
             idtxt  : 'COFF';
             asmbin : '';
             asmcmd : '';
-            supported_target : target_i386_go32v2;
+            supported_target : system_i386_go32v2;
             outputbinary : true;
             allowdirect : false;
             externals : true;
@@ -1695,7 +1695,7 @@ const go32v2stub : array[0..2047] of byte=(
             idtxt  : 'PECOFF';
             asmbin : '';
             asmcmd : '';
-            supported_target : target_i386_win32;
+            supported_target : system_i386_win32;
             outputbinary : true;
             allowdirect : false;
             externals : true;
@@ -1715,7 +1715,7 @@ const go32v2stub : array[0..2047] of byte=(
             idtxt  : 'PECOFFWDOSX';
             asmbin : '';
             asmcmd : '';
-            supported_target : target_i386_wdosx;
+            supported_target : system_i386_wdosx;
             outputbinary : true;
             allowdirect : false;
             externals : true;
@@ -1739,7 +1739,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.22  2002-07-01 18:46:24  peter
+  Revision 1.23  2002-07-26 21:15:38  florian
+    * rewrote the system handling
+
+  Revision 1.22  2002/07/01 18:46:24  peter
     * internal linker
     * reorganized aasm layer
 

+ 5 - 2
compiler/ogelf.pas

@@ -833,7 +833,7 @@ implementation
             idtxt  : 'ELF';
             asmbin : '';
             asmcmd : '';
-            supported_target : target_any;  //target_i386_linux;
+            supported_target : system_any;  //target_i386_linux;
             outputbinary : true;
             allowdirect : false;
             externals : true;
@@ -853,7 +853,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.16  2002-07-01 18:46:24  peter
+  Revision 1.17  2002-07-26 21:15:39  florian
+    * rewrote the system handling
+
+  Revision 1.16  2002/07/01 18:46:24  peter
     * internal linker
     * reorganized aasm layer
 

+ 10 - 7
compiler/options.pas

@@ -124,7 +124,7 @@ end;
 
 procedure set_default_link_type;
 begin
-  if (target_info.target in [target_i386_win32,target_i386_wdosx]) then
+  if (target_info.system in [system_i386_win32,system_i386_wdosx]) then
     begin
       def_symbol('FPC_LINK_SMART');
       undef_symbol('FPC_LINK_STATIC');
@@ -174,7 +174,7 @@ procedure Toption.WriteInfo;
 var
   p : pchar;
   hs,hs1,s : string;
-  target : ttarget;
+  target : tsystem;
 begin
   p:=MessagePchar(option_info);
   while assigned(p) do
@@ -183,7 +183,7 @@ begin
      { list OS Targets }
      if pos('$OSTARGETS',s)>0 then
       begin
-        for target:=low(ttarget) to high(ttarget) do
+        for target:=low(tsystem) to high(tsystem) do
          if assigned(targetinfos[target]) then
           begin
             hs:=s;
@@ -1393,7 +1393,7 @@ begin
   def_symbol('CPUIA64');
 {$endif}
 {$ifdef x64_64}
-  def_symbol('CPU 86_64');
+  def_symbol('CPU86_64');
 {$endif}
 {$ifdef sparc}
   def_symbol('CPUSPARC');
@@ -1635,8 +1635,8 @@ begin
      set_target_asm(target_info.assemextern);
    end;
 
-  if (target_asm.supported_target <> target_any) and
-     (target_asm.supported_target <> target_info.target) then
+  if (target_asm.supported_target <> system_any) and
+     (target_asm.supported_target <> target_info.system) then
    begin
      Message2(option_incompatible_asm,target_asm.idtxt,target_info.name);
      set_target_asm(target_info.assemextern);
@@ -1677,7 +1677,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.77  2002-07-20 17:16:03  florian
+  Revision 1.78  2002-07-26 21:15:39  florian
+    * rewrote the system handling
+
+  Revision 1.77  2002/07/20 17:16:03  florian
     + source code page support
 
   Revision 1.76  2002/07/04 20:43:01  florian

+ 7 - 1
compiler/paramgr.pas

@@ -51,6 +51,9 @@ unit paramgr;
             function results will be passed.
           }
           function getfuncretloc(p : tabstractprocdef) : tparalocation;virtual;abstract;
+          { Returns the self pointer for the give procdef
+          function getfuncretloc(p : tabstractprocdef) : tparalocation;virtual;abstract;
+          }
        end;
 
     var
@@ -132,7 +135,10 @@ end.
 
 {
    $Log$
-   Revision 1.4  2002-07-20 11:57:55  florian
+   Revision 1.5  2002-07-26 21:15:39  florian
+     * rewrote the system handling
+
+   Revision 1.4  2002/07/20 11:57:55  florian
      * types.pas renamed to defbase.pas because D6 contains a types
        unit so this would conflicts if D6 programms are compiled
      + Willamette/SSE2 instructions to assembler added

+ 5 - 2
compiler/pdecsub.pas

@@ -758,7 +758,7 @@ begin
   if lexlevel<>normal_function_level then
     Message(parser_e_dont_nest_export);
   { only os/2 needs this }
-  if target_info.target=target_i386_os2 then
+  if target_info.system=system_i386_os2 then
    begin
      aktprocdef.aliasnames.insert(aktprocsym.realname);
      procinfo^.exported:=true;
@@ -1957,7 +1957,10 @@ const
 end.
 {
   $Log$
-  Revision 1.60  2002-07-20 11:57:55  florian
+  Revision 1.61  2002-07-26 21:15:40  florian
+    * rewrote the system handling
+
+  Revision 1.60  2002/07/20 11:57:55  florian
     * types.pas renamed to defbase.pas because D6 contains a types
       unit so this would conflicts if D6 programms are compiled
     + Willamette/SSE2 instructions to assembler added

+ 6 - 3
compiler/pdecvar.pas

@@ -258,7 +258,7 @@ implementation
                    if (not symdone) then
                     begin
                       if is_constintnode(pt) and
-                         ((target_info.target=target_i386_go32v2) or
+                         ((target_info.system=system_i386_go32v2) or
                           (m_objfpc in aktmodeswitches) or
                           (m_delphi in aktmodeswitches)) then
                        begin
@@ -269,7 +269,7 @@ implementation
                          abssym.absseg:=false;
                          abssym.address:=tordconstnode(pt).value;
                          if (token=_COLON) and
-                            (target_info.target=target_i386_go32v2) then
+                            (target_info.system=system_i386_go32v2) then
                           begin
                             consume(token);
                             pt.free;
@@ -583,7 +583,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.28  2002-07-20 11:57:55  florian
+  Revision 1.29  2002-07-26 21:15:40  florian
+    * rewrote the system handling
+
+  Revision 1.28  2002/07/20 11:57:55  florian
     * types.pas renamed to defbase.pas because D6 contains a types
       unit so this would conflicts if D6 programms are compiled
     + Willamette/SSE2 instructions to assembler added

+ 6 - 3
compiler/pexports.pas

@@ -96,7 +96,7 @@ implementation
                         an underline }
                       if InternalProcName[1]='_' then
                         delete(InternalProcName,1,1)
-                      else if (target_info.target in [target_i386_win32,target_i386_wdosx]) and UseDeffileForExport then
+                      else if (target_info.system in [system_i386_win32,system_i386_wdosx]) and UseDeffileForExport then
                         begin
                           Message(parser_e_dlltool_unit_var_problem);
                           Message(parser_e_dlltool_unit_var_problem2);
@@ -118,7 +118,7 @@ implementation
                        end;
                       hp.options:=hp.options or eo_index;
                       pt.free;
-                      if target_info.target in [target_i386_win32,target_i386_wdosx] then
+                      if target_info.system in [system_i386_win32,system_i386_wdosx] then
                        DefString:=srsym.realname+'='+InternalProcName+' @ '+tostr(hp.index)
                       else
                        DefString:=srsym.realname+'='+InternalProcName; {Index ignored!}
@@ -173,7 +173,10 @@ end.
 
 {
   $Log$
-  Revision 1.21  2002-05-18 13:34:12  peter
+  Revision 1.22  2002-07-26 21:15:41  florian
+    * rewrote the system handling
+
+  Revision 1.21  2002/05/18 13:34:12  peter
     * readded missing revisions
 
   Revision 1.20  2002/05/16 19:46:43  carl

+ 5 - 2
compiler/pexpr.pas

@@ -1459,7 +1459,7 @@ implementation
                               begin
                                 p2:=comp_expr(true);
                               { support SEG:OFS for go32v2 Mem[] }
-                                if (target_info.target=target_i386_go32v2) and
+                                if (target_info.system=system_i386_go32v2) and
                                    (p1.nodetype=loadn) and
                                    assigned(tloadnode(p1).symtableentry) and
                                    assigned(tloadnode(p1).symtableentry.owner.name) and
@@ -2251,7 +2251,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.73  2002-07-23 09:51:23  daniel
+  Revision 1.74  2002-07-26 21:15:41  florian
+    * rewrote the system handling
+
+  Revision 1.73  2002/07/23 09:51:23  daniel
   * Tried to make Tprocsym.defs protected. I didn't succeed but the cleanups
     are worth comitting.
 

+ 24 - 21
compiler/pmodules.pas

@@ -60,8 +60,8 @@ implementation
            (not current_module.linkOtherSharedLibs.Empty) then
          begin
            { Init DLLScanner }
-           if assigned(CDLLScanner[target_info.target]) then
-            DLLScanner:=CDLLScanner[target_info.target].Create
+           if assigned(CDLLScanner[target_info.system]) then
+            DLLScanner:=CDLLScanner[target_info.system].Create
            else
             internalerror(200104121);
            KeepShared:=TStringList.Create;
@@ -74,7 +74,7 @@ implementation
             end;
            DLLscanner.Free;
            { Recreate import section }
-           if (target_info.target in [target_i386_win32,target_i386_wdosx]) then
+           if (target_info.system in [system_i386_win32,system_i386_wdosx]) then
             begin
               if assigned(importssection)then
                importssection.clear
@@ -99,7 +99,7 @@ implementation
          begin
            { regenerate the importssection for win32 }
            if assigned(importssection) and
-              (target_info.target in [target_i386_win32,target_i386_wdosx]) then
+              (target_info.system in [system_i386_win32,system_i386_wdosx]) then
             begin
               importsSection.clear;
               importlib.generatesmartlib;
@@ -275,38 +275,38 @@ implementation
           and must store the pointer in this value.
           On OS/2 the heap is also intialized by the RTL. We do
           not output a pointer }
-         case target_info.target of
+         case target_info.system of
 {$ifdef x86_64}
             target_x86_64_linux:
               ;
 {$endif x86_64}
 {$ifdef i386}
-            target_i386_OS2:
+            system_i386_OS2:
               ;
 {$endif i386}
 {$ifdef alpha}
-            target_alpha_linux:
+            system_alpha_linux:
               ;
 {$endif alpha}
 {$ifdef powerpc}
-            target_powerpc_linux:
+            system_powerpc_linux:
               ;
 {$endif powerpc}
 {$ifdef m68k}
-            target_m68k_Mac:
+            system_m68k_Mac:
               bssSegment.concat(Tai_datablock.Create_global('HEAP',4));
-            target_m68k_PalmOS:
+            system_m68k_PalmOS:
               ;
 {$endif m68k}
 {$IFDEF SPARC}
-            target_SPARC_Linux:
+            system_SPARC_Linux:
               ;
 {$ENDIF SPARC}
          else
            bssSegment.concat(Tai_datablock.Create_global('HEAP',heapsize));
          end;
 {$ifdef m68k}
-         if target_info.target<>target_m68k_PalmOS then
+         if target_info.system<>system_m68k_PalmOS then
            begin
               dataSegment.concat(Tai_symbol.Createdataname_global('HEAPSIZE',4));
               dataSegment.concat(Tai_const.Create_32bit(heapsize));
@@ -367,7 +367,7 @@ implementation
            refsymtable.insert(unitsym);
          end;
       { Profile unit? Needed for go32v2 only }
-        if (cs_profile in aktmoduleswitches) and (target_info.target=target_i386_go32v2) then
+        if (cs_profile in aktmoduleswitches) and (target_info.system=system_i386_go32v2) then
          begin
            hp:=loadunit('Profile','');
            tsymtable(hp.globalsymtable).next:=symtablestack;
@@ -1144,7 +1144,7 @@ implementation
          { internal assembler uses rva for stabs info
            so it should work with relocated DLLs }
          if RelocSection and
-            (target_info.target in [target_i386_win32,target_i386_wdosx]) and
+            (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             (target_info.assem<>as_i386_pecoff) then
            begin
               include(aktglobalswitches,cs_link_strip);
@@ -1183,7 +1183,7 @@ implementation
               stringdispose(current_module.realmodulename);
               current_module.modulename:=stringdup(pattern);
               current_module.realmodulename:=stringdup(orgpattern);
-              if (target_info.target in [target_i386_WIN32,target_i386_wdosx]) then
+              if (target_info.system in [system_i386_WIN32,system_i386_wdosx]) then
                 exportlib.preparelib(pattern);
               consume(_ID);
               if token=_LKLAMMER then
@@ -1194,7 +1194,7 @@ implementation
                 end;
               consume(_SEMICOLON);
             end
-         else if (target_info.target in [target_i386_WIN32,target_i386_wdosx]) then
+         else if (target_info.system in [system_i386_WIN32,system_i386_wdosx]) then
            exportlib.preparelib(current_module.modulename^);
 
          { global switches are read, so further changes aren't allowed }
@@ -1265,7 +1265,7 @@ implementation
          { Add symbol to the exports section for win32 so smartlinking a
            DLL will include the edata section }
          if assigned(exportlib) and
-            (target_info.target in [target_i386_win32,target_i386_wdosx]) and
+            (target_info.system in [system_i386_win32,system_i386_wdosx]) and
             assigned(current_module._exports.first) then
            codesegment.concat(tai_const_symbol.create(exportlib.edatalabel));
 
@@ -1330,8 +1330,8 @@ implementation
           importlib.generatelib;
 
          if islibrary or
-            (target_info.target in [target_i386_WIN32,target_i386_wdosx]) or
-            (target_info.target=target_i386_NETWARE) then
+            (target_info.system in [system_i386_WIN32,system_i386_wdosx]) or
+            (target_info.system=system_i386_NETWARE) then
            exportlib.generatelib;
 
 
@@ -1388,7 +1388,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.68  2002-07-04 20:43:01  florian
+  Revision 1.69  2002-07-26 21:15:41  florian
+    * rewrote the system handling
+
+  Revision 1.68  2002/07/04 20:43:01  florian
     * first x86-64 patches
 
   Revision 1.67  2002/07/01 18:46:25  peter
@@ -1481,4 +1484,4 @@ end.
    * implicit result variable generation for assembler routines
    * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
 
-}
+}

+ 5 - 2
compiler/powerpc/agppcgas.pas

@@ -54,7 +54,7 @@ unit agppcgas;
             idtxt  : 'AS';
             asmbin : 'as';
             asmcmd : '-o $OBJ $ASM';
-            supported_target : target_any;
+            supported_target : system_any;
             outputbinary: false;
             allowdirect : true;
             externals : false;
@@ -340,7 +340,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.7  2002-07-26 11:19:57  jonas
+  Revision 1.8  2002-07-26 21:15:45  florian
+    * rewrote the system handling
+
+  Revision 1.7  2002/07/26 11:19:57  jonas
     * fixed range errors
 
   Revision 1.6  2002/07/21 16:56:20  jonas

+ 10 - 7
compiler/powerpc/cgcpu.pas

@@ -706,10 +706,10 @@ const
     procedure tcgppc.g_stackframe_entry(list : taasmoutput;localsize : longint);
 
       begin
-        case target_info.target of
-          target_powerpc_macos:
+        case target_info.system of
+          system_powerpc_macos:
             g_stackframe_entry_mac(list,localsize);
-          target_powerpc_linux:
+          system_powerpc_linux:
             g_stackframe_entry_sysv(list,localsize)
           else
             internalerror(2204001);
@@ -843,10 +843,10 @@ const
     procedure tcgppc.g_return_from_proc(list : taasmoutput;parasize : aword);
 
       begin
-        case target_info.target of
-          target_powerpc_macos:
+        case target_info.system of
+          system_powerpc_macos:
             g_return_from_proc_mac(list,parasize);
-          target_powerpc_linux:
+          system_powerpc_linux:
             g_return_from_proc_sysv(list,parasize)
           else
             internalerror(2204001);
@@ -1295,7 +1295,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.24  2002-07-21 17:00:23  jonas
+  Revision 1.25  2002-07-26 21:15:45  florian
+    * rewrote the system handling
+
+  Revision 1.24  2002/07/21 17:00:23  jonas
     * make sure we use rlwi* when possible instead of andi.
 
   Revision 1.23  2002/07/11 14:41:34  florian

+ 5 - 2
compiler/psub.pas

@@ -782,7 +782,7 @@ implementation
                         Message(parser_e_syntax_error);
                         consume_all_until(_SEMICOLON);
                      end
-                   else if islibrary or (target_info.target in [target_i386_WIN32,target_i386_wdosx,target_i386_Netware])
+                   else if islibrary or (target_info.system in [system_i386_WIN32,system_i386_wdosx,system_i386_Netware])
                    then  // AD
                      read_exports;
                 end
@@ -831,7 +831,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.61  2002-07-20 11:57:56  florian
+  Revision 1.62  2002-07-26 21:15:41  florian
+    * rewrote the system handling
+
+  Revision 1.61  2002/07/20 11:57:56  florian
     * types.pas renamed to defbase.pas because D6 contains a types
       unit so this would conflicts if D6 programms are compiled
     + Willamette/SSE2 instructions to assembler added

+ 15 - 12
compiler/scandir.pas

@@ -158,7 +158,7 @@ implementation
 {$ifdef m68k}
     procedure dir_appid;
       begin
-        if target_info.target<>target_m68k_palmos then
+        if system_info.target<>system_m68k_palmos then
           Message(scan_w_appid_not_support);
         { change description global var in all cases }
         { it not used but in win32 and os2 }
@@ -168,7 +168,7 @@ implementation
 
     procedure dir_appname;
       begin
-        if target_info.target<>target_m68k_palmos then
+        if system_info.target<>system_m68k_palmos then
           Message(scan_w_appname_not_support);
         { change description global var in all cases }
         { it not used but in win32 and os2 }
@@ -181,8 +181,8 @@ implementation
       var
          hs : string;
       begin
-        if (target_info.target<>target_i386_win32)
-                                 and (target_info.target<>target_i386_os2) then
+        if (target_info.system<>system_i386_win32)
+                                 and (target_info.system<>system_i386_os2) then
           Message(scan_w_app_type_not_support);
         if not current_module.in_global then
           Message(scan_w_switch_is_global)
@@ -194,7 +194,7 @@ implementation
                apptype:=app_gui
              else if hs='CONSOLE' then
                apptype:=app_cui
-             else if (hs='FS') and (target_info.target=target_i386_os2) then
+             else if (hs='FS') and (target_info.system=system_i386_os2) then
                apptype:=app_fs
              else
                Message1(scan_w_unsupported_app_type,hs);
@@ -230,7 +230,7 @@ implementation
 
     procedure dir_description;
       begin
-        if not (target_info.target in [target_i386_os2,target_i386_win32,target_i386_netware,target_i386_wdosx]) then
+        if not (target_info.system in [system_i386_os2,system_i386_win32,system_i386_netware,system_i386_wdosx]) then
           Message(scan_w_description_not_support);
         { change description global var in all cases }
         { it not used but in win32, os2 and netware }
@@ -240,7 +240,7 @@ implementation
 
     procedure dir_screenname; {ad}
       begin
-        if target_info.target <> target_i386_netware then
+        if target_info.system <> system_i386_netware then
           {Message(scan_w_decription_not_support);}
           comment (V_Warning,'Screenname only supported for target netware');
         current_scanner.skipspace;
@@ -249,7 +249,7 @@ implementation
 
       procedure dir_threadname; {ad}
       begin
-        if target_info.target <> target_i386_netware then
+        if target_info.system <> system_i386_netware then
           {Message(scan_w_decription_not_support);}
           comment (V_Warning,'Threadname only supported for target netware');
         current_scanner.skipspace;
@@ -258,7 +258,7 @@ implementation
 
       procedure dir_copyright; {ad}
       begin
-        if target_info.target <> target_i386_netware then
+        if target_info.system <> system_i386_netware then
           {Message(scan_w_decription_not_support);}
           comment (V_Warning,'Copyright only supported for target netware');
         current_scanner.skipspace;
@@ -736,7 +736,7 @@ implementation
         major, minor, revision : longint;
         error : integer;
       begin
-        if not (target_info.target in [target_i386_os2,target_i386_win32,target_i386_netware,target_i386_wdosx]) then
+        if not (target_info.system in [system_i386_os2,system_i386_win32,system_i386_netware,system_i386_wdosx]) then
           begin
             Message(scan_n_version_not_support);
             exit;
@@ -770,7 +770,7 @@ implementation
                     exit;
                   end;
                 if (c='.') and
-                   (target_info.target = target_i386_netware) then
+                   (target_info.system = system_i386_netware) then
                   begin
                      current_scanner.readchar;
                      current_scanner.readnumber;
@@ -948,7 +948,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.17  2002-07-20 17:16:03  florian
+  Revision 1.18  2002-07-26 21:15:42  florian
+    * rewrote the system handling
+
+  Revision 1.17  2002/07/20 17:16:03  florian
     + source code page support
 
   Revision 1.16  2002/07/16 15:37:58  florian

+ 71 - 136
compiler/systems.pas

@@ -38,7 +38,7 @@ interface
        FURTHERMORE : Make sure that this branch values, are
        consistant with the main branch version always.
      }
-       ttargetcpu=
+       tsystemcpu=
        (
              cpu_no,                       { 0 }
              cpu_i386,                     { 1 }
@@ -75,37 +75,37 @@ interface
        the integer value of this enum is stored in PPU
        files to recognize the target, so if you add new targets
        allways add them at end PM
-       FURTHERMORE : Make sure that this branch values, are
+       FURTHERMORE : Make sure that this branch values are
        consistant with the main branch version always. (CEC)
        }
      type
-       ttarget =
+       tsystem =
        (
-             target_none,               { 0 }
-             obsolete_target_i386_GO32V1,{ 1 }
-             target_i386_GO32V2,        { 2 }
-             target_i386_linux,         { 3 }
-             target_i386_OS2,           { 4 }
-             target_i386_Win32,         { 5 }
-             target_i386_freebsd,       { 6 }
-             target_m68k_Amiga,         { 7 }
-             target_m68k_Atari,         { 8 }
-             target_m68k_Mac,           { 9 }
-             target_m68k_linux,         { 10 }
-             target_m68k_PalmOS,        { 11 }
-             target_alpha_linux,        { 12 }
-             target_powerpc_linux,      { 13 }
-             target_powerpc_macos,      { 14 }
-             target_i386_sunos,         { 15 }
-             target_i386_beos,          { 16 }
-             target_i386_netbsd,        { 17 }
-             target_m68k_netbsd,        { 18 }
-             target_i386_Netware,       { 19 }
-             target_i386_qnx,           { 20 }
-             target_i386_wdosx,         { 21 }
-             target_sparc_sunos,        { 22 }
-             target_sparc_linux,        { 23 }
-             target_x86_64_linux        { 24 }
+             system_none,               { 0 }
+             obsolete_system_i386_GO32V1,{ 1 }
+             system_i386_GO32V2,        { 2 }
+             system_i386_linux,         { 3 }
+             system_i386_OS2,           { 4 }
+             system_i386_Win32,         { 5 }
+             system_i386_freebsd,       { 6 }
+             system_m68k_Amiga,         { 7 }
+             system_m68k_Atari,         { 8 }
+             system_m68k_Mac,           { 9 }
+             system_m68k_linux,         { 10 }
+             system_m68k_PalmOS,        { 11 }
+             system_alpha_linux,        { 12 }
+             system_powerpc_linux,      { 13 }
+             system_powerpc_macos,      { 14 }
+             system_i386_sunos,         { 15 }
+             system_i386_beos,          { 16 }
+             system_i386_netbsd,        { 17 }
+             system_m68k_netbsd,        { 18 }
+             system_i386_Netware,       { 19 }
+             system_i386_qnx,           { 20 }
+             system_i386_wdosx,         { 21 }
+             system_sparc_sunos,        { 22 }
+             system_sparc_linux,        { 23 }
+             system_x86_64_linux        { 24 }
        );
 
        tasm = (as_none
@@ -175,7 +175,7 @@ interface
           idtxt       : string[9];
           asmbin      : string[8];
           asmcmd      : string[50];
-          supported_target : ttarget;
+          supported_target : tsystem;
           outputbinary,
           allowdirect,
           externals,
@@ -199,20 +199,19 @@ interface
           rescmd  : string[50];
        end;
 
-       {# }
-       ttargetflags = (tf_none,
+       tsystemflags = (tf_none,
             tf_under_development,
             tf_need_export,tf_needs_isconsole
             ,tf_code_small,tf_static_reg_based
        );
 
-       ptargetinfo = ^ttargetinfo;
-       ttargetinfo = packed record
-          target       : ttarget;
+       psysteminfo = ^tsysteminfo;
+       tsysteminfo = packed record
+          system       : tsystem;
           name         : string[30];
           shortname    : string[9];
-          flags        : set of ttargetflags;
-          cpu          : ttargetcpu;
+          flags        : set of tsystemflags;
+          cpu          : tsystemcpu;
           unit_env     : string[12];
           extradefines : string[40];
           sourceext,
@@ -269,24 +268,24 @@ interface
 
     const
        { alias for supported_target field in tasminfo }
-       target_any = target_none;
+       system_any = system_none;
 
     var
-       targetinfos   : array[ttarget] of ptargetinfo;
+       targetinfos   : array[tsystem] of psysteminfo;
        asminfos      : array[tasm] of pasminfo;
        arinfos       : array[tar] of parinfo;
        resinfos      : array[tres] of presinfo;
        asmmodeinfos  : array[tasmmode] of pasmmodeinfo;
 
-       source_info : ttargetinfo;
-       target_cpu  : ttargetcpu;
-       target_info : ttargetinfo;
+       source_info : tsysteminfo;
+       target_cpu  : tsystemcpu;
+       target_info : tsysteminfo;
        target_asm  : tasminfo;
        target_ar   : tarinfo;
        target_res  : tresinfo;
        target_path : string[12]; { for rtl/<X>/,fcl/<X>/, etc. }
 
-    function set_target(t:ttarget):boolean;
+    function set_target(t:tsystem):boolean;
     function set_target_asm(t:tasm):boolean;
     function set_target_ar(t:tar):boolean;
     function set_target_res(t:tres):boolean;
@@ -295,9 +294,11 @@ interface
     function set_target_asm_by_string(const s : string) : boolean;
     function set_asmmode_by_string(const s:string;var t:tasmmode):boolean;
 
+    procedure set_source_info(const ti : tsysteminfo);
+
     procedure UpdateAlignment(var d:talignmentinfo;const s:talignmentinfo);
 
-    procedure RegisterTarget(const r:ttargetinfo);
+    procedure RegisterTarget(const r:tsysteminfo);
     procedure RegisterAsmMode(const r:tasmmodeinfo);
     procedure RegisterRes(const r:tresinfo);
     procedure RegisterAr(const r:tarinfo);
@@ -314,7 +315,7 @@ implementation
                               Target setting
 ****************************************************************************}
 
-function set_target(t:ttarget):boolean;
+function set_target(t:tsystem):boolean;
 begin
   set_target:=false;
   if assigned(targetinfos[t]) then
@@ -370,12 +371,12 @@ end;
 function set_target_by_string(const s : string) : boolean;
 var
   hs : string;
-  t  : ttarget;
+  t  : tsystem;
 begin
   set_target_by_string:=false;
   { this should be case insensitive !! PM }
   hs:=upper(s);
-  for t:=low(ttarget) to high(ttarget) do
+  for t:=low(tsystem) to high(tsystem) do
    if assigned(targetinfos[t]) and
       (upper(targetinfos[t]^.shortname)=hs) then
     begin
@@ -467,15 +468,15 @@ end;
                               Target registration
 ****************************************************************************}
 
-procedure RegisterTarget(const r:ttargetinfo);
+procedure RegisterTarget(const r:tsysteminfo);
 var
-  t : ttarget;
+  t : tsystem;
 begin
-  t:=r.target;
+  t:=r.system;
   if assigned(targetinfos[t]) then
    writeln('Warning: Target is already registered!')
   else
-   Getmem(targetinfos[t],sizeof(ttargetinfo));
+   Getmem(targetinfos[t],sizeof(tsysteminfo));
   targetinfos[t]^:=r;
 end;
 
@@ -522,15 +523,15 @@ end;
 procedure DeregisterInfos;
 var
   assem   : tasm;
-  target  : ttarget;
+  target  : tsystem;
   ar      : tar;
   asmmode : tasmmode;
   res     : tres;
 begin
-  for target:=low(ttarget) to high(ttarget) do
+  for target:=low(tsystem) to high(tsystem) do
    if assigned(targetinfos[target]) then
     begin
-      freemem(targetinfos[target],sizeof(ttargetinfo));
+      freemem(targetinfos[target],sizeof(tsysteminfo));
       targetinfos[target]:=nil;
     end;
   for assem:=low(tasm) to high(tasm) do
@@ -564,7 +565,7 @@ end;
                       Initialization of default target
 ****************************************************************************}
 
-procedure default_target(t:ttarget);
+procedure default_target(t:tsystem);
 begin
   set_target(t);
   if source_info.name='' then
@@ -572,100 +573,30 @@ begin
 end;
 
 
-procedure set_source(t:ttarget);
+procedure set_source_info(const ti : tsysteminfo);
 begin
 { can't use message() here (PFV) }
   if source_info.name<>'' then
     Writeln('Warning: Source OS Redefined!');
-  if assigned(targetinfos[t]) then
-   source_info:=targetinfos[t]^
-  else
-   Writeln('Warning: Source OS Not Supported!');
+  source_info:=ti;
 end;
 
 
 procedure InitSystems;
 begin
-{ first get source OS }
-  source_info.name:='';
-{ please note then we use cpu86 and cpu68 here on purpose !! }
-{$ifdef cpu86}
-    {$ifdef GO32V2}
-      set_source(target_i386_GO32V2);
-    {$else}
-      {$ifdef OS2}
-        set_source(target_i386_OS2);
-        if (OS_Mode = osDOS) or (OS_Mode = osDPMI) then
-          source_info.scriptext := '.bat';
-        { OS/2 via EMX can be run under DOS as well }
-      {$else}
-        {$ifdef WIN32}
-          {$ifdef WDOSX}
-           set_source(target_i386_wdosx);
-          {$else}
-           set_source(target_i386_WIN32);
-          {$endif}
-        {$else}
-           {$ifdef FreeBSD}
-              set_source(target_i386_FreeBSD);
-           {$else}
-              {$ifdef netbsd}
-                set_source(target_i386_NetBSD);
-              {$else}
-                {$ifdef sunos}
-                  set_source(target_i386_sunos);
-                {$else}
-                  {$ifdef beos}
-                    set_source(target_i386_beos);
-                  {$else}
-                    { Must be the last as some freebsd also
-                      defined linux }
-                    {$ifdef linux}
-                      set_source(target_i386_linux);
-                    {$else}
-                      {$error Error setting source OS}
-                    {$endif linux}
-                  {$endif beos}
-               {$endif sunos}
-            {$endif netbsd}
-          {$endif freebsd}
-        {$endif win32}
-      {$endif os2}
-    {$endif go32v2}
-{$endif cpu86}
-{$ifdef cpu86_64}
-  set_source(target_x86_64_linux);
-{$endif cpu86_64}
-{$ifdef cpu68}
-  {$ifdef AMIGA}
-    set_source(target_m68k_Amiga);
-  {$else}
-    {$ifdef ATARI}
-      set_source(target_m68k_Atari);
-    {$else}
-      {$ifdef MACOS}
-        set_source(target_m68k_MAC);
-      {$else}
-        {$ifdef linux}
-           set_source(target_m68k_linux);
-        {$endif linux}
-      {$endif macos}
-    {$endif atari}
-  {$endif amiga}
-{$endif cpu68}
 { Now default target, this is dependent on the i386 or m68k define,
   when the define is the same as the current cpu then we use the source
   os, else we pick a default }
 {$ifdef i386}
   {$ifdef cpu86}
-    default_target(source_info.target);
+    default_target(source_info.system);
   {$else cpu86}
     default_target(target_i386_linux);
   {$endif cpu86}
 {$endif i386}
 {$ifdef x86_64}
   {$ifdef cpu86_64}
-    default_target(source_info.target);
+    default_target(source_info.system);
   {$else cpu86_64}
     default_target(target_x86_64_linux);
   {$endif cpu86_64}
@@ -679,31 +610,35 @@ begin
 {$endif m68k}
 {$ifdef alpha}
   {$ifdef cpualpha}
-    default_target(source_info.target);
+    default_target(source_info.system);
   {$else cpualpha}
     default_target(target_alpha_linux);
   {$endif cpualpha}
 {$endif alpha}
 {$ifdef powerpc}
   {$ifdef cpuppc}
-    default_target(source_info.target);
+    default_target(source_info.system);
   {$else cpuppc}
-    default_target(target_powerpc_linux);
+    default_target(system_powerpc_linux);
   {$endif cpuppc}
 {$endif powerpc}
-{$IFDEF SPARC}
-  default_target(target_SPARC_linux);
-{$ENDIF SPARC}
+{$IFDEF sparc}
+  default_target(system_sparc_linux);
+{$ENDIF sparc}
 end;
 
 
 initialization
+   source_info.name:='';
 finalization
   DeregisterInfos;
 end.
 {
   $Log$
-  Revision 1.47  2002-07-04 20:43:02  florian
+  Revision 1.48  2002-07-26 21:15:42  florian
+    * rewrote the system handling
+
+  Revision 1.47  2002/07/04 20:43:02  florian
     * first x86-64 patches
 
   Revision 1.46  2002/07/01 18:46:29  peter
@@ -741,4 +676,4 @@ end.
 
   Revision 1.38  2002/04/14 16:56:30  carl
   - remove duplicate comment
-}
+}

+ 6 - 51
compiler/targets/t_amiga.pas

@@ -33,66 +33,21 @@ implementation
     uses
        link,
        cutils,cclasses,
-       globtype,globals,systems,verbose,script,fmodule;
+       globtype,globals,systems,verbose,script,fmodule,i_amiga;
 
 {*****************************************************************************
                                      Initialize
 *****************************************************************************}
 
-    const
-       target_m68k_amiga_info : ttargetinfo =
-          (
-            target       : target_m68k_Amiga;
-            name         : 'Commodore Amiga';
-            shortname    : 'amiga';
-            flags        : [];
-            cpu          : cpu_m68k;
-            short_name   : 'AMIGA';
-            unit_env     : '';
-            extradefines : '';
-            sharedlibext : '.library';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '';
-            scriptext    : '';
-            smartext     : '.sl';
-            unitext      : '.ppa';
-            unitlibext   : '.ppl';
-            asmext       : '.asm';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            staticlibprefix : '';
-            sharedlibprefix : '';
-            Cprefix      : '_';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_m68k_as;
-            assemextern  : as_m68k_as;
-            link         : ld_m68k_amiga;
-            linkextern   : ld_m68k_amiga;
-            ar           : ar_m68k_ar;
-            res          : res_none;
-            script       : script_amiga;
-            endian       : endian_big;
-            stackalignment : 2;
-            maxCrecordalignment : 4;
-            heapsize     : 128*1024;
-            stacksize    : 8192;
-            DllScanSupported:false;
-            use_function_relative_addresses : false
-          );
-
-
 initialization
-  RegisterTarget(target_m68k_amiga_info);
+  RegisterTarget(system_m68k_amiga_info);
 end.
 {
   $Log$
-  Revision 1.11  2002-05-18 13:34:26  peter
+  Revision 1.12  2002-07-26 21:15:45  florian
+    * rewrote the system handling
+
+  Revision 1.11  2002/05/18 13:34:26  peter
     * readded missing revisions
 
   Revision 1.10  2002/05/16 19:46:53  carl

+ 6 - 51
compiler/targets/t_atari.pas

@@ -33,66 +33,21 @@ implementation
     uses
        link,
        cutils,cclasses,
-       globtype,globals,systems,verbose,script,fmodule;
+       globtype,globals,systems,verbose,script,fmodule,i_atari;
 
 {*****************************************************************************
                                      Initialize
 *****************************************************************************}
 
-    const
-       target_m68k_atari_info : ttargetinfo =
-          (
-            target       : target_m68k_Atari;
-            name         : 'Atari ST/STE';
-            shortname    : 'atari';
-            flags        : [];
-            cpu          : cpu_m68k;
-            short_name   : 'ATARI';
-            unit_env     : '';
-            extradefines : '';
-            sharedlibext : '.dll';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '.tpp';
-            defext       : '';
-            scriptext    : '';
-            smartext     : '.sl';
-            unitext      : '.ppt';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            staticlibprefix : '';
-            sharedlibprefix : '';
-            Cprefix      : '_';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_m68k_as;
-            assemextern  : as_m68k_as;
-            link         : ld_m68k_atari;
-            linkextern   : ld_m68k_atari;
-            ar           : ar_m68k_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_big;
-            stackalignment : 2;
-            maxCrecordalignment : 4;
-            heapsize     : 16*1024;
-            stacksize    : 8192;
-            DllScanSupported:false;
-           use_function_relative_addresses : false
-          );
-
-
 initialization
-  RegisterTarget(target_m68k_atari_info);
+  RegisterTarget(system_m68k_atari_info);
 end.
 {
   $Log$
-  Revision 1.11  2002-05-18 13:34:26  peter
+  Revision 1.12  2002-07-26 21:15:45  florian
+    * rewrote the system handling
+
+  Revision 1.11  2002/05/18 13:34:26  peter
     * readded missing revisions
 
   Revision 1.10  2002/05/16 19:46:53  carl

+ 8 - 72
compiler/targets/t_beos.pas

@@ -63,7 +63,7 @@ implementation
     cutils,cclasses,
     verbose,systems,globtype,globals,
     symconst,script,
-    fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym;
+    fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,i_beos;
 
 {*****************************************************************************
                                TIMPORTLIBBEOS
@@ -455,84 +455,20 @@ end;
                                   Initialize
 *****************************************************************************}
 
-{$ifdef i386}
-    const
-       target_i386_beos_info : ttargetinfo =
-          (
-            target       : target_i386_BeOS;
-            name         : 'Beos for i386';
-            shortname    : 'Beos';
-            flags        : [tf_under_development];
-            cpu          : cpu_i386;
-            unit_env     : 'BEOSUNITS';
-            extradefines : '';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_i386_as;
-            assemextern  : as_i386_as;
-            link         : ld_i386_beos;
-            linkextern   : ld_i386_beos;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 8192;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-{$endif i386}
-
 initialization
 {$ifdef i386}
   RegisterLinker(ld_i386_beos,TLinkerbeos);
-  RegisterImport(target_i386_beos,timportlibbeos);
-  RegisterExport(target_i386_beos,texportlibbeos);
-  RegisterTarget(target_i386_beos_info);
+  RegisterImport(system_i386_beos,timportlibbeos);
+  RegisterExport(system_i386_beos,texportlibbeos);
+  RegisterTarget(system_i386_beos_info);
 {$endif i386}
 end.
 {
   $Log$
-  Revision 1.19  2002-07-01 18:46:34  peter
+  Revision 1.20  2002-07-26 21:15:45  florian
+    * rewrote the system handling
+
+  Revision 1.19  2002/07/01 18:46:34  peter
     * internal linker
     * reorganized aasm layer
 

+ 17 - 212
compiler/targets/t_fbsd.pas

@@ -36,7 +36,7 @@ implementation
     verbose,systems,globtype,globals,
     symconst,script,
     fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,
-    import,export,link;
+    import,export,link,i_fbsd;
 
   type
     timportlibfreebsd=class(timportlib)
@@ -388,7 +388,7 @@ begin
      if Fl1 or Fl2 then
       begin
         LinkRes.Add('INPUT(');
-         If Fl1 Then 
+         If Fl1 Then
         LinkRes.AddFileName(s1);
         If Fl2 Then
          LinkRes.AddFileName(s2);
@@ -421,9 +421,9 @@ begin
   DynLinkStr:='';
   if (cs_link_staticflag in aktglobalswitches) then
     begin
-      if (target_info.target=target_m68k_netbsd) and
+      if (target_info.system=system_m68k_netbsd) and
          ((cs_link_on_target in aktglobalswitches) or
-          (target_info.target=source_info.target)) then
+          (target_info.system=source_info.system)) then
         StaticStr:='-Bstatic'
       else
         StaticStr:='-static';
@@ -495,224 +495,29 @@ end;
                                      Initialize
 *****************************************************************************}
 
-{$ifdef i386}
-    const
-       target_i386_freebsd_info : ttargetinfo =
-          (
-            target       : target_i386_FreeBSD;
-            name         : 'FreeBSD/ELF for i386';
-            shortname    : 'FreeBSD';
-            flags        : [];
-            cpu          : cpu_i386;
-            unit_env     : 'BSDUNITS';
-            extradefines : 'UNIX;BSD';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_i386_elf32;
-            assemextern  : as_i386_as;
-            link         : ld_i386_freebsd;
-            linkextern   : ld_i386_freebsd;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize    : 256*1024;
-            stacksize   : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-
-       target_i386_netbsd_info : ttargetinfo =
-          (
-            target       : target_i386_NetBSD;
-            name         : 'NetBSD for i386';
-            shortname    : 'NetBSD';
-            flags        : [tf_under_development];
-            cpu          : cpu_i386;
-            unit_env     : 'BSDUNITS';
-            extradefines : 'UNIX;BSD';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '_';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_i386_as;
-            assemextern  : as_i386_as;
-            link         : ld_i386_freebsd;
-            linkextern   : ld_i386_freebsd;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 1;
-                varalignmin     : 0;
-                varalignmax     : 1;
-                localalignmin   : 0;
-                localalignmax   : 1;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize    : 256*1024;
-            stacksize   : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-{$endif i386}
-
-{$ifdef m68k}
-    const
-       target_i386_netbsd_info : ttargetinfo =
-          (
-            target       : target_i386_NetBSD;
-            name         : 'NetBSD for i386';
-            shortname    : 'NetBSD';
-            flags        : [tf_under_development];
-            cpu          : cpu_i386;
-            unit_env     : 'BSDUNITS';
-            extradefines : 'UNIX;BSD';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_m68k_asbsd;
-            assemextern  : as_m68k_as;
-            link         : ld_m68k_freebsd;
-            linkextern   : ld_m68k_freebsd;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_big;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 1;
-                varalignmin     : 0;
-                varalignmax     : 1;
-                localalignmin   : 0;
-                localalignmax   : 1;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize    : 256*1024;
-            stacksize   : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-{$endif m68k}
-
 initialization
 {$ifdef i386}
   RegisterLinker(ld_i386_freebsd,TLinkerFreeBSD);
-  RegisterImport(target_i386_freebsd,timportlibfreebsd);
-  RegisterExport(target_i386_freebsd,texportlibfreebsd);
-  RegisterTarget(target_i386_freebsd_info);
-  RegisterImport(target_i386_netbsd,timportlibfreebsd);
-  RegisterExport(target_i386_netbsd,texportlibfreebsd);
-  RegisterTarget(target_i386_netbsd_info);
+  RegisterImport(system_i386_freebsd,timportlibfreebsd);
+  RegisterExport(system_i386_freebsd,texportlibfreebsd);
+  RegisterTarget(system_i386_freebsd_info);
+  RegisterImport(system_i386_netbsd,timportlibfreebsd);
+  RegisterExport(system_i386_netbsd,texportlibfreebsd);
+  RegisterTarget(system_i386_netbsd_info);
 {$endif i386}
 {$ifdef m68k}
   RegisterLinker(ld_m68k_freebsd,TLinkerFreeBSD);
-  RegisterImport(target_m68k_netbsd,timportlibfreebsd);
-  RegisterExport(target_m68k_netbsd,texportlibfreebsd);
-  RegisterTarget(target_m68k_netbsd_info);
+  RegisterImport(system_m68k_netbsd,timportlibfreebsd);
+  RegisterExport(system_m68k_netbsd,texportlibfreebsd);
+  RegisterTarget(system_m68k_netbsd_info);
 {$endif m68k}
 end.
 {
   $Log$
-  Revision 1.24  2002-07-24 13:51:34  marco
+  Revision 1.25  2002-07-26 21:15:45  florian
+    * rewrote the system handling
+
+  Revision 1.24  2002/07/24 13:51:34  marco
    * Fixed small error
 
   Revision 1.23  2002/07/24 13:10:22  marco

+ 6 - 69
compiler/targets/t_go32v2.pas

@@ -33,7 +33,7 @@ implementation
     uses
        link,
        cutils,cclasses,
-       globtype,globals,systems,verbose,script,fmodule;
+       globtype,globals,systems,verbose,script,fmodule,i_go32v2;
 
   type
     tlinkergo32v2=class(texternallinker)
@@ -355,79 +355,16 @@ end;
                                      Initialize
 *****************************************************************************}
 
-    const
-       target_i386_go32v2_info : ttargetinfo =
-          (
-            target       : target_i386_GO32V2;
-            name         : 'GO32 V2 DOS extender';
-            shortname    : 'Go32v2';
-            flags        : [];
-            cpu          : cpu_i386;
-            unit_env     : 'GO32V2UNITS';
-            extradefines : 'DPMI';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '.exe';
-            defext       : '.def';
-            scriptext    : '.bat';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.dll';
-            staticlibext : '.a';
-            staticlibprefix : '';
-            sharedlibprefix : '';
-            sharedClibext : '.dll';
-            staticClibext : '.a';
-            staticClibprefix : '';
-            sharedClibprefix : '';
-            Cprefix      : '_';
-            newline      : #13#10;
-            dirsep       : '\';
-            files_case_relevent : false;
-            assem        : as_i386_coff;
-            assemextern  : as_i386_as;
-            link         : ld_i386_coff;
-            linkextern   : ld_i386_go32v2;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_dos;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 2;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 2048*1024;
-            stacksize    : 262144;
-            DllScanSupported : false;
-            use_function_relative_addresses : true
-          );
-
-
 initialization
   RegisterLinker(ld_i386_go32v2,TLinkerGo32v2);
-  RegisterTarget(target_i386_go32v2_info);
+  RegisterTarget(system_i386_go32v2_info);
 end.
 {
   $Log$
-  Revision 1.23  2002-07-01 18:46:35  peter
+  Revision 1.24  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.23  2002/07/01 18:46:35  peter
     * internal linker
     * reorganized aasm layer
 

+ 25 - 424
compiler/targets/t_linux.pas

@@ -68,6 +68,7 @@ implementation
 {$ifdef i386}
     ,aasmbase,aasmtai,aasmcpu,cpubase
 {$endif i386}
+    ,i_linux
     ;
 
 {*****************************************************************************
@@ -482,451 +483,51 @@ end;
                                   Initialize
 *****************************************************************************}
 
-{$ifdef i386}
-    const
-       target_i386_linux_info : ttargetinfo =
-          (
-            target       : target_i386_LINUX;
-            name         : 'Linux for i386';
-            shortname    : 'Linux';
-            flags        : [];
-            cpu          : cpu_i386;
-            unit_env     : 'LINUXUNITS';
-            extradefines : 'UNIX';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_i386_elf32;
-            assemextern  : as_i386_as;
-            link         : ld_i386_linux;
-            linkextern   : ld_i386_linux;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-{$endif i386}
-{$ifdef m68k}
-    const
-       target_m68k_linux_info : ttargetinfo =
-          (
-            target       : target_m68k_linux;
-            name         : 'Linux for m68k';
-            shortname    : 'linux';
-            flags        : [];
-            cpu          : cpu_m68k;
-            short_name   : 'LINUX';
-            unit_env     : 'LINUXUNITS';
-            extradefines : 'UNIX';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_m68k_as;
-            assemextern  : as_m68k_as;
-            link         : ld_m68k_linux;
-            linkextern   : ld_m68k_linux;
-            ar           : ar_m68k_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_big;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 128*1024;
-            stacksize    : 32*1024*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-{$endif m68k}
-{$ifdef powerpc}
-    const
-       target_powerpc_linux_info : ttargetinfo =
-          (
-            target       : target_powerpc_LINUX;
-            name         : 'Linux for PowerPC';
-            shortname    : 'linuxppc';
-            flags        : [];
-            cpu          : cpu_powerpc;
-            unit_env     : '';
-            extradefines : 'UNIX';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.s';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_powerpc_as;
-            assemextern  : as_powerpc_as;
-            link         : ld_powerpc_linux;
-            linkextern   : ld_powerpc_linux;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_big;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 32*1024*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-{$endif powerpc}
-{$ifdef alpha}
-    const
-       target_alpha_linux_info : ttargetinfo =
-          (
-            target       : target_alpha_LINUX;
-            name         : 'Linux for Alpha';
-            shortname    : 'axplinux';
-            flags        : [];
-            cpu          : cpu_alpha;
-            short_name   : 'LINUX';
-            unit_env     : 'LINUXUNITS';
-            extradefines : 'UNIX';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_alpha_as;
-            assemextern  : as_alpha_as;
-            link         : ld_alpha_linux;
-            linkextern   : ld_alpha_linux;
-            ar           : ar_alpha_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 32*1024*1024;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-{$endif alpha}
-{$ifdef x86_64}
-    const
-       target_x86_64_linux_info : ttargetinfo =
-          (
-            target       : target_i386_LINUX;
-            name         : 'Linux for x86-64';
-            shortname    : 'Linux64';
-            flags        : [];
-            cpu          : x86_64;
-            unit_env     : 'LINUXUNITS';
-            extradefines : 'UNIX';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_i386_elf32;
-            assemextern  : as_i386_as;
-            link         : ld_i386_linux;
-            linkextern   : ld_i386_linux;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 1;
-                varalignmin     : 0;
-                varalignmax     : 1;
-                localalignmin   : 0;
-                localalignmax   : 1;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            size_of_pointer : 8;
-            size_of_longint : 4;
-            heapsize     : 256*1024;
-            maxheapsize  : 65536*1024;
-            stacksize    : 16*1024;
-            DllScanSupported:false;
-            use_bound_instruction : false;
-            use_function_relative_addresses : true
-          );
-{$endif x86_64}
-{$IFDEF SPARC}
-  CONST
-       target_SPARC_linux_info : ttargetinfo =
-          (
-            target       : target_SPARC_Linux;
-            name         : 'Linux for SPARC';
-            shortname    : 'Linux';
-            flags        : [];
-            cpu          : cpu_SPARC;
-            unit_env     : 'LINUXUNITS';
-            extradefines : 'UNIX';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_SPARC_elf32;
-            assemextern  : as_SPARC_as;
-            link         : ld_SPARC_linux;
-            linkextern   : ld_SPARC_linux;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-{$ENDIF SPARC}
-
-
 initialization
 {$ifdef i386}
   RegisterLinker(ld_i386_linux,TLinkerLinux);
-  RegisterImport(target_i386_linux,timportliblinux);
-  RegisterExport(target_i386_linux,texportliblinux);
-  RegisterTarget(target_i386_linux_info);
+  RegisterImport(system_i386_linux,timportliblinux);
+  RegisterExport(system_i386_linux,texportliblinux);
+  RegisterTarget(system_i386_linux_info);
 {$endif i386}
 {$ifdef m68k}
   RegisterLinker(ld_m68k_linux,TLinkerLinux);
-  RegisterImport(target_m68k_linux,timportliblinux);
-  RegisterExport(target_m68k_linux,texportliblinux);
-  RegisterTarget(target_m68k_linux_info);
+  RegisterImport(system_m68k_linux,timportliblinux);
+  RegisterExport(system_m68k_linux,texportliblinux);
+  RegisterTarget(system_m68k_linux_info);
 {$endif m68k}
 {$ifdef powerpc}
   RegisterLinker(ld_powerpc_linux,TLinkerLinux);
-  RegisterImport(target_powerpc_linux,timportliblinux);
-  RegisterExport(target_powerpc_linux,texportliblinux);
-  RegisterTarget(target_powerpc_linux_info);
+  RegisterImport(system_powerpc_linux,timportliblinux);
+  RegisterExport(system_powerpc_linux,texportliblinux);
+  RegisterTarget(system_powerpc_linux_info);
 {$endif powerpc}
 {$ifdef alpha}
   RegisterLinker(ld_alpha_linux,TLinkerLinux);
-  RegisterImport(target_alpha_linux,timportliblinux);
-  RegisterExport(target_alpha_linux,texportliblinux);
-  RegisterTarget(target_alpha_linux_info);
+  RegisterImport(system_alpha_linux,timportliblinux);
+  RegisterExport(system_alpha_linux,texportliblinux);
+  RegisterTarget(system_alpha_linux_info);
 {$endif alpha}
 {$ifdef x86_64}
   RegisterLinker(ld_x86_64_linux,TLinkerLinux);
-  RegisterImport(target_x86_64_linux,timportliblinux);
-  RegisterExport(target_x86_64_linux,texportliblinux);
-  RegisterTarget(target_x86_64_linux_info);
+  RegisterImport(system_x86_64_linux,timportliblinux);
+  RegisterExport(system_x86_64_linux,texportliblinux);
+  RegisterTarget(system_x86_64_linux_info);
 {$endif x86_64}
-{$IFDEF SPARC}
+{$ifdef SPARC}
   RegisterLinker(ld_SPARC_linux,TLinkerLinux);
-  RegisterImport(target_SPARC_linux,timportliblinux);
-  RegisterExport(target_SPARC_linux,texportliblinux);
-  RegisterTarget(target_SPARC_linux_info);
-{$ENDIF SPARC}
+  RegisterImport(system_SPARC_linux,timportliblinux);
+  RegisterExport(system_SPARC_linux,texportliblinux);
+  RegisterTarget(system_SPARC_linux_info);
+{$endif SPARC}
 end.
 
 {
   $Log$
-  Revision 1.28  2002-07-04 20:43:02  florian
+  Revision 1.29  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.28  2002/07/04 20:43:02  florian
     * first x86-64 patches
 
   Revision 1.27  2002/07/01 18:46:35  peter

+ 5 - 101
compiler/targets/t_macos.pas

@@ -33,111 +33,12 @@ implementation
     uses
        link,
        cutils,cclasses,
-       globtype,globals,systems,verbose,script,fmodule;
+       globtype,globals,systems,verbose,script,fmodule,i_macos;
 
 {*****************************************************************************
                                   Initialize
 *****************************************************************************}
 
-{$ifdef m68k}
-    const
-       target_m68k_macos_info : ttargetinfo =
-          (
-            target       : target_m68k_Mac;
-            name         : 'Macintosh m68k';
-            shortname    : 'mac';
-            flags        : [];
-            cpu          : cpu_m68k;
-            short_name   : 'MACOS';
-            unit_env     : '';
-            extradefines : '';
-            sharedlibext : 'Lib';
-            staticlibext : 'Lib';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '';
-            scriptext    : '';
-            smartext     : '.sl';
-            unitext      : '.ppt';
-            unitlibext   : '.ppl';
-            asmext       : '.a';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            staticlibprefix : '';
-            sharedlibprefix : '';
-            Cprefix      : '_';
-            newline      : #13;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_m68k_mpw;
-            assemextern  : as_m68k_mpw;
-            link         : ld_m68k_mac;
-            linkextern   : ld_m68k_mac;
-            ar           : ar_m68k_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_big;
-            stackalignment : 2;
-            maxCrecordalignment : 4;
-            size_of_longint : 4;
-            heapsize     : 128*1024;
-            stacksize    : 8192;
-            DllScanSupported:false;
-            use_function_relative_addresses : false
-          );
-{$endif m68k}
-
-{$ifdef powerpc}
-     const
-       target_powerpc_macos_info : ttargetinfo =
-          (
-            target       : target_powerpc_MACOS;
-            name         : 'MacOs (PowerPC)';
-            shortname    : 'MacOs/PPC';
-            flags        : [];
-            cpu          : cpu_powerpc;
-            short_name   : 'MACOS';
-            unit_env     : '';
-            extradefines : '';
-            sharedlibext : 'Lib';
-            staticlibext : 'Lib';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '';
-            scriptext    : '';
-            smartext     : '.sl';
-            unitext      : '.ppt';
-            unitlibext   : '.ppl';
-            asmext       : '.a';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            staticlibprefix : '';
-            sharedlibprefix : '';
-            Cprefix      : '';
-            newline      : #13;
-            assem        : as_powerpc_mpw;
-            assemextern  : as_powerpc_mpw;
-            link         : ld_powerpc_macos;
-            linkextern   : ld_powerpc_macos;
-            ar           : ar_powerpc_ar;
-            res          : res_powerpc_mpw;
-            script       : script_unix;
-            endian       : endian_big;
-            stackalignment : 8;
-            maxCrecordalignment : 32;
-            size_of_longint : 4;
-            heapsize     : 256*1024;
-            stacksize    : 8192;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-{$endif powerpc}
-
-
 initialization
 {$ifdef m68k}
   RegisterTarget(target_m68k_macos_info);
@@ -148,7 +49,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.11  2002-05-18 13:34:27  peter
+  Revision 1.12  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.11  2002/05/18 13:34:27  peter
     * readded missing revisions
 
   Revision 1.10  2002/05/16 19:46:53  carl

+ 8 - 70
compiler/targets/t_nwm.pas

@@ -96,7 +96,7 @@ implementation
     verbose,systems,globtype,globals,
     symconst,script,
     fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,
-    import,export,link;
+    import,export,link,i_nwm;
 
   type
     timportlibnetware=class(timportlib)
@@ -475,81 +475,19 @@ end;
                                      Initialize
 *****************************************************************************}
 
-    const
-       target_i386_netware_info : ttargetinfo =
-          (
-            target       : target_i386_NETWARE;
-            name         : 'Netware for i386';
-            shortname    : 'Netware';
-            flags        : [];
-            cpu          : cpu_i386;
-            unit_env     : 'NETWAREUNITS';
-            extradefines : '';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '.nlm';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppn';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.on';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.nlm';
-            staticlibext : '.a';
-            staticlibprefix : '';
-            sharedlibprefix : '';
-            sharedClibext : '.nlm';
-            staticClibext : '.a';
-            staticClibprefix : '';
-            sharedClibprefix : '';
-            Cprefix      : '';
-            newline      : #13#10;
-            dirsep       : '\';
-            files_case_relevent : false;
-            assem        : as_i386_elf32;
-            assemextern  : as_i386_as;
-            link         : ld_i386_netware;
-            linkextern   : ld_i386_netware;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 1;
-                varalignmin     : 0;
-                varalignmax     : 1;
-                localalignmin   : 0;
-                localalignmax   : 1;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 8192;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-
 
 initialization
   RegisterLinker(ld_i386_netware,TLinkerNetware);
-  RegisterImport(target_i386_netware,TImportLibNetware);
-  RegisterExport(target_i386_netware,TExportLibNetware);
-  RegisterTarget(target_i386_netware_info);
+  RegisterImport(system_i386_netware,TImportLibNetware);
+  RegisterExport(system_i386_netware,TExportLibNetware);
+  RegisterTarget(system_i386_netware_info);
 end.
 {
   $Log$
-  Revision 1.25  2002-07-01 18:46:35  peter
+  Revision 1.26  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.25  2002/07/01 18:46:35  peter
     * internal linker
     * reorganized aasm layer
 

+ 7 - 79
compiler/targets/t_os2.pas

@@ -48,7 +48,7 @@ implementation
      cutils,cclasses,
      globtype,comphook,systems,symsym,
      globals,verbose,fmodule,script,
-     import,link;
+     import,link,i_os2;
 
   type
     timportlibos2=class(timportlib)
@@ -508,90 +508,18 @@ end;
                                      Initialize
 *****************************************************************************}
 
-    const
-       res_emxbind_info : tresinfo =
-          (
-            id     : res_emxbind;
-            resbin : 'emxbind';
-            rescmd : '-b -r $RES $OBJ'
-(* Not really used - see TLinkeros2.SetDefaultInfo in t_os2.pas. *)
-          );
-
-    const
-       target_i386_os2_info : ttargetinfo =
-          (
-            target       : target_i386_OS2;
-            name         : 'OS/2 via EMX';
-            shortname    : 'OS2';
-            flags        : [tf_need_export];
-            cpu          : cpu_i386;
-            unit_env     : 'OS2UNITS';
-            extradefines : '';
-            sourceext    : '.pas';
-            pasext       : '.pp';
-            exeext       : '.exe';
-            defext       : '.def';
-            scriptext    : '.cmd';
-            smartext     : '.sl';
-            unitext      : '.ppo';
-            unitlibext   : '.ppl';
-            asmext       : '.so2';
-            objext       : '.oo2';
-            resext       : '.res';
-            resobjext    : '.oor';
-            sharedlibext : '.ao2';
-            staticlibext : '.ao2';
-            staticlibprefix : '';
-            sharedlibprefix : '';
-            sharedClibext : 'dll';
-            staticClibext : '.a';
-            staticClibprefix : '';
-            sharedClibprefix : '';
-            Cprefix      : '_';
-            newline      : #13#10;
-            dirsep       : '\';
-            files_case_relevent : false;
-            assem        : as_i386_as_aout;
-            assemextern  : as_i386_as_aout;
-            link         : ld_i386_os2;
-            linkextern   : ld_i386_os2;
-            ar           : ar_gnu_ar;
-            res          : res_emxbind;
-            script       : script_dos;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 256*1024;
-            DllScanSupported:true;
-            use_function_relative_addresses : false
-          );
-
-
 initialization
   RegisterLinker(ld_i386_os2,TLinkerOS2);
-  RegisterImport(target_i386_os2,TImportLibOS2);
+  RegisterImport(system_i386_os2,TImportLibOS2);
   RegisterRes(res_emxbind_info);
-  RegisterTarget(target_i386_os2_info);
+  RegisterTarget(system_i386_os2_info);
 end.
 {
   $Log$
-  Revision 1.22  2002-07-01 18:46:35  peter
+  Revision 1.23  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.22  2002/07/01 18:46:35  peter
     * internal linker
     * reorganized aasm layer
 

+ 5 - 51
compiler/targets/t_palmos.pas

@@ -45,7 +45,7 @@ implementation
 
     uses
        cutils,cclasses,
-       globtype,globals,systems,verbose,script,fmodule;
+       globtype,globals,systems,verbose,script,fmodule,i_palmos;
 
 {****************************************************************************
                                TLinkerPalmOS
@@ -205,55 +205,6 @@ end;
                                      Initialize
 *****************************************************************************}
 
-{$ifdef m68k}
-    const
-       target_m68k_palmos_info : ttargetinfo =
-          (
-            target       : target_m68k_PalmOS;
-            name         : 'PalmOS';
-            shortname    : 'palmos';
-            flags        : [tf_code_small,tf_static_a5_based];
-            cpu          : cpu_m68k;
-            short_name   : 'PALMOS';
-            unit_env     : 'PALMUNITS';
-            extradefines : '';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            Cprefix      : '_';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_m68k_as;
-            assemextern  : as_m68k_as;
-            link         : ld_m68k_palmos;
-            linkextern   : ld_m68k_palmos;
-            ar           : ar_m68k_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_big;
-            stackalignment : 2;
-            maxCrecordalignment : 4;
-            heapsize     : 128*1024;
-            stacksize    : 8192;
-            DllScanSupported:false;
-            use_function_relative_addresses : false
-          );
-{$endif m68k}
-
 initialization
 {$ifdef m68k}
   RegisterTarget(target_m68k_palmos_info);
@@ -261,7 +212,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.13  2002-07-01 18:46:35  peter
+  Revision 1.14  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.13  2002/07/01 18:46:35  peter
     * internal linker
     * reorganized aasm layer
 

+ 8 - 71
compiler/targets/t_sunos.pas

@@ -39,7 +39,7 @@ implementation
     verbose,systems,globtype,globals,
     symconst,script,
     fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,
-    import,export,link;
+    import,export,link,i_sunos;
 
   type
     timportlibsunos=class(timportlib)
@@ -478,81 +478,18 @@ end;
                                      Initialize
 *****************************************************************************}
 
-    const
-       target_i386_sunos_info : ttargetinfo =
-          (
-            target       : target_i386_sunos;
-            name         : 'SunOS/ELF for i386';
-            shortname    : 'SunOS';
-            flags        : [tf_under_development];
-            cpu          : cpu_i386;
-            unit_env     : 'SUNOSUNITS';
-            extradefines : 'UNIX;SOLARIS;LIBC';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '';
-            defext       : '.def';
-            scriptext    : '.sh';
-            smartext     : '.sl';
-            unitext      : '.ppu';
-            unitlibext   : '.ppl';
-            asmext       : '.s';
-            objext       : '.o';
-            resext       : '.res';
-            resobjext    : '.or';
-            sharedlibext : '.so';
-            staticlibext : '.a';
-            staticlibprefix : 'libp';
-            sharedlibprefix : 'lib';
-            sharedClibext : '.so';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : 'lib';
-            Cprefix      : '';
-            newline      : #10;
-            dirsep       : '/';
-            files_case_relevent : true;
-            assem        : as_i386_as;
-            assemextern  : as_i386_as;
-            link         : ld_i386_sunos;
-            linkextern   : ld_i386_sunos;
-            ar           : ar_gnu_ar;
-            res          : res_none;
-            script       : script_unix;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 1;
-                varalignmin     : 0;
-                varalignmax     : 1;
-                localalignmin   : 0;
-                localalignmax   : 1;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 4
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 262144;
-            DllScanSupported:false;
-            use_function_relative_addresses : true
-          );
-
-
 initialization
   RegisterLinker(ld_i386_sunos,TLinkerSunos);
-  RegisterImport(target_i386_sunos,TImportLibSunos);
-  RegisterExport(target_i386_sunos,TExportLibSunos);
-  RegisterTarget(target_i386_sunos_info);
+  RegisterImport(system_i386_sunos,TImportLibSunos);
+  RegisterExport(system_i386_sunos,TExportLibSunos);
+  RegisterTarget(system_i386_sunos_info);
 end.
 {
   $Log$
-  Revision 1.24  2002-07-01 18:46:35  peter
+  Revision 1.25  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.24  2002/07/01 18:46:35  peter
     * internal linker
     * reorganized aasm layer
 

+ 9 - 72
compiler/targets/t_wdosx.pas

@@ -32,7 +32,7 @@ implementation
     uses
        cutils,
        fmodule,globals,systems,
-       import,export,link,t_win32;
+       import,export,link,t_win32,i_wdosx;
 
   type
     timportlibwdosx=class(timportlibwin32)
@@ -87,85 +87,22 @@ end;
                                      Initialize
 *****************************************************************************}
 
-    const
-       target_i386_wdosx_info : ttargetinfo =
-          (
-            target       : target_i386_wdosx;
-            name         : 'WDOSX DOS extender';
-            shortname    : 'WDOSX';
-            flags        : [];
-            cpu          : cpu_i386;
-            unit_env     : 'WDOSXUNITS';
-            extradefines : 'MSWINDOWS';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '.exe';
-            defext       : '.def';
-            scriptext    : '.bat';
-            smartext     : '.sld';
-            unitext      : '.ppd';
-            unitlibext   : '.ppl';
-            asmext       : '.sd';
-            objext       : '.od';
-            resext       : '.rc';
-            resobjext    : '.odr';
-            sharedlibext : '.dll';
-            staticlibext : '.ad';
-            staticlibprefix : 'libp';
-            sharedlibprefix : '';
-            sharedClibext : '.dll';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : '';
-            Cprefix      : '_';
-            newline      : #13#10;
-            dirsep       : '\';
-            files_case_relevent : false;
-            assem        : as_i386_pecoffwdosx;
-            assemextern  : as_i386_aswdosx;
-            link         : ld_i386_wdosx;
-            linkextern   : ld_i386_wdosx;
-            ar           : ar_gnu_arw;
-            res          : res_gnu_windres;
-            script       : script_dos;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 16
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 32*1024*1024;
-            DllScanSupported:true;
-            use_function_relative_addresses : true
-          );
-
-
 initialization
   RegisterLinker(ld_i386_wdosx,TLinkerWdosx);
-  RegisterImport(target_i386_wdosx,TImportLibWdosx);
-  RegisterExport(target_i386_wdosx,TExportLibWdosx);
-  RegisterDLLScanner(target_i386_wdosx,TDLLScannerWdosx);
+  RegisterImport(system_i386_wdosx,TImportLibWdosx);
+  RegisterExport(system_i386_wdosx,TExportLibWdosx);
+  RegisterDLLScanner(system_i386_wdosx,TDLLScannerWdosx);
     {RegisterAr(ar_gnu_arw_info);}
     {RegisterRes(res_gnu_windres_info);}
-  RegisterTarget(target_i386_wdosx_info);
+  RegisterTarget(system_i386_wdosx_info);
 end.
 
 {
   $Log$
-  Revision 1.8  2002-05-18 13:34:27  peter
+  Revision 1.9  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.8  2002/05/18 13:34:27  peter
     * readded missing revisions
 
   Revision 1.7  2002/05/16 19:46:53  carl

+ 11 - 88
compiler/targets/t_win32.pas

@@ -39,8 +39,7 @@ interface
 {$ifdef GDB}
        gdb,
 {$endif}
-
-       import,export,link,rgobj;
+       import,export,link,rgobj,i_win32;
 
 
   const
@@ -1541,99 +1540,23 @@ function tDLLScannerWin32.scan(const binname:string):longbool;
                                      Initialize
 *****************************************************************************}
 
-    const
-      ar_gnu_arw_info : tarinfo =
-          (
-            id    : ar_gnu_arw;
-            arcmd : 'arw rs $LIB $FILES'
-          );
-
-    const
-      res_gnu_windres_info : tresinfo =
-          (
-            id     : res_gnu_windres;
-            resbin : 'windres';
-            rescmd : '--include $INC -O coff -o $OBJ $RES'
-          );
-
-    const
-       target_i386_win32_info : ttargetinfo =
-          (
-            target       : target_i386_WIN32;
-            name         : 'Win32 for i386';
-            shortname    : 'Win32';
-            flags        : [];
-            cpu          : cpu_i386;
-            unit_env     : 'WIN32UNITS';
-            extradefines : 'MSWINDOWS';
-            sourceext    : '.pp';
-            pasext       : '.pas';
-            exeext       : '.exe';
-            defext       : '.def';
-            scriptext    : '.bat';
-            smartext     : '.slw';
-            unitext      : '.ppw';
-            unitlibext   : '.ppl';
-            asmext       : '.sw';
-            objext       : '.ow';
-            resext       : '.rc';
-            resobjext    : '.owr';
-            sharedlibext : '.dll';
-            staticlibext : '.aw';
-            staticlibprefix : 'libp';
-            sharedlibprefix : '';
-            sharedClibext : '.dll';
-            staticClibext : '.a';
-            staticClibprefix : 'lib';
-            sharedClibprefix : '';
-            Cprefix      : '_';
-            newline      : #13#10;
-            dirsep       : '\';
-            files_case_relevent : false;
-            assem        : as_i386_pecoff;
-            assemextern  : as_i386_asw;
-            link         : ld_i386_win32;
-            linkextern   : ld_i386_win32;
-            ar           : ar_gnu_arw;
-            res          : res_gnu_windres;
-            script       : script_dos;
-            endian       : endian_little;
-            alignment    :
-              (
-                procalign       : 4;
-                loopalign       : 4;
-                jumpalign       : 0;
-                constalignmin   : 0;
-                constalignmax   : 4;
-                varalignmin     : 0;
-                varalignmax     : 4;
-                localalignmin   : 0;
-                localalignmax   : 4;
-                paraalign       : 4;
-                recordalignmin  : 0;
-                recordalignmax  : 2;
-                maxCrecordalign : 16
-              );
-            first_parm_offset : 8;
-            heapsize     : 256*1024;
-            stacksize    : 262144;
-            DllScanSupported:true;
-            use_function_relative_addresses : true
-          );
-
-
 initialization
+{$ifdef i386}
   RegisterLinker(ld_i386_win32,TLinkerWin32);
-  RegisterImport(target_i386_win32,TImportLibWin32);
-  RegisterExport(target_i386_win32,TExportLibWin32);
-  RegisterDLLScanner(target_i386_win32,TDLLScannerWin32);
+  RegisterImport(system_i386_win32,TImportLibWin32);
+  RegisterExport(system_i386_win32,TExportLibWin32);
+  RegisterDLLScanner(system_i386_win32,TDLLScannerWin32);
   RegisterAr(ar_gnu_arw_info);
   RegisterRes(res_gnu_windres_info);
-  RegisterTarget(target_i386_win32_info);
+  RegisterTarget(system_i386_win32_info);
+{$endif i386}
 end.
 {
   $Log$
-  Revision 1.35  2002-07-01 18:46:35  peter
+  Revision 1.36  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.35  2002/07/01 18:46:35  peter
     * internal linker
     * reorganized aasm layer
 

+ 12 - 9
compiler/x86/cgx86.pas

@@ -1279,7 +1279,7 @@ unit cgx86;
 {$ifndef __NOWINPECOFF__}
         { windows guards only a few pages for stack growing, }
         { so we have to access every page first              }
-        if target_info.target=target_i386_win32 then
+        if target_info.system=system_i386_win32 then
           begin
              getlabel(again);
              getlabel(ok);
@@ -1408,11 +1408,11 @@ unit cgx86;
       var
         pl : tasmlabel;
       begin
-        case target_info.target of
-           target_i386_win32,
-           target_i386_freebsd,
-           target_i386_wdosx,
-           target_i386_linux:
+        case target_info.system of
+           system_i386_win32,
+           system_i386_freebsd,
+           system_i386_wdosx,
+           system_i386_linux:
              begin
                 getaddrlabel(pl);
                 list.concat(Tai_section.Create(sec_data));
@@ -1425,7 +1425,7 @@ unit cgx86;
                 include(rg.usedinproc,R_EDX);
              end;
 
-           target_i386_go32v2:
+           system_i386_go32v2:
              begin
                a_call_name(list,'MCOUNT');
              end;
@@ -1446,7 +1446,7 @@ unit cgx86;
 {$ifndef NOTARGETWIN32}
            { windows guards only a few pages for stack growing, }
            { so we have to access every page first              }
-           if (target_info.target=target_i386_win32) and
+           if (target_info.system=system_i386_win32) and
               (localsize>=winstackpagesize) then
              begin
                if localsize div winstackpagesize<=5 then
@@ -1664,7 +1664,10 @@ unit cgx86;
 end.
 {
   $Log$
-  Revision 1.2  2002-07-21 16:55:34  jonas
+  Revision 1.3  2002-07-26 21:15:46  florian
+    * rewrote the system handling
+
+  Revision 1.2  2002/07/21 16:55:34  jonas
     * fixed bug in op_const_reg_reg() for imul
 
   Revision 1.1  2002/07/20 19:28:47  florian