Преглед изворни кода

* Patch from Giulio Bernardi with resource support

git-svn-id: branches/resources@9697 -
michael пре 18 година
родитељ
комит
714e24c186
67 измењених фајлова са 4794 додато и 2135 уклоњено
  1. 6 0
      .gitattributes
  2. 185 229
      compiler/comprsrc.pas
  3. 1 0
      compiler/fmodule.pas
  4. 18 3
      compiler/msg/errore.msg
  5. 5 2
      compiler/msgidx.inc
  6. 140 132
      compiler/msgtxt.inc
  7. 32 3
      compiler/options.pas
  8. 9 0
      compiler/parser.pas
  9. 103 32
      compiler/pmodules.pas
  10. 118 0
      compiler/rescmn.pas
  11. 12 11
      compiler/systems.pas
  12. 43 22
      compiler/systems/i_bsd.pas
  13. 21 43
      compiler/systems/i_linux.pas
  14. 5 5
      compiler/systems/i_sunos.pas
  15. 8 6
      compiler/systems/i_win.pas
  16. 4 1
      compiler/systems/t_bsd.pas
  17. 3 24
      compiler/systems/t_linux.pas
  18. 4 2
      compiler/systems/t_sunos.pas
  19. 10 47
      compiler/systems/t_win.pas
  20. 1 1
      rtl/Makefile
  21. 1 1
      rtl/amiga/Makefile
  22. 1 1
      rtl/beos/Makefile
  23. 54 54
      rtl/darwin/Makefile
  24. 2 1
      rtl/darwin/Makefile.fpc
  25. 1382 0
      rtl/darwin/extres_multiarch.inc
  26. 1 1
      rtl/emx/Makefile
  27. 54 54
      rtl/freebsd/Makefile
  28. 2 1
      rtl/freebsd/Makefile.fpc
  29. 1 1
      rtl/gba/Makefile
  30. 1 1
      rtl/go32v2/Makefile
  31. 1322 0
      rtl/inc/extres.inc
  32. 94 0
      rtl/inc/fpextres.pp
  33. 66 0
      rtl/inc/fpintres.pp
  34. 348 0
      rtl/inc/intres.inc
  35. 55 11
      rtl/inc/resh.inc
  36. 167 10
      rtl/inc/sysres.inc
  37. 2 12
      rtl/inc/system.inc
  38. 65 1031
      rtl/linux/Makefile
  39. 2 1
      rtl/linux/Makefile.fpc
  40. 0 11
      rtl/linux/system.pp
  41. 1 1
      rtl/macos/Makefile
  42. 1 1
      rtl/morphos/Makefile
  43. 1 1
      rtl/nds/Makefile
  44. 54 54
      rtl/netbsd/Makefile
  45. 2 1
      rtl/netbsd/Makefile.fpc
  46. 1 1
      rtl/netware/Makefile
  47. 1 1
      rtl/netwlibc/Makefile
  48. 2 1
      rtl/openbsd/Makefile.fpc
  49. 1 1
      rtl/os2/Makefile
  50. 1 1
      rtl/palmos/Makefile
  51. 54 54
      rtl/solaris/Makefile
  52. 1 1
      rtl/solaris/Makefile.fpc
  53. 1 1
      rtl/symbian/Makefile
  54. 1 1
      rtl/win/sysos.inc
  55. 57 22
      rtl/win/winres.inc
  56. 54 54
      rtl/win32/Makefile
  57. 1 1
      rtl/win32/Makefile.fpc
  58. 1 1
      rtl/win32/buildrtl.pp
  59. 2 7
      rtl/win32/system.pp
  60. 54 54
      rtl/win64/Makefile
  61. 1 1
      rtl/win64/Makefile.fpc
  62. 1 1
      rtl/win64/buildrtl.pp
  63. 5 8
      rtl/win64/system.pp
  64. 54 54
      rtl/wince/Makefile
  65. 1 1
      rtl/wince/Makefile.fpc
  66. 1 4
      rtl/wince/system.pp
  67. 92 53
      rtl/wince/winres.inc

+ 6 - 0
.gitattributes

@@ -398,6 +398,7 @@ compiler/rabase.pas svneol=native#text/plain
 compiler/rasm.pas svneol=native#text/plain
 compiler/rautils.pas svneol=native#text/plain
 compiler/regvars.pas svneol=native#text/plain
+compiler/rescmn.pas svneol=native#text/plain
 compiler/rgbase.pas svneol=native#text/plain
 compiler/rgobj.pas svneol=native#text/plain
 compiler/scandir.pas svneol=native#text/plain
@@ -4894,6 +4895,7 @@ rtl/darwin/Makefile.fpc svneol=native#text/plain
 rtl/darwin/console.pp svneol=native#text/plain
 rtl/darwin/errno.inc svneol=native#text/plain
 rtl/darwin/errnostr.inc -text
+rtl/darwin/extres_multiarch.inc svneol=native#text/plain
 rtl/darwin/i386/sig_cpu.inc svneol=native#text/plain
 rtl/darwin/i386/sighnd.inc svneol=native#text/plain
 rtl/darwin/pmutext.inc svneol=native#text/plain
@@ -5069,9 +5071,12 @@ rtl/inc/dynarrh.inc svneol=native#text/plain
 rtl/inc/dynlibs.pas svneol=native#text/plain
 rtl/inc/elfres32.inc svneol=native#text/plain
 rtl/inc/except.inc svneol=native#text/plain
+rtl/inc/extres.inc svneol=native#text/plain
 rtl/inc/fexpand.inc svneol=native#text/plain
 rtl/inc/file.inc svneol=native#text/plain
 rtl/inc/filerec.inc svneol=native#text/plain
+rtl/inc/fpextres.pp svneol=native#text/plain
+rtl/inc/fpintres.pp svneol=native#text/plain
 rtl/inc/generic.inc svneol=native#text/plain
 rtl/inc/genmath.inc svneol=native#text/plain
 rtl/inc/genset.inc svneol=native#text/plain
@@ -5083,6 +5088,7 @@ rtl/inc/heaph.inc svneol=native#text/plain
 rtl/inc/heaptrc.pp svneol=native#text/plain
 rtl/inc/innr.inc svneol=native#text/plain
 rtl/inc/int64.inc svneol=native#text/plain
+rtl/inc/intres.inc svneol=native#text/plain
 rtl/inc/keyboard.inc svneol=native#text/plain
 rtl/inc/keybrdh.inc svneol=native#text/plain
 rtl/inc/keyscan.inc svneol=native#text/plain

+ 185 - 229
compiler/comprsrc.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2008 by Florian Klaempfl
 
     Handles the resource files handling
 
@@ -26,7 +26,7 @@ unit comprsrc;
 interface
 
   uses
-    Systems, cstreams;
+    Systems, cstreams, Script;
 
 type
    tresoutput = (roRES, roOBJ);
@@ -34,22 +34,33 @@ type
    tresourcefile = class(TAbstractResourceFile)
    private
       fname : ansistring;
+   protected
+      function SetupCompilerArguments(output: tresoutput; const OutName :
+      ansistring; respath: ansistring; out ObjUsed : boolean) : ansistring; virtual;
    public
       constructor Create(const fn : ansistring);override;
-      procedure Compile(output: tresoutput; const OutName: ansistring);virtual;
+      function Compile(output: tresoutput; const OutName: ansistring) : boolean; virtual;
       procedure PostProcessResourcefile(const s : ansistring);virtual;
       function IsCompiled(const fn : ansistring) : boolean;virtual;
       procedure Collect(const fn : ansistring);virtual;
+      procedure EndCollect; virtual;
    end;
    
    TWinLikeResourceFile = class(tresourcefile)
    private
-      FOut: TCFileStream;
-      FLastIconID: longint;
-      FLastCursorID: longint;
+      fResScript : TScript;
+      fScriptName : ansistring;
+      fCollectCount : integer;
+   protected
+      function SetupCompilerArguments(output: tresoutput; const OutName :
+        ansistring; respath: ansistring; out ObjUsed : boolean) : ansistring; override;
    public
+      constructor Create(const fn : ansistring);override;
+      destructor Destroy; override;
+      function Compile(output: tresoutput; const OutName: ansistring) : boolean; override;
       function IsCompiled(const fn : ansistring) : boolean;override;
       procedure Collect(const fn : ansistring);override;
+      procedure EndCollect; override;
    end;
 
 procedure CompileResourceFiles;
@@ -64,11 +75,7 @@ implementation
 uses
   SysUtils,
   cutils,cfileutl,cclasses,
-  Globtype,Globals,Verbose,Fmodule,
-  Script;
-  
-const
-  GlobalResName = 'fpc-res';
+  Globtype,Globals,Verbose,Fmodule, comphook;
 
 {****************************************************************************
                               TRESOURCEFILE
@@ -90,7 +97,6 @@ begin
   Result:=CompareText(ExtractFileExt(fn), target_info.resobjext) = 0;
 end;
 
-
 procedure tresourcefile.Collect(const fn: ansistring);
 begin
   if fn='' then
@@ -99,34 +105,62 @@ begin
   Compile(roOBJ, ChangeFileExt(fn, target_info.resobjext));
 end;
 
+procedure tresourcefile.EndCollect;
+begin
 
-procedure tresourcefile.compile(output: tresoutput; const OutName: ansistring);
+end;
+
+function tresourcefile.SetupCompilerArguments(output: tresoutput; const OutName
+  : ansistring; respath: ansistring; out ObjUsed : boolean) : ansistring;
+var
+  s : TCmdStr;
+begin
+  if output=roRES then
+    begin
+      s:=target_res.rccmd;
+      Replace(s,'$RES',maybequoted(OutName));
+      Replace(s,'$RC',maybequoted(fname));
+      ObjUsed:=False;
+    end
+  else
+    begin
+      s:=target_res.rescmd;
+      ObjUsed:=(pos('$OBJ',s)>0);
+      Replace(s,'$OBJ',maybequoted(OutName));
+      Replace(s,'$RES',maybequoted(fname));
+    end;
+  Result:=s;
+end;
+
+function tresourcefile.compile(output: tresoutput; const OutName: ansistring)
+  : boolean;
 
   Function SelectBin(Const Bin1,Bin2 : String) : String;
-  
   begin
     If (Bin1<>'') then
       SelectBin:=Bin1
     else
-      SelectBin:=Bin2;  
+      SelectBin:=Bin2;
   end;
-  
+
 var
   respath,
-  srcfilepath,
-  preprocessorbin,
   s,
   bin,
   resbin   : TCmdStr;
   resfound,
   objused  : boolean;
 begin
+  Result:=true;
   if output=roRES then
     Bin:=SelectBin(RCCompiler,target_res.rcbin)
   else
     Bin:=SelectBin(ResCompiler,target_res.resbin);
   if bin='' then
+  begin
+    Result:=false;
     exit;
+  end;
   resfound:=false;
   if utilsdirectory<>'' then
     resfound:=FindFile(utilsprefix+bin+source_info.exeext,utilsdirectory,false,resbin);
@@ -138,37 +172,12 @@ begin
    begin
      Message(exec_e_res_not_found);
      current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
+     Result:=false;
    end;
-  srcfilepath:=ExtractFilePath(current_module.mainsource^);
-  if output=roRES then
-    begin
-      s:=target_res.rccmd;
-      Replace(s,'$RES',maybequoted(OutName));
-      Replace(s,'$RC',maybequoted(fname));
-      ObjUsed:=False;
-    end
-  else
-    begin
-      s:=target_res.rescmd;
-      ObjUsed:=(pos('$OBJ',s)>0);
-      Replace(s,'$OBJ',maybequoted(OutName));
-      Replace(s,'$RES',maybequoted(fname));
-    end;
-  { windres doesn't like empty include paths }
-  if respath='' then
-    respath:='.';
-  Replace(s,'$INC',maybequoted(respath));
-  if (target_res.resbin='windres') then
-   begin
-     if (srcfilepath<>'') then
-       s:=s+' --include '+maybequoted(srcfilepath);
-     { try to find a preprocessor }
-     preprocessorbin := respath+'cpp'+source_info.exeext;
-     if FileExists(preprocessorbin,true) then
-       s:=s+' --preprocessor='+preprocessorbin;
-   end;
+  s:=SetupCompilerArguments(output,OutName,respath,objused);
 { Execute the command }
-  if not (cs_link_nolink in current_settings.globalswitches) then
+{ Always try to compile resources. but don't complain if cs_link_nolink }
+  if resfound then
    begin
      Message1(exec_i_compilingresource,fname);
      Message2(exec_d_resbin_params,resbin,s);
@@ -176,39 +185,136 @@ begin
      try
        if ExecuteProcess(resbin,s) <> 0 then
        begin
-         Message(exec_e_error_while_linking);
+         if not (cs_link_nolink in current_settings.globalswitches) then
+           Message(exec_e_error_while_compiling_resources);
          current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
+         Result:=false;
        end;
      except
        on E:EOSError do
        begin
-         Message(exec_e_cant_call_linker);
+         if not (cs_link_nolink in current_settings.globalswitches) then
+           Message(exec_e_cant_call_resource_compiler);
          current_settings.globalswitches:=current_settings.globalswitches+[cs_link_nolink];
+         Result:=false;
        end
      end;
     end;
-  if output=roOBJ then
-    PostProcessResourcefile(OutName);
-  { Update asmres when externmode is set }
-  if cs_link_nolink in current_settings.globalswitches then
-    AsmRes.AddLinkCommand(resbin,s,'');
+  { Update asmres when externmode is set and resource compiling failed }
+  if (not Result) and (cs_link_nolink in current_settings.globalswitches) then
+    AsmRes.AddLinkCommand(resbin,s,OutName);
   if (output=roOBJ) and ObjUsed then
     current_module.linkunitofiles.add(OutName,link_always);
 end;
 
+constructor TWinLikeResourceFile.Create(const fn : ansistring);
+begin
+  inherited Create(fn);
+  fResScript:=nil;
+  fCollectCount:=0;
+  if (tf_use_8_3 in target_info.flags) then
+    fScriptName:=ChangeFileExt(fn,'.rls')
+  else
+    fScriptName:=ChangeFileExt(fn,'.reslst');
+end;
+
+destructor TWinLikeResourceFile.Destroy;
+begin
+  if fResScript<>nil then
+    fResScript.Free;
+  inherited;
+end;
+
+function TWinLikeResourceFile.SetupCompilerArguments(output: tresoutput; const
+  OutName : ansistring; respath : ansistring; out ObjUsed : boolean) : ansistring;
+var
+  srcfilepath,
+  preprocessorbin,
+  s : TCmdStr;
+  arch : ansistring;
+begin
+  srcfilepath:=ExtractFilePath(current_module.mainsource^);
+  if output=roRES then
+    begin
+      s:=target_res.rccmd;
+      Replace(s,'$RES',maybequoted(OutName));
+      Replace(s,'$RC',maybequoted(fname));
+      ObjUsed:=False;
+    end
+  else
+    begin
+      s:=target_res.rescmd;
+      if (res_external_file in target_res.resflags) then
+        ObjUsed:=false
+      else
+        ObjUsed:=(pos('$OBJ',s)>0);
+      Replace(s,'$OBJ',maybequoted(OutName));
+      arch:=cpu2str[target_cpu];
+      //Differentiate between arm and armeb
+      if (source_info.cpu=cpu_arm) and (source_info.endian=endian_big) then
+        arch:=arch+'eb';
+      Replace(s,'$ARCH',arch);
+      case target_info.endian of
+        endian_little : Replace(s,'$ENDIAN','littleendian');
+        endian_big : Replace(s,'$ENDIAN','bigendian');
+      end;
+      //call resource compiler with debug switch
+      if (status.verbosity and V_Debug)<>0 then
+        Replace(s,'$DBG','-v')
+      else
+        Replace(s,'$DBG','');
+      if fCollectCount=0 then
+        s:=s+' '+maybequoted(fname)
+      else
+        s:=s+' @'+fScriptName;
+    end;
+  { windres doesn't like empty include paths }
+  if respath='' then
+    respath:='.';
+  Replace(s,'$INC',maybequoted(respath));
+  if (output=roRes) and (target_res.resbin='windres') then
+  begin
+    if (srcfilepath<>'') then
+      s:=s+' --include '+maybequoted(srcfilepath);
+    { try to find a preprocessor }
+    preprocessorbin := respath+'cpp'+source_info.exeext;
+    if FileExists(preprocessorbin,true) then
+      s:=s+' --preprocessor='+preprocessorbin;
+  end;
+  Result:=s;
+end;
+
+function TWinLikeResourceFile.compile(output: tresoutput;
+  const OutName: ansistring) : boolean;
+begin
+  Result:=inherited compile(output,OutName);
+  //delete fpc-res.lst file if things went well
+  if Result and (output=roOBJ) then
+    DeleteFile(fScriptName);
+end;
 
 function TWinLikeResourceFile.IsCompiled(const fn: ansistring): boolean;
 const
   ResSignature : array [1..32] of byte =
   ($00,$00,$00,$00,$20,$00,$00,$00,$FF,$FF,$00,$00,$FF,$FF,$00,$00,
    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00);
+  dfmexts : array[1..3] of string[4] = ('.lfm', '.dfm', '.xfm');
 var
   f : file;
   oldfmode : byte;
   buf: array[1..32] of byte;
   i: longint;
+  ext : shortstring;
 begin
-  Result:=CompareText(ExtractFileExt(fn), target_info.resext) = 0;
+  ext:=lower(ExtractFileExt(fn));
+  Result:=CompareText(ext, target_info.resext) = 0;
+  if not Result then
+    for i:=1 to high(dfmexts) do
+    begin
+      Result:=CompareText(ext, dfmexts[i]) = 0;
+      if Result then break;
+    end;
+
   if Result or not FileExists(fn, False) then exit;
   oldfmode:=Filemode;
   Filemode:=0;
@@ -228,150 +334,22 @@ begin
   Result:=True;
 end;
 
-
 procedure TWinLikeResourceFile.Collect(const fn: ansistring);
-const
-  zeroes: array[1..3] of byte = (0,0,0);
-
-type
-  TResHeader = packed record
-    DataSize: dword;
-    HeaderSize: dword;
-    ResTypeFlag: word;
-    ResTypeID: word;
-  end;
-  
-  PIconHeader = ^TIconHeader;
-  TIconHeader = packed record
-    Reserved: word;
-    wType: word;
-    wCount: word;
-  end;
-  
-  PIconDir = ^TIconDir;
-  TIconDir = packed record
-    bWidth: byte;
-    bHeight: byte;
-    bColorCount: byte;
-    bReserved: byte;
-    wPlanes: word;
-    wBitCount: word;
-    lBytesInRes: dword;
-    wNameOrdinal: word;
-  end;
+begin
+  if fResScript=nil then
+    fResScript:=TScript.Create(fScriptName);
+  fResScript.Add(fn);
+  inc(fCollectCount);
+end;
 
-var
-  fs: TCFileStream;
-  i, sz, rsz, MaxIconID, MaxCursorID: longint;
-  hdr: TResHeader;
-  P: pointer;
-  PData: PIconHeader;
-  PDir: PIconDir;
-  ResNameBuf: array[0..1] of word;
+procedure TWinLikeResourceFile.EndCollect;
 begin
-  if fn='' then
-    begin
-      if FOut<>nil then
-        begin
-          FOut.Free;
-          Compile(roOBJ,ChangeFileExt(fname,target_info.resobjext));
-        end;
-    end
-  else
-    try
-      fs:=TCFileStream.Create(fn,fmOpenRead or fmShareDenyNone);
-      if CStreamError<>0 then
-        begin
-          fs.Free;
-          Comment(V_Error,'Can''t open resource file: '+fn);
-          Include(current_settings.globalswitches, cs_link_nolink);
-          exit;
-        end;
-      if FOut=nil then
-        begin
-          FOut:=TCFileStream.Create(fname,fmCreate);
-          { writing res signature }
-          FOut.CopyFrom(fs, 32);
-        end
-      else
-        fs.Seek(32, soFromBeginning);
-      sz:=fs.Size;
-      MaxIconID := 0;
-      MaxCursorID := 0;
-      repeat
-        fs.ReadBuffer(hdr, SizeOf(hdr));
-        FOut.WriteBuffer(hdr, SizeOf(hdr));
-        rsz:=hdr.HeaderSize + hdr.DataSize - SizeOf(hdr);
-        if fs.Position + rsz > sz then
-          begin
-            Comment(V_Error,'Invalid resource file: '+fn);
-            Include(current_settings.globalswitches, cs_link_nolink);
-            fs.Free;
-            exit;
-          end;
-        { Adjusting cursor and icon IDs }
-        if hdr.ResTypeFlag = $FFFF then       { resource type is ordinal }
-          case hdr.ResTypeID of
-            1, 3:
-              { cursor or icon resource }
-              begin
-                fs.ReadBuffer(ResNameBuf, SizeOf(ResNameBuf));
-                if ResNameBuf[0] = $FFFF then   { resource name is ordinal }
-                  if hdr.ResTypeID = 1 then
-                    begin
-                      if ResNameBuf[1] > MaxCursorID then
-                        MaxCursorID:=ResNameBuf[1];
-                      Inc(ResNameBuf[1], FLastCursorID);
-                    end
-                  else
-                    begin
-                      if ResNameBuf[1] > MaxIconID then
-                        MaxIconID:=ResNameBuf[1];
-                      Inc(ResNameBuf[1], FLastIconID);
-                    end;
-                FOut.WriteBuffer(ResNameBuf, SizeOf(ResNameBuf));
-                Dec(rsz, SizeOf(ResNameBuf));
-              end;
-            12, 14:
-              { cursor or icon group resource }
-              begin
-                GetMem(P, rsz);
-                fs.ReadBuffer(P^, rsz);
-                PData := PIconHeader(P + hdr.HeaderSize - sizeof(hdr));
-                PDir := PIconDir(Pointer(PData) + sizeof(TIconHeader));
-                for i := 0 to PData^.wCount-1 do
-                  begin
-                    if hdr.ResTypeID = 12 then
-                      Inc(PDir^.wNameOrdinal, FLastCursorID)
-                    else
-                      Inc(PDir^.wNameOrdinal, FLastIconID);
-                    Inc(PDir);
-                  end;
-                FOut.WriteBuffer(P^, rsz);
-                rsz:=0;
-                FreeMem(P);
-              end;
-          end;
-        { copy rest of the resource data }
-        FOut.CopyFrom(fs, rsz);
-        { align resource to dword }
-        i:=4 - FOut.Position mod 4;
-        if i<4 then
-          FOut.WriteBuffer(zeroes, i);
-        { position to the next resource }
-        i:=4 - fs.Position mod 4;
-        if i<4 then
-          fs.Seek(i, soFromCurrent);
-      until fs.Position + SizeOf(hdr) >= sz;
-      fs.Free;
-      Inc(FLastCursorID, MaxCursorID);
-      Inc(FLastIconID, MaxIconID);
-    except
-      on E:EOSError do begin
-        Comment(V_Error,'Error processing resource file: '+fn+': '+E.Message);
-        Include(current_settings.globalswitches, cs_link_nolink);
-      end;
-    end;
+  if fResScript<>nil then
+  begin
+    fResScript.WriteToDisk;
+    FreeAndNil(fResScript);
+    Compile(roOBJ,ChangeFileExt(fname,target_info.resobjext));
+  end;
 end;
 
 
@@ -380,7 +358,6 @@ var
   resourcefile : tresourcefile;
   res: TCmdStrListItem;
   p,s : TCmdStr;
-  src,dst : TCFileStream;
   outfmt : tresoutput;
 begin
   { OS/2 (EMX) must be processed elsewhere (in the linking/binding stage).
@@ -398,35 +375,11 @@ begin
         s:=p+s;
       resourcefile:=TResourceFile(resinfos[target_info.res]^.resourcefileclass.create(s));
       if resourcefile.IsCompiled(s) then
-        begin
-          resourcefile.free;
-          if CompareText(current_module.outputpath^, p) <> 0 then
-            begin
-              { Copy .res file to units output dir }
-              res.FPStr:=ExtractFileName(res.FPStr);
-              src:=TCFileStream.Create(s,fmOpenRead or fmShareDenyNone);
-              if CStreamError<>0 then
-                begin
-                  Comment(V_Error,'Can''t open resource file: '+src.FileName);
-                  Include(current_settings.globalswitches, cs_link_nolink);
-                  exit;
-                end;
-              dst:=TCFileStream.Create(current_module.outputpath^+res.FPStr,fmCreate);
-              if CStreamError<>0 then
-                begin
-                  Comment(V_Error,'Can''t create resource file: '+dst.FileName);
-                  Include(current_settings.globalswitches, cs_link_nolink);
-                  exit;
-                end;
-              dst.CopyFrom(src,src.Size);
-              dst.Free;
-              src.Free;
-            end;
-        end
+        resourcefile.free
       else
         begin
           res.FPStr:=ExtractFileName(res.FPStr);
-          if target_res.rcbin='' then
+          if (target_res.rcbin='') and (RCCompiler='') then
             begin
               { if target does not have .rc to .res compiler, create obj }
               outfmt:=roOBJ;
@@ -474,11 +427,14 @@ var
   hp : tused_unit;
   s : TCmdStr;
 begin
-  if (target_info.res=res_none) or (target_res.rcbin='') then
-    exit;
-  if cs_link_nolink in current_settings.globalswitches then
-    exit;
-  s:=main_module.outputpath^+GlobalResName+target_info.resext;
+  if (target_info.res=res_none) or ((target_res.resbin='')
+    and (ResCompiler='')) then
+      exit;
+//  if cs_link_nolink in current_settings.globalswitches then
+//    exit;
+  s:=ChangeFileExt(current_module.ppufilename^,target_info.resobjext);
+  if (res_arch_in_file_name in target_res.resflags) then
+    s:=ChangeFileExt(s,'.'+cpu2str[target_cpu]+target_info.resobjext);
   resourcefile:=TResourceFile(resinfos[target_info.res]^.resourcefileclass.create(s));
   hp:=tused_unit(usedunits.first);
   while assigned(hp) do
@@ -488,7 +444,7 @@ begin
     end;
   ProcessModule(current_module);
   { Finish collection }
-  resourcefile.Collect('');
+  resourcefile.EndCollect;
   resourcefile.free;
 end;
 

+ 1 - 0
compiler/fmodule.pas

@@ -196,6 +196,7 @@ interface
        compiled_module   : tmodule;     { Current module which is compiled }
        usedunits         : tlinkedlist; { Used units for this program }
        loaded_units      : tlinkedlist; { All loaded units }
+       unloaded_units    : tlinkedlist; { Units removed from loaded_units, to be freed }
        SmartLinkOFiles   : TCmdStrList; { List of .o files which are generated,
                                           used to delete them after linking }
 

+ 18 - 3
compiler/msg/errore.msg

@@ -1,6 +1,6 @@
 #
 #   This file is part of the Free Pascal Compiler
-#   Copyright (c) 1999-2006 by the Free Pascal Development team
+#   Copyright (c) 1999-2008 by the Free Pascal Development team
 #
 #   English (default) Language File for Free Pascal
 #
@@ -1998,7 +1998,7 @@ asmw_e_64bit_not_supported=08021_E_Asm: 64 Bit operands not supported
 #
 # Executing linker/assembler
 #
-# 09028 is the last used one
+# 09030 is the last used one
 #
 # BeginOfTeX
 %
@@ -2078,6 +2078,12 @@ exec_e_unit_not_shared_or_static_linkable=09027_E_unit $1 can't be shared or sta
 % Shared or static linking was requested, but a unit which cannot be used for either  was used.
 exec_d_resbin_params=09028_D_Calling resource compiler "$1" with "$2" as command line
 % An informational message showing which command-line is used for the resource compiler.
+exec_e_error_while_compiling_resources=09029_E_Error while compiling resources
+% The resource compiler or converter returned an error
+exec_e_cant_call_resource_compiler=09030_E_Can't call the resource compiler, switching to external mode
+% An error occurred when calling a resource compiler, the compiler will produce
+% a script that can be used to assemble, compile resources and link or
+% postprocess the program.
 %\end{description}
 # EndOfTeX
 
@@ -2111,7 +2117,7 @@ execinfo_x_stackcommit=09134_X_Stack space committed: $1 bytes
 #
 # Unit loading
 #
-# 10059 is the last used one
+# 10060 is the last used one
 #
 # BeginOfTeX
 % \section{Unit loading messages.}
@@ -2301,6 +2307,9 @@ unit_u_skipping_reresolving_unit=10059_U_Skipping re-resolving unit $1, still lo
 % When you use the \var{-vu} flag, the compiler warns that it
 % skips to recalculate the internal data of the unit because there
 % is no data to recalculate
+unit_u_unload_resunit=10060_U_Unloading resource unit $1 (not needed) 
+% When you use the \var{-vu} flag, the compiler warns that it is unloading the 
+% resource handling unit, since no resources are used.
 % \end{description}
 # EndOfTeX
 
@@ -2673,10 +2682,16 @@ A*2WC_Specify console type application (Windows)
 P*2WC_Specify console type application (Classic Mac OS)
 3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)
 A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)
+3*2We_Use external resources (Darwin)
+P*2We_Use external resources (Darwin)
+p*2We_Use external resources (Darwin)
 3*2WF_Specify full-screen type application (EMX, OS/2)
 3*2WG_Specify graphic type application (EMX, OS/2, Windows)
 A*2WG_Specify graphic type application (Windows)
 P*2WG_Specify graphic type application (Classic Mac OS)
+3*2Wi_Use internal resources (Darwin)
+P*2Wi_Use internal resources (Darwin)
+p*2Wi_Use internal resources (Darwin)
 3*2WN_Do not generate relocation code, needed for debugging (Windows)
 A*2WN_Do not generate relocation code, needed for debugging (Windows)
 3*2WR_Generate relocation code (Windows)

+ 5 - 2
compiler/msgidx.inc

@@ -628,6 +628,8 @@ const
   exec_e_unit_not_smart_or_static_linkable=09026;
   exec_e_unit_not_shared_or_static_linkable=09027;
   exec_d_resbin_params=09028;
+  exec_e_error_while_compiling_resources=09029;
+  exec_e_cant_call_resource_compiler=09030;
   execinfo_f_cant_process_executable=09128;
   execinfo_f_cant_open_executable=09129;
   execinfo_x_codesize=09130;
@@ -693,6 +695,7 @@ const
   unit_u_registering_new_unit=10057;
   unit_u_reresolving_unit=10058;
   unit_u_skipping_reresolving_unit=10059;
+  unit_u_unload_resunit=10060;
   option_usage=11000;
   option_only_one_source_support=11001;
   option_def_only_for_os2=11002;
@@ -734,9 +737,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 45492;
+  MsgTxtSize = 45878;
 
   MsgIdxMax : array[1..20] of longint=(
-    24,86,238,84,63,50,108,22,135,60,
+    24,86,238,84,63,50,108,22,135,61,
     42,1,1,1,1,1,1,1,1,1
   );

+ 140 - 132
compiler/msgtxt.inc

@@ -1,7 +1,7 @@
 {$ifdef Delphi}
-const msgtxt : array[0..000189] of string[240]=(
+const msgtxt : array[0..000191] of string[240]=(
 {$else Delphi}
-const msgtxt : array[0..000189,1..240] of char=(
+const msgtxt : array[0..000191,1..240] of char=(
 {$endif Delphi}
   '01000_T_Compiler: $1'#000+
   '01001_D_Compiler OS: $1'#000+
@@ -704,124 +704,128 @@ const msgtxt : array[0..000189,1..240] of char=(
   '09026_E_unit $1 can'#039't be smart or static linked'#000+
   '09027_E_unit $1 can'#039't be shared or static linked'#000,
   '09028_D_Calling resource compiler "$1" with "$2" as command line'#000+
+  '09029_E_Error while compiling resources'#000+
+  '09030_E_Can'#039't call the resource compiler, switching to external mo'+
+  'de'#000+
   '09128_F_Can'#039't post process executable $1'#000+
-  '09129_F_Can'#039't open executable $1'#000+
+  '09129_F_Can'#039't open execut','able $1'#000+
   '09130_X_Size of Code: $1 bytes'#000+
   '09131_X_Size of initialized data: $1 bytes'#000+
-  '09132_X_Size of uninitializ','ed data: $1 bytes'#000+
+  '09132_X_Size of uninitialized data: $1 bytes'#000+
   '09133_X_Stack space reserved: $1 bytes'#000+
   '09134_X_Stack space committed: $1 bytes'#000+
   '10000_T_Unitsearch: $1'#000+
-  '10001_T_PPU Loading $1'#000+
+  '10001_T_PPU',' Loading $1'#000+
   '10002_U_PPU Name: $1'#000+
   '10003_U_PPU Flags: $1'#000+
   '10004_U_PPU Crc: $1'#000+
   '10005_U_PPU Time: $1'#000+
-  '10006_U_PPU F','ile too short'#000+
+  '10006_U_PPU File too short'#000+
   '10007_U_PPU Invalid Header (no PPU at the begin)'#000+
   '10008_U_PPU Invalid Version $1'#000+
-  '10009_U_PPU is compiled for another processor'#000+
+  '10009_U_PPU is compiled for another p','rocessor'#000+
   '10010_U_PPU is compiled for an other target'#000+
   '10011_U_PPU Source: $1'#000+
   '10012_U_Writing $1'#000+
-  '10013_F_Can'#039't ','Write PPU-File'#000+
+  '10013_F_Can'#039't Write PPU-File'#000+
   '10014_F_Error reading PPU-File'#000+
   '10015_F_unexpected end of PPU-File'#000+
   '10016_F_Invalid PPU-File entry: $1'#000+
-  '10017_F_PPU Dbx count problem'#000+
+  '10017_F_PPU Dbx',' count problem'#000+
   '10018_E_Illegal unit name: $1'#000+
   '10019_F_Too much units'#000+
-  '10020_F_Circular unit reference between $','1 and $2'#000+
+  '10020_F_Circular unit reference between $1 and $2'#000+
   '10021_F_Can'#039't compile unit $1, no sources available'#000+
   '10022_F_Can'#039't find unit $1 used by $2'#000+
-  '10023_W_Unit $1 was not found but $2 exists'#000+
+  '10023_W_Unit $1 was not found bu','t $2 exists'#000+
   '10024_F_Unit $1 searched but $2 found'#000+
   '10025_W_Compiling the system unit requires the -Us switch'#000+
-  '1','0026_F_There were $1 errors compiling module, stopping'#000+
+  '10026_F_There were $1 errors compiling module, stopping'#000+
   '10027_U_Load from $1 ($2) unit $3'#000+
-  '10028_U_Recompiling $1, checksum changed for $2'#000+
+  '10028_U_Recompiling $1, checksum changed f','or $2'#000+
   '10029_U_Recompiling $1, source found only'#000+
   '10030_U_Recompiling unit, static lib is older than ppufile'#000+
-  '10','031_U_Recompiling unit, shared lib is older than ppufile'#000+
+  '10031_U_Recompiling unit, shared lib is older than ppufile'#000+
   '10032_U_Recompiling unit, obj and asm are older than ppufile'#000+
-  '10033_U_Recompiling unit, obj is older than asm'#000+
+  '10033_U_Recom','piling unit, obj is older than asm'#000+
   '10034_U_Parsing interface of $1'#000+
   '10035_U_Parsing implementation of $1'#000+
-  '10036','_U_Second load for unit $1'#000+
+  '10036_U_Second load for unit $1'#000+
   '10037_U_PPU Check file $1 time $2'#000+
   '10040_W_Can'#039't recompile unit $1, but found modifed include files'#000+
-  '10041_U_File $1 is newer than PPU file $2'#000+
+  '10041','_U_File $1 is newer than PPU file $2'#000+
   '10042_U_Trying to use a unit which was compiled with a different FPU m'+
-  'od','e'#000+
+  'ode'#000+
   '10043_U_Loading interface units from $1'#000+
   '10044_U_Loading implementation units from $1'#000+
   '10045_U_Interface CRC changed for unit $1'#000+
-  '10046_U_Implementation CRC changed for unit $1'#000+
+  '10','046_U_Implementation CRC changed for unit $1'#000+
   '10047_U_Finished compiling unit $1'#000+
-  '10048_U_Add dependency of $1 ','to $2'#000+
+  '10048_U_Add dependency of $1 to $2'#000+
   '10049_U_No reload, is caller: $1'#000+
   '10050_U_No reload, already in second compile: $1'#000+
   '10051_U_Flag for reload: $1'#000+
-  '10052_U_Forced reloading'#000+
+  '10052_U_Forced ','reloading'#000+
   '10053_U_Previous state of $1: $2'#000+
   '10054_U_Already compiling $1, setting second compile'#000+
-  '10055_U_Loadi','ng unit $1'#000+
+  '10055_U_Loading unit $1'#000+
   '10056_U_Finished loading unit $1'#000+
   '10057_U_Registering new unit $1'#000+
   '10058_U_Re-resolving unit $1'#000+
-  '10059_U_Skipping re-resolving unit $1, still loading used units'#000+
+  '10059_U_Skipping re-resolv','ing unit $1, still loading used units'#000+
+  '10060_U_Unloading resource unit $1 (not needed) '#000+
   '11000_O_$1 [options] <inputfile> [options]'#000+
-  '11001_W_Only one source file',' supported'#000+
+  '11001_W_Only one source file supported'#000+
   '11002_W_DEF file can be created only for OS/2'#000+
-  '11003_E_nested response files are not supported'#000+
+  '11003_E_nested response f','iles are not supported'#000+
   '11004_F_No source file name in command line'#000+
   '11005_N_No option inside $1 config file'#000+
   '11006_E_Illegal parameter: $1'#000+
-  '11007_H_-? writes hel','p pages'#000+
+  '11007_H_-? writes help pages'#000+
   '11008_F_Too many config files nested'#000+
   '11009_F_Unable to open file $1'#000+
-  '11010_D_Reading further options from $1'#000+
+  '11010_','D_Reading further options from $1'#000+
   '11011_W_Target is already set to: $1'#000+
   '11012_W_Shared libs not supported on DOS platform, reverting to static'+
   #000+
-  '11013_F_too many',' IF(N)DEFs'#000+
+  '11013_F_too many IF(N)DEFs'#000+
   '11014_F_too many ENDIFs'#000+
-  '11015_F_open conditional at the end of the file'#000+
+  '11015_F_open conditional at the end of the file',#000+
   '11016_W_Debug information generation is not supported by this executab'+
   'le'#000+
   '11017_H_Try recompiling with -dGDB'#000+
   '11018_W_You are using the obsolete switch $1'#000+
-  '1101','9_W_You are using the obsolete switch $1, please use $2'#000+
-  '11020_N_Switching assembler to default source writing assembler'#000+
+  '11019_W_You are using the obsolete switch $1, please use $2'#000+
+  '11020_N_Switching assemble','r to default source writing assembler'#000+
   '11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+
   '11022_W_"$1" assembler use forced'#000+
-  '11026_T_Reading opt','ions from file $1'#000+
+  '11026_T_Reading options from file $1'#000+
   '11027_T_Reading options from environment $1'#000+
-  '11028_D_Handling option "$1"'#000+
+  '11028_D_Handling opt','ion "$1"'#000+
   '11029__*** press enter ***'#000+
   '11030_H_Start of reading config file $1'#000+
   '11031_H_End of reading config file $1'#000+
   '11032_D_interpreting option "$1"'#000+
-  '11036_D_int','erpreting firstpass option "$1"'#000+
+  '11036_D_interpreting firstpass option "$1"'#000+
   '11033_D_interpreting file option "$1"'#000+
-  '11034_D_Reading config file "$1"'#000+
+  '11034_D_Read','ing config file "$1"'#000+
   '11035_D_found source file name "$1"'#000+
   '11039_E_Unknown code page'#000+
   '11040_F_Config file $1 is a directory'#000+
-  '11041_W_Assembler output selected "$1','" cannot generate debug info, d'+
-  'ebugging disabled'#000+
-  '11023_Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPC'+
-  'CPU'#010+
+  '11041_W_Assembler output selected "$1" cannot generate debug info, deb'+
+  'ugging disabled'#000+
+  '11023_Free Pascal Compiler versio','n $FPCFULLVERSION [$FPCDATE] for $F'+
+  'PCCPU'#010+
   'Copyright (c) 1993-2007 by Florian Klaempfl'#000+
   '11024_Free Pascal Compiler version $FPCVERSION'#010+
   #010+
-  'Compiler Date      : $FPC','DATE'#010+
+  'Compiler Date      : $FPCDATE'#010+
   'Compiler CPU Target: $FPCCPU'#010+
   #010+
   'Supported targets:'#010+
   '  $OSTARGETS'#010+
   #010+
-  'Supported CPU instruction sets:'#010+
+  'Supported CPU ','instruction sets:'#010+
   '  $INSTRUCTIONSETS'#010+
   #010+
   'Supported FPU instruction sets:'#010+
@@ -830,262 +834,266 @@ const msgtxt : array[0..000189,1..240] of char=(
   'Supported Optimizations:'#010+
   '  $OPTIMIZATIONS'#010+
   #010+
-  'This program comes und','er the GNU General Public Licence'#010+
+  'This program comes under the GNU General Public Licence'#010+
   'For more information read COPYING.FPC'#010+
   #010+
-  'Report bugs,suggestions etc to:'#010+
+  'Report bu','gs,suggestions etc to:'#010+
   '                 [email protected]'#000+
   '11025_**0*_Put + after a boolean switch option to enable it, - to disa'+
   'ble it'#010+
-  '**1a_The compiler doe','sn'#039't delete the generated assembler file'#010+
-  '**2al_List sourcecode lines in assembler file'#010+
+  '**1a_The compiler doesn'#039't delete the generated assembler file'#010+
+  '**2al_List sourcecode lines in assembler ','file'#010+
   '**2an_List node info in assembler file'#010+
   '*L2ap_Use pipes instead of creating temporary assembler files'#010+
-  '**2ar_List register allocation/release info in assem','bler file'#010+
+  '**2ar_List register allocation/release info in assembler file'#010+
   '**2at_List temp allocation/release info in assembler file'#010+
-  '**1A<x>_Output format:'#010+
+  '**1A<x>_Output',' format:'#010+
   '**2Adefault_Use default assembler'#010+
   '3*2Aas_Assemble using GNU AS'#010+
   '3*2Anasmcoff_COFF (Go32v2) file using Nasm'#010+
   '3*2Anasmelf_ELF32 (Linux) file using Nasm'#010+
-  '3','*2Anasmwin32_Win32 object file using Nasm'#010+
-  '3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+
+  '3*2Anasmwin32_Win32 object file using Nasm'#010+
+  '3*2Anasmwdosx_Win32/WDOSX object file us','ing Nasm'#010+
   '3*2Awasm_Obj file using Wasm (Watcom)'#010+
   '3*2Anasmobj_Obj file using Nasm'#010+
   '3*2Amasm_Obj file using Masm (Microsoft)'#010+
-  '3*2Atasm_Obj file using Tasm (Borland)',#010+
+  '3*2Atasm_Obj file using Tasm (Borland)'#010+
   '3*2Aelf_ELF (Linux) using internal writer'#010+
-  '3*2Acoff_COFF (Go32v2) using internal writer'#010+
+  '3*2Acoff_COFF (Go32v2) using internal w','riter'#010+
   '3*2Apecoff_PE-COFF (Win32) using internal writer'#010+
   '4*2Aas_Assemble using GNU AS'#010+
   '6*2Aas_Unix o-file using GNU AS'#010+
   '6*2Agas_GNU Motorola assembler'#010+
-  '6*2Amit_MIT',' Syntax (old GAS)'#010+
+  '6*2Amit_MIT Syntax (old GAS)'#010+
   '6*2Amot_Standard Motorola assembler'#010+
-  'A*2Aas_Assemble using GNU AS'#010+
+  'A*2Aas_Assemble using GNU AS',#010+
   'P*2Aas_Assemble using GNU AS'#010+
   'S*2Aas_Assemble using GNU AS'#010+
   '**1b_Generate browser info'#010+
   '**2bl_Generate local symbol info'#010+
   '**1B_Build all modules'#010+
-  '**1C<x>_Code gen','eration options:'#010+
+  '**1C<x>_Code generation options:'#010+
   '**2Cc<x>_Set default calling convention to <x>'#010+
-  '**2CD_Create also dynamic library (not supported)'#010+
+  '**2CD_Create also ','dynamic library (not supported)'#010+
   '**2Ce_Compilation with emulated floating point opcodes'#010+
   '**2Cf<x>_Select fpu instruction set to use, see fpc -i for possible va'+
-  'l','ues'#010+
+  'lues'#010+
   '**2CF<x>_Minimal floating point constant precision (default, 32, 64)'#010+
-  '**2Cg_Generate PIC code'#010+
+  '**2Cg_Gen','erate PIC code'#010+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#010+
   '**2Ci_IO-checking'#010+
   '**2Cn_Omit linking stage'#010+
   '**2Co_Check overflow of integer operations'#010+
-  '**2CO','_Check for possible overflow of integer operations'#010+
-  '**2Cp<x>_Select instruction set, see fpc -i for possible values'#010+
+  '**2CO_Check for possible overflow of integer operations'#010+
+  '**2Cp<x>_Select instruction set',', see fpc -i for possible values'#010+
   '**2CP<x>=<y>_ packing settings'#010+
   '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 '+
   'and 8'#010+
-  '**2Cr_Range checki','ng'#010+
+  '**2Cr_Range checking'#010+
   '**2CR_Verify object method call validity'#010+
   '**2Cs<n>_Set stack size to <n>'#010+
-  '**2Ct_Stack checking'#010+
+  '**2Ct_S','tack checking'#010+
   '**2CX_Create also smartlinked library'#010+
   '**1d<x>_Defines the symbol <x>'#010+
   '**1D_Generate a DEF file'#010+
   '**2Dd<x>_Set description to <x>'#010+
-  '**2Dv<x>_Set DLL v','ersion to <x>'#010+
+  '**2Dv<x>_Set DLL version to <x>'#010+
   '*O2Dw_PM application'#010+
   '**1e<x>_Set path to executable'#010+
-  '**1E_Same as -Cn'#010+
+  '**1E_Same as -Cn',#010+
   '**1fPIC_Same as -Cg'#010+
   '**1F<x>_Set file names and paths:'#010+
   '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+
   'sed'#010+
-  '**2Fc<x>_Set input codepage t','o <x>'#010+
+  '**2Fc<x>_Set input codepage to <x>'#010+
   '**2FC<x>_Set RC compiler binary name to <x>'#010+
-  '**2FD<x>_Set the directory where to search for compiler utilities'#010+
+  '**2FD<x>_Set the directory where',' to search for compiler utilities'#010+
   '**2Fe<x>_Redirect error output to <x>'#010+
   '**2Ff<x>_Add <x> to framework path (Darwin only)'#010+
-  '**2FE<x>_Set exe/unit output path to ','<x>'#010+
+  '**2FE<x>_Set exe/unit output path to <x>'#010+
   '**2Fi<x>_Add <x> to include path'#010+
   '**2Fl<x>_Add <x> to library path'#010+
-  '**2FL<x>_Use <x> as dynamic linker'#010+
+  '**2FL<x>_Use',' <x> as dynamic linker'#010+
   '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+
   'r'#010+
   '**2Fo<x>_Add <x> to object path'#010+
-  '**2Fr<x>_Load error message fil','e <x>'#010+
+  '**2Fr<x>_Load error message file <x>'#010+
   '**2FR<x>_Set resource (.res) linker to <x>'#010+
   '**2Fu<x>_Add <x> to unit path'#010+
-  '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+
+  '**2','FU<x>_Set unit output path to <x>, overrides -FE'#010+
   '*g1g_Generate debug information (default format for target)'#010+
   '*g2gc_Generate checks for pointers'#010+
-  '*g2gh_Use heap','trace unit (for memory leak/corruption debugging)'#010+
-  '*g2gl_Use line info unit (show more info with backtraces)'#010+
+  '*g2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+
+  '*g2gl_Use line info unit (show m','ore info with backtraces)'#010+
   '*g2go<x>_Set debug information options'#010+
   '*g3godwarfsets_ Enable Dwarf set debug information (breaks gdb < 6.5)'#010+
-  '*g2gp_Preserve case in ','stabs symbol names'#010+
+  '*g2gp_Preserve case in stabs symbol names'#010+
   '*g2gs_Generate stabs debug information'#010+
-  '*g2gt_Trash local variables (to detect uninitialized uses)'#010+
+  '*g2gt_Trash local variab','les (to detect uninitialized uses)'#010+
   '*g2gv_Generates programs traceable with valgrind'#010+
   '*g2gw_Generate dwarf-2 debug information (same as -gw2)'#010+
-  '*g2gw2_Generate dw','arf-2 debug information'#010+
+  '*g2gw2_Generate dwarf-2 debug information'#010+
   '*g2gw3_Generate dwarf-3 debug information'#010+
-  '**1i_Information'#010+
+  '**1i_Information',#010+
   '**2iD_Return compiler date'#010+
   '**2iV_Return short compiler version'#010+
   '**2iW_Return full compiler version'#010+
   '**2iSO_Return compiler OS'#010+
-  '**2iSP_Return compiler host proce','ssor'#010+
+  '**2iSP_Return compiler host processor'#010+
   '**2iTO_Return target OS'#010+
   '**2iTP_Return target processor'#010+
-  '**1I<x>_Add <x> to include path'#010+
+  '**1I<x>_Add <x> to inc','lude path'#010+
   '**1k<x>_Pass <x> to the linker'#010+
   '**1l_Write logo'#010+
   '**1M<x>_Set language mode to <x>'#010+
   '**2Mfpc_Free Pascal dialect (default)'#010+
-  '**2Mobjfpc_FPC mode with Objec','t Pascal support'#010+
+  '**2Mobjfpc_FPC mode with Object Pascal support'#010+
   '**2Mdelphi_Delphi 7 compatibility mode'#010+
-  '**2Mtp_TP/BP 7.0 compatibility mode'#010+
+  '**2Mtp_TP/BP 7.0 compatibi','lity mode'#010+
   '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
   '**1n_Do not read the default config files'#010+
   '**1N<x>_Node tree optimizations'#010+
-  '**2Nu_Unroll loops',#010+
+  '**2Nu_Unroll loops'#010+
   '**1o<x>_Change the name of the executable produced to <x>'#010+
-  '**1O<x>_Optimizations:'#010+
+  '**1O<x>_Optimizations:'#010,
   '**2O-_Disable optimizations'#010+
   '**2O1_Level 1 optimizations (quick and debugger friendly)'#010+
   '**2O2_Level 2 optimizations (-O1 + quick optimizations)'#010+
-  '**2O3_Level 3 op','timizations (-O2 + slow optimizations)'#010+
+  '**2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+
   '**2Oa<x>=<y>_Set alignment'#010+
-  '**2Oo[NO]<x>_Enable or disable optimizations, see fpc -i for possible '+
-  'values'#010+
+  '**2Oo[NO]<x>_Ena','ble or disable optimizations, see fpc -i for possibl'+
+  'e values'#010+
   '**2Op<x>_Set target cpu for optimizing, see fpc -i for possible values'+
   #010+
-  '**2Os_Optimize for size ra','ther than speed'#010+
+  '**2Os_Optimize for size rather than speed'#010+
   '**1pg_Generate profile code for gprof (defines FPC_PROFILE)'#010+
-  '**1R<x>_Assembler reading style:'#010+
+  '**1R<x','>_Assembler reading style:'#010+
   '**2Rdefault_Use default assembler for target'#010+
   '3*2Ratt_Read AT&T style assembler'#010+
   '3*2Rintel_Read Intel style assembler'#010+
-  '6*2RMOT_Read mo','torola style assembler'#010+
+  '6*2RMOT_Read motorola style assembler'#010+
   '**1S<x>_Syntax options:'#010+
   '**2S2_Same as -Mobjfpc'#010+
-  '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+
+  '**2Sc_Suppor','t operators like C (*=,+=,/= and -=)'#010+
   '**2Sa_Turn on assertions'#010+
   '**2Sd_Same as -Mdelphi'#010+
   '**2Se<x>_Error options. <x> is a combination of the following:'#010+
-  '**3*_<n> :',' Compiler halts after the <n> errors (default is 1)'#010+
-  '**3*_w : Compiler also halts after warnings'#010+
+  '**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
+  '**3*_w : Compiler also halts a','fter warnings'#010+
   '**3*_n : Compiler also halts after notes'#010+
   '**3*_h : Compiler also halts after hints'#010+
   '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)'#010+
-  '**2','Sh_Use ansistrings by default instead of shortstrings'#010+
-  '**2Si_Turn on inlining of procedures/functions declared as "inline"'#010+
+  '**2Sh_Use ansistrings by default instead of shortstrings'#010+
+  '**2Si_Turn on inlining of pr','ocedures/functions declared as "inline"'#010+
   '**2Sk_Load fpcylix unit'#010+
   '**2SI<x>_Set interface style to <x>'#010+
   '**3SIcom_COM compatible interface (default)'#010+
-  '**3SIcorba_COR','BA compatible interface'#010+
+  '**3SIcorba_CORBA compatible interface'#010+
   '**2Sm_Support macros like C (global)'#010+
   '**2So_Same as -Mtp'#010+
-  '**2Ss_Constructor name must be init (destructor must be done)'#010+
+  '**','2Ss_Constructor name must be init (destructor must be done)'#010+
   '**2St_Allow static keyword in objects'#010+
-  '**2Sx_Enable exception keywords (default in Delphi/ObjFPC mo','des)'#010+
+  '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
   '**1s_Do not call assembler and linker'#010+
   '**2sh_Generate script to link on host'#010+
-  '**2st_Generate script to link on target'#010+
+  '*','*2st_Generate script to link on target'#010+
   '**2sr_Skip register allocation phase (use with -alr)'#010+
   '**1T<x>_Target operating system:'#010+
-  '3*2Temx_OS/2 via EMX (including E','MX/RSX extender)'#010+
+  '3*2Temx_OS/2 via EMX (including EMX/RSX extender)'#010+
   '3*2Tfreebsd_FreeBSD'#010+
-  '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+
+  '3*2Tgo32v2_Version 2 of DJ Delorie DOS extend','er'#010+
   '3*2Tlinux_Linux'#010+
   '3*2Tnetbsd_NetBSD'#010+
   '3*2Tnetware_Novell Netware Module (clib)'#010+
   '3*2Tnetwlibc_Novell Netware Module (libc)'#010+
   '3*2Topenbsd_OpenBSD'#010+
-  '3*2Tos2_OS/2 / eCo','mStation'#010+
+  '3*2Tos2_OS/2 / eComStation'#010+
   '3*2Tsunos_SunOS/Solaris'#010+
   '3*2Tsymbian_Symbian OS'#010+
-  '3*2Twatcom_Watcom compatible DOS extender'#010+
+  '3*2Twatcom_Watcom compatib','le DOS extender'#010+
   '3*2Twdosx_WDOSX DOS extender'#010+
   '3*2Twin32_Windows 32 Bit'#010+
   '3*2Twince_Windows CE'#010+
   '4*2Tlinux_Linux'#010+
   '6*2Tamiga_Commodore Amiga'#010+
-  '6*2Tatari_Atari ST/STe/TT',#010+
+  '6*2Tatari_Atari ST/STe/TT'#010+
   '6*2Tlinux_Linux/m68k'#010+
   '6*2Tmacos_Macintosh m68k (not supported)'#010+
   '6*2Tpalmos_PalmOS'#010+
-  'A*2Tlinux_Linux'#010+
+  'A','*2Tlinux_Linux'#010+
   'A*2Twince_Windows CE'#010+
   'P*2Tamiga_AmigaOS on PowerPC'#010+
   'P*2Tdarwin_Darwin and Mac OS X on PowerPC'#010+
   'P*2Tlinux_Linux on PowerPC'#010+
-  'P*2Tmacos_Mac OS (classi','c) on PowerPC'#010+
+  'P*2Tmacos_Mac OS (classic) on PowerPC'#010+
   'P*2Tmorphos_MorphOS'#010+
   'S*2Tlinux_Linux'#010+
-  '**1u<x>_Undefines the symbol <x>'#010+
+  '**1u<x>_Undefines the symbol <x>',#010+
   '**1U_Unit options:'#010+
   '**2Un_Do not check where the unit name matches the file name'#010+
   '**2Ur_Generate release unit files (never automatically recompiled)'#010+
-  '**2Us_Comp','ile a system unit'#010+
-  '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
+  '**2Us_Compile a system unit'#010+
+  '**1v<x>_Be verbose. <x> is a combination of the following letter','s:'#010+
   '**2*_e : Show errors (default)       0 : Show nothing (except errors)'#010+
   '**2*_w : Show warnings               u : Show unit info'#010+
-  '**2*_n : Show notes          ','        t : Show tried/used files'#010+
-  '**2*_h : Show hints                  c : Show conditionals'#010+
+  '**2*_n : Show notes                  t : Show tried/used files'#010+
+  '**2*_h : Show hints                  c : Show co','nditionals'#010+
   '**2*_i : Show general info           d : Show debug info'#010+
   '**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode'#010+
-  '**2*_a : Show everyt','hing             x : Executable info (Win32 only'+
-  ')'#010+
-  '**2*_b : Write file names messages with full path'#010+
+  '**2*_a : Show everything             x : Executable info (Win32 only)'#010+
+  '**2*_b : Write file names messag','es with full path'#010+
   '**2*_v : Write fpcdebug.txt with     p : Write tree.log with parse tre'+
   'e'#010+
   '**2*_    lots of debugging info'#010+
-  '3*1W<x>_Target-specific options (tar','gets)'#010+
+  '3*1W<x>_Target-specific options (targets)'#010+
   'A*1W<x>_Target-specific options (targets)'#010+
-  'P*1W<x>_Target-specific options (targets)'#010+
+  'P*1W<x>_Target-specific options (t','argets)'#010+
   '3*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'P*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'p*2Wb_Create a bundle instead of a library (Da','rwin)'#010+
+  'p*2Wb_Create a bundle instead of a library (Darwin)'#010+
   '3*2WB_Create a relocatable image (Windows)'#010+
-  'A*2WB_Create a relocatable image (Windows, Symbian)'#010+
+  'A*2WB_Create a relocatable image ','(Windows, Symbian)'#010+
   '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
   'A*2WC_Specify console type application (Windows)'#010+
-  'P*2WC_Specify console type app','lication (Classic Mac OS)'#010+
-  '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
+  'P*2WC_Specify console type application (Classic Mac OS)'#010+
+  '3*2WD_Use DEFFILE to export functions of DLL or EXE (Win','dows)'#010+
   'A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
+  '3*2We_Use external resources (Darwin)'#010+
+  'P*2We_Use external resources (Darwin)'#010+
+  'p*2We_Use external resources (Darwin)'#010+
   '3*2WF_Specify full-screen type application (EMX, OS/2)'#010+
-  '3*2WG_Specify graphic type applicat','ion (EMX, OS/2, Windows)'#010+
+  '3*2','WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
   'A*2WG_Specify graphic type application (Windows)'#010+
   'P*2WG_Specify graphic type application (Classic Mac OS)'#010+
+  '3*2Wi_Use internal resources (Darwin)'#010+
+  'P*2Wi_Use internal resources (Darwin)'#010+
+  'p*','2Wi_Use internal resources (Darwin)'#010+
   '3*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  'A*2WN_Do not generate relocation code, n','eeded for debugging (Windows'+
-  ')'#010+
+  'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   '3*2WR_Generate relocation code (Windows)'#010+
-  'A*2WR_Generate relocation code (Windows)'#010+
+  'A*2WR_Generate relocati','on code (Windows)'#010+
   'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   '**1X_Executable options:'#010+
-  '**2Xc_Pass --shared/-dynamic to the linker (Be','OS, Darwin, FreeBSD, L'+
-  'inux)'#010+
-  '**2Xd_Do not use standard library search path (needed for cross compil'+
-  'e)'#010+
+  '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
+  'ux)'#010+
+  '**2Xd_Do not use standard library search path (needed for cross co','mp'+
+  'ile)'#010+
   '**2Xe_Use external linker'#010+
   '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
   '**2Xi_Use internal linker'#010+
-  '**2Xm_Generate link',' map'#010+
+  '**2Xm_Generate link map'#010+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   's '#039'main'#039')'#010+
-  '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
+  '**2XP<x>_Prepend ','the binutils names with the prefix <x>'#010+
   '**2Xr<x>_Set library search path to <x> (needed for cross compile) (Be'+
   'OS, Linux)'#010+
-  '**2XR<x>_Prepend <x> to al','l linker search paths (BeOS, Darwin, FreeB'+
-  'SD, Linux, Mac OS, Solaris)'#010+
-  '**2Xs_Strip all symbols from executable'#010+
+  '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
+  ', Linux, Mac OS, Solaris)'#010+
+  '**2Xs_Strip all symbols ','from executable'#010+
   '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
-  '**2Xt_Link with static libraries (-static is passed to linke','r)'#010+
+  '**2Xt_Link with static libraries (-static is passed to linker)'#010+
   '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
   '**1*_'#010+
-  '**1?_Show this help'#010+
+  '**1?_Show this help',#010+
   '**1h_Shows this help without waiting'#000
 );

+ 32 - 3
compiler/options.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Florian Klaempfl and Peter Vreman
+    Copyright (c) 1998-2008 by Florian Klaempfl and Peter Vreman
 
     Reads command line options and config files
 
@@ -76,7 +76,8 @@ uses
   version,
   cutils,cmsgs,
   comphook,
-  symtable,scanner,rabase
+  symtable,scanner,rabase,
+  i_bsd
   ;
 
 const
@@ -1318,6 +1319,17 @@ begin
                         UseDeffileForExports:=not UnsetBool(More, j);
                         UseDeffileForExportsSetExplicitly:=true;
                       end;
+                    'e':
+                      begin
+                        if (target_info.system in systems_darwin) then
+                          begin
+                            RegisterRes(res_macosx_ext_info,TWinLikeResourceFile);
+                            set_target_res(res_ext);
+                            target_info.resobjext:='.fpcres';
+                          end
+                        else
+                          IllegalPara(opt);
+                      end;
                     'F':
                       begin
                         if UnsetBool(More, j) then
@@ -1337,6 +1349,17 @@ begin
                         GenerateImportSection:=not UnsetBool(More,j);
                         GenerateImportSectionSetExplicitly:=true;
                       end;
+                    'i':
+                      begin
+                        if (target_info.system in systems_darwin) then
+                          begin
+                            set_target_res(res_macho);
+                            target_info.resobjext:=
+                              targetinfos[target_info.system]^.resobjext;
+                          end
+                        else
+                          IllegalPara(opt);
+                      end;
                     'N':
                       begin
                         RelocSection:=UnsetBool(More,j);
@@ -1996,6 +2019,13 @@ begin
     include(init_settings.moduleswitches,cs_create_pic)
   else
     exclude(init_settings.moduleswitches,cs_create_pic);
+    
+  { Resources support }
+  if (tf_has_resources in target_info.flags) then
+    if def then
+      def_system_macro('FPC_HAS_RESOURCES')
+    else
+      undef_system_macro('FPC_HAS_RESOURCES');
 end;
 
 
@@ -2186,7 +2216,6 @@ begin
   def_system_macro('FPC_HAS_TYPE_EXTENDED');
   def_system_macro('FPC_HAS_TYPE_DOUBLE');
   def_system_macro('FPC_HAS_TYPE_SINGLE');
-  def_system_macro('FPC_HAS_RESOURCES');
 {$endif}
 {$ifdef m68k}
   def_system_macro('CPU68');

+ 9 - 0
compiler/parser.pas

@@ -68,6 +68,8 @@ implementation
          loaded_units:=TLinkedList.Create;
 
          usedunits:=TLinkedList.Create;
+         
+         unloaded_units:=TLinkedList.Create;
 
          { global switches }
          current_settings.globalswitches:=init_settings.globalswitches;
@@ -149,6 +151,11 @@ implementation
              usedunits.free;
              usedunits:=nil;
            end;
+         if assigned(unloaded_units) then
+           begin
+             unloaded_units.free;
+             unloaded_units:=nil;
+           end;
 
          { if there was an error in the scanner, the scanner is
            still assinged }
@@ -492,6 +499,8 @@ implementation
                    end;
                  hp:=hp2;
                end;
+              { free also unneeded units we didn't free before }
+              unloaded_units.Clear;
              end;
            dec(compile_level);
            set_current_module(olddata^.old_current_module);

+ 103 - 32
compiler/pmodules.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2008 by Florian Klaempfl
 
     Handles the parsing and loading of the modules (ppufiles)
 
@@ -226,47 +226,46 @@ implementation
       end;
 
 
-    Procedure InsertResourceInfo;
-
+    Function CheckResourcesUsed : boolean;
     var
       hp           : tused_unit;
       found        : Boolean;
+    begin
+      CheckResourcesUsed:=tf_has_resources in target_info.flags;
+      if not CheckResourcesUsed then exit;
+
+      hp:=tused_unit(usedunits.first);
+      found:=((current_module.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
+      If not found then
+        While Assigned(hp) and not found do
+          begin
+          Found:=((hp.u.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
+          hp:=tused_unit(hp.next);
+          end;
+      CheckResourcesUsed:=found;
+    end;
+
+    Procedure InsertResourceInfo(ResourcesUsed : boolean);
+
+    var
       I            : Integer;
       ResourceInfo : TAsmList;
 
     begin
-      if target_res.id=res_elf then
+      if (target_res.id in [res_elf,res_macho]) then
         begin
-        hp:=tused_unit(usedunits.first);
-        found:=false;
-        Found:=((current_module.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
-        If not found then
-          While Assigned(hp) and not Found do
-            begin
-            Found:=((hp.u.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
-            hp:=tused_unit(hp.next);
-            end;
         ResourceInfo:=TAsmList.Create;
-        if found then
-          begin
+        ResourceInfo.concat(Tai_symbol.Createname_global('FPC_RESLOCATION',AT_DATA,0));
+        if ResourcesUsed then
           { Valid pointer to resource information }
-          ResourceInfo.concat(Tai_symbol.Createname_global('FPC_RESLOCATION',AT_DATA,0));
-          ResourceInfo.concat(Tai_const.Createname('FPC_RESSYMBOL',0));
-{$ifdef EXTERNALRESPTRS}
-          current_module.linkotherofiles.add('resptrs.o',link_always);
-{$else EXTERNALRESPTRS}
-          new_section(ResourceInfo,sec_fpc,'resptrs',4);
-          ResourceInfo.concat(Tai_symbol.Createname_global('FPC_RESSYMBOL',AT_DATA,0));
-          For I:=1 to 32 do
-            ResourceInfo.Concat(Tai_const.Create_32bit(0));
-{$endif EXTERNALRESPTRS}
-          end
+          ResourceInfo.concat(Tai_const.Createname('FPC_RESSYMBOL',0))
         else
-          begin
           { Nil pointer to resource information }
-          ResourceInfo.concat(Tai_symbol.Createname_global('FPC_RESLOCATION',AT_DATA,0));
+          {$IFDEF CPU32}
           ResourceInfo.Concat(Tai_const.Create_32bit(0));
-          end;
+          {$ELSE}
+          ResourceInfo.Concat(Tai_const.Create_64bit(0));
+          {$ENDIF}
         maybe_new_object_file(current_asmdata.asmlists[al_globals]);
         current_asmdata.asmlists[al_globals].concatlist(ResourceInfo);
         ResourceInfo.free;
@@ -450,6 +449,58 @@ implementation
       end;
 
 
+    function MaybeRemoveResUnit : boolean;
+      var
+        resources_used : boolean;
+        hp : tmodule;
+        uu : tused_unit;
+        unitname : shortstring;
+      begin
+        { We simply remove the unit from:
+           - usedunit list, so that things like init/finalization table won't
+              contain references to this unit
+           - loaded_units list, so that the unit object file doesn't get linked
+             with the executable. }
+        { Note: on windows we always need resources! }
+        resources_used:=(target_info.system in system_all_windows)
+                         or CheckResourcesUsed;
+        if (not resources_used) and (tf_has_resources in target_info.flags) then
+          begin
+            { resources aren't used, so we don't need this unit }
+            if target_res.id=res_ext then
+              unitname:='FPEXTRES'
+            else
+              unitname:='FPINTRES';
+            Message1(unit_u_unload_resunit,unitname);
+            { find the module }
+            hp:=tmodule(loaded_units.first);
+            while assigned(hp) do
+              begin
+                if hp.is_unit and (hp.modulename^=unitname) then break;
+                hp:=tmodule(hp.next);
+              end;
+            if not assigned(hp) then
+              internalerror(200801071);
+            { find its tused_unit in the global list }
+            uu:=tused_unit(usedunits.first);
+            while assigned(uu) do
+              begin
+                if uu.u=hp then break;
+                uu:=tused_unit(uu.next);
+              end;
+            if not assigned(uu) then
+              internalerror(200801072);
+           { remove the tused_unit }
+            usedunits.Remove(uu);
+            uu.Free;
+           { remove the module }
+            loaded_units.Remove(hp);
+            unloaded_units.Concat(hp);
+          end;
+        MaybeRemoveResUnit:=resources_used;
+      end;
+
+
     procedure loaddefaultunits;
       begin
         { we are going to rebuild the symtablestack, clear it first }
@@ -507,6 +558,14 @@ implementation
              AddUnit('softfpu');
            }
 {$endif cpufpemu}
+           { Which kind of resource support?
+             Note: if resources aren't used this unit will be removed later,
+             otherwise we need it here since it must be loaded quite early }
+           if (tf_has_resources in target_info.flags) then
+             if target_res.id=res_ext then
+               AddUnit('fpextres')
+             else
+               AddUnit('fpintres');
          end;
         { Objpas unit? }
         if m_objpas in current_settings.modeswitches then
@@ -1769,6 +1828,7 @@ implementation
          init_procinfo,
          main_procinfo : tcgprocinfo;
          force_init_final : boolean;
+         resources_used : boolean;
       begin
          DLLsource:=islibrary;
          Status.IsLibrary:=IsLibrary;
@@ -1778,6 +1838,7 @@ implementation
          main_procinfo:=nil;
          init_procinfo:=nil;
          finalize_procinfo:=nil;
+         resources_used:=false;
 
          { DLL defaults to create reloc info }
          if islibrary then
@@ -1983,7 +2044,7 @@ implementation
              exit;
            end;
 
-         { remove all unused units, this happends when units are removed
+         { remove all unused units, this happens when units are removed
            from the uses clause in the source and the ppu was already being loaded }
          hp:=tmodule(loaded_units.first);
          while assigned(hp) do
@@ -1992,12 +2053,19 @@ implementation
             hp:=tmodule(hp.next);
             if hp2.is_unit and
                not assigned(hp2.globalsymtable) then
-              loaded_units.remove(hp2);
+                begin
+                  loaded_units.remove(hp2);
+                  unloaded_units.concat(hp2);
+                end;
           end;
 
          { do we need to add the variants unit? }
          maybeloadvariantsunit;
 
+         { Now that everything has been compiled we know if we need resource
+           support. If not, remove the unit. }
+         resources_used:=MaybeRemoveResUnit;
+
          linker.initsysinitunitname;
          if target_info.system in system_internal_sysinit then
          begin
@@ -2048,7 +2116,7 @@ implementation
          insertmemorysizes;
 
          { Insert symbol to resource info }
-         InsertResourceInfo;
+         InsertResourceInfo(resources_used);
 
          { create dwarf debuginfo }
          create_dwarf;
@@ -2101,6 +2169,9 @@ implementation
                       end;
                     hp:=hp2;
                   end;
+                 { free also unneeded units we didn't free before }
+                 if not needsymbolinfo then
+                   unloaded_units.Clear;
                  { finally we can create a executable }
                  if DLLSource then
                    linker.MakeSharedLibrary

+ 118 - 0
compiler/rescmn.pas

@@ -0,0 +1,118 @@
+{
+    Copyright (c) 2008 by Giulio Bernardi
+
+    Common resource target infos
+
+    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.
+
+ ****************************************************************************
+}
+
+unit rescmn;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  Systems;
+
+    const
+       res_elf_info : tresinfo =
+          (
+             id     : res_elf;
+             resbin : 'fpcres';
+             rescmd : '-o $OBJ -a $ARCH -of elf $DBG';
+             { cross compiled windres can be used to compile .rc files on linux }
+             rcbin  : 'windres';
+             rccmd  : '--include $INC -O res -o $RES $RC';
+             resourcefileclass : nil;
+             resflags : [];
+          );
+
+       res_ext_info : tresinfo =
+          (
+             id     : res_ext;
+             resbin : 'fpcres';
+             rescmd : '-o $OBJ -a $ENDIAN -of external $DBG';
+             rcbin  : 'windres';
+             rccmd  : '--include $INC -O res -o $RES $RC';
+             resourcefileclass : nil;
+             resflags : [res_external_file];
+          );
+
+
+implementation
+
+end.
+{
+    Copyright (c) 2008 by Giulio Bernardi
+
+    Common resource target infos
+
+    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.
+
+ ****************************************************************************
+}
+
+unit rescmn;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  Systems;
+
+    const
+       res_elf_info : tresinfo =
+          (
+             id     : res_elf;
+             resbin : 'fpcres';
+             rescmd : '-o $OBJ -a $ARCH -of elf $DBG';
+             { cross compiled windres can be used to compile .rc files on linux }
+             rcbin  : 'windres';
+             rccmd  : '--include $INC -O res -o $RES $RC';
+             resourcefileclass : nil;
+             resflags : [];
+          );
+
+       res_ext_info : tresinfo =
+          (
+             id     : res_ext;
+             resbin : 'fpcres';
+             rescmd : '-o $OBJ -a $ENDIAN -of external $DBG';
+             rcbin  : 'windres';
+             rccmd  : '--include $INC -O res -o $RES $RC';
+             resourcefileclass : nil;
+             resflags : [res_external_file];
+          );
+
+
+implementation
+
+end.

+ 12 - 11
compiler/systems.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2008 by Florian Klaempfl
 
     This unit contains information about the target systems supported
     (these are not processor specific)
@@ -183,9 +183,10 @@ interface
             ,res_gnu_windres,res_emxbind
             ,res_m68k_palmos,res_m68k_mpw
             ,res_powerpc_mpw,res_elf
-            ,res_gnu_wince_windres
-            ,res_win64_gorc
+            ,res_win64_gorc, res_macho, res_ext
        );
+       
+       tresinfoflags = (res_external_file,res_arch_in_file_name);
 
        tdbg = (dbg_none
             ,dbg_stabs,dbg_dwarf2,dbg_dwarf3
@@ -273,13 +274,14 @@ interface
        tresinfo = record
           id      : tres;
           { Compiler for resource (.rc or .res) to obj }
-          resbin  : string[8];
+          resbin  : string[10];
           rescmd  : string[50];
           { Optional compiler for resource script (.rc) to binary resource (.res). }
           { If it is not provided resbin and rescmd will be used.                 }
-          rcbin   : string[8];
+          rcbin   : string[10];
           rccmd   : string[50];
           resourcefileclass : TAbstractResourceFileClass;
+          resflags : set of tresinfoflags;
        end;
 
        pdbginfo = ^tdbginfo;
@@ -315,7 +317,8 @@ interface
             tf_no_pic_supported,
             tf_pic_default,
             { the os does some kind of stack checking and it can be converted into a rte 202 }
-            tf_no_generic_stackcheck
+            tf_no_generic_stackcheck,
+            tf_has_resources
        );
 
        psysteminfo = ^tsysteminfo;
@@ -336,8 +339,8 @@ interface
           unitlibext,
           asmext,
           objext,
-          resext,
-          resobjext    : string[4];
+          resext       : string[4];
+          resobjext    : string[7];
           sharedlibext : string[10];
           staticlibext,
           staticlibprefix : string[4];
@@ -696,9 +699,7 @@ var
   t : tres;
 begin
   t:=r.id;
-  if assigned(resinfos[t]) then
-    writeln('Warning: resourcecompiler is already registered!')
-  else
+  if not assigned(resinfos[t]) then
     Getmem(resinfos[t],sizeof(tresinfo));
   resinfos[t]^:=r;
   resinfos[t]^.resourcefileclass:=rcf;

+ 43 - 22
compiler/systems/i_bsd.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2008 by Peter Vreman
 
     This unit implements support information structures for FreeBSD/NetBSD
 
@@ -27,9 +27,30 @@ unit i_bsd;
   interface
 
     uses
-       systems;
+       systems, rescmn;
 
     const
+       res_macho_info : tresinfo =
+           (
+             id     : res_macho;
+             resbin : 'fpcres';
+             rescmd : '-o $OBJ -a $ARCH -of mach-o $DBG';
+             rcbin  : 'windres';
+             rccmd  : '--include $INC -O res -o $RES $RC';
+             resourcefileclass : nil;
+             resflags : [];
+           );
+       res_macosx_ext_info : tresinfo =
+          (
+             id     : res_ext;
+             resbin : 'fpcres';
+             rescmd : '-o $OBJ -a $ENDIAN -of external $DBG';
+             rcbin  : 'windres';
+             rccmd  : '--include $INC -O res -o $RES $RC';
+             resourcefileclass : nil;
+             resflags : [res_external_file,res_arch_in_file_name];
+          );
+
        system_i386_freebsd_info : tsysteminfo =
           (
             system       : system_i386_FreeBSD;
@@ -39,7 +60,7 @@ unit i_bsd;
             {$ifdef segment_threadvars}
                                         tf_section_threadvars,
             {$endif segment_threadvars}
-                           tf_needs_symbol_type,tf_needs_symbol_size,tf_smartlink_library {,tf_smartlink_sections}];
+                           tf_needs_symbol_type,tf_needs_symbol_size,tf_smartlink_library {,tf_smartlink_sections},tf_has_resources];
             cpu          : cpu_i386;
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -69,7 +90,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_little;
@@ -101,7 +122,7 @@ unit i_bsd;
             shortname    : 'FreeBSD';
             flags        : [tf_needs_symbol_size,tf_needs_dwarf_cfi,{Linux: tf_library_needs_pic,}tf_needs_symbol_type,
                             tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library
-                                {	tf_pic_uses_got,tf_smartlink_sections}];
+                                {	tf_pic_uses_got,tf_smartlink_sections},tf_has_resources];
             cpu          : cpu_x86_64;
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;HASUNIX;BSD';
@@ -131,7 +152,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_dwarf2;            //dbg_stabs;
             script       : script_unix;
             endian       : endian_little;
@@ -161,7 +182,7 @@ unit i_bsd;
             system       : system_i386_NetBSD;
             name         : 'NetBSD for i386';
             shortname    : 'NetBSD';
-            flags        : [tf_under_development,tf_files_case_sensitive,tf_smartlink_library,tf_use_function_relative_addresses];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_smartlink_library,tf_use_function_relative_addresses,tf_has_resources];
             cpu          : cpu_i386;
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -191,7 +212,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_little;
@@ -220,7 +241,7 @@ unit i_bsd;
             system       : system_i386_OpenBSD;
             name         : 'OpenBSD for i386';
             shortname    : 'OpenBSD';
-            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library,tf_has_resources];
             cpu          : cpu_i386;
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -250,7 +271,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_little;
@@ -279,7 +300,7 @@ unit i_bsd;
             system       : system_m68k_NetBSD;
             name         : 'NetBSD for m68k';
             shortname    : 'NetBSD';
-            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library,tf_has_resources];
             cpu          : cpu_m68k;
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -309,7 +330,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_big;
@@ -338,7 +359,7 @@ unit i_bsd;
             system       : system_powerpc_netbsd;
             name         : 'NetBSD for PowerPC';
             shortname    : 'NetBSD';
-            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library,tf_has_resources];
             cpu          : cpu_powerpc;
             unit_env     : '';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -368,7 +389,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_big;
@@ -399,7 +420,7 @@ unit i_bsd;
             system       : system_powerpc_darwin;
             name         : 'Darwin for PowerPC';
             shortname    : 'Darwin';
-            flags        : [tf_p_ext_support,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_default];
+            flags        : [tf_p_ext_support,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_default,tf_has_resources];
             cpu          : cpu_powerpc;
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -429,7 +450,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_macho;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_big;
@@ -460,7 +481,7 @@ unit i_bsd;
             system       : system_i386_darwin;
             name         : 'Darwin for i386';
             shortname    : 'Darwin';
-            flags        : [tf_p_ext_support,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_uses_got,tf_pic_default];
+            flags        : [tf_p_ext_support,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_uses_got,tf_pic_default,tf_has_resources];
             cpu          : cpu_i386;
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -490,7 +511,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_macho;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_little;
@@ -521,7 +542,7 @@ unit i_bsd;
             system       : system_powerpc64_darwin;
             name         : 'Darwin for PowerPC64';
             shortname    : 'Darwin';
-            flags        : [tf_p_ext_support,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_default];
+            flags        : [tf_p_ext_support,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_default,tf_has_resources];
             cpu          : cpu_powerpc64;
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -551,7 +572,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_macho;
             dbg          : dbg_dwarf2;
             script       : script_unix;
             endian       : endian_big;
@@ -582,7 +603,7 @@ unit i_bsd;
             system       : system_x86_64_darwin;
             name         : 'Darwin for x86_64';
             shortname    : 'Darwin';
-            flags        : [tf_p_ext_support,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_default];
+            flags        : [tf_p_ext_support,tf_files_case_sensitive,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_default,tf_has_resources];
             cpu          : cpu_x86_64;
             unit_env     : 'BSDUNITS';
             extradefines : 'UNIX;BSD;HASUNIX';
@@ -612,7 +633,7 @@ unit i_bsd;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_macho;
             dbg          : dbg_dwarf2;
             script       : script_unix;
             endian       : endian_little;

+ 21 - 43
compiler/systems/i_linux.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2008 by Peter Vreman
 
     This unit implements support information structures for linux
 
@@ -24,31 +24,9 @@ unit i_linux;
   interface
 
     uses
-       systems;
+       systems, rescmn;
 
     const
-       res_elf32_info : tresinfo =
-          (
-             id     : res_elf;
-             resbin : 'fpcres';
-             rescmd : '-o $OBJ -i $RES';
-             { cross compiled windres can be used to compile .rc files on linux }
-             rcbin  : 'windres';
-             rccmd  : '--include $INC -O res -o $RES $RC';
-             resourcefileclass : nil;
-          );
-
-       res_elf64_info : tresinfo =
-          (
-             id     : res_elf;
-             resbin : 'fpcres';
-             rescmd : '-o $OBJ -i $RES';
-             { cross compiled windres can be used to compile .rc files on linux }
-             rcbin  : 'windres';
-             rccmd  : '--include $INC -O res -o $RES $RC';
-             resourcefileclass : nil;
-          );
-
        system_i386_linux_info : tsysteminfo =
           (
             system       : system_i386_LINUX;
@@ -59,7 +37,7 @@ unit i_linux;
                             tf_section_threadvars,
 {$endif segment_threadvars}
                             tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,
-                            tf_smartlink_library,tf_needs_dwarf_cfi];
+                            tf_smartlink_library,tf_needs_dwarf_cfi,tf_has_resources];
             cpu          : cpu_i386;
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
@@ -118,7 +96,7 @@ unit i_linux;
             system       : system_x86_6432_LINUX;
             name         : 'Linux for x64_6432';
             shortname    : 'Linux6432';
-            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_pic_uses_got{,tf_smartlink_sections},tf_smartlink_library];
+            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_pic_uses_got{,tf_smartlink_sections},tf_smartlink_library,tf_has_resources];
             cpu          : cpu_x86_64;
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
@@ -148,7 +126,7 @@ unit i_linux;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_little;
@@ -178,7 +156,7 @@ unit i_linux;
             name         : 'Linux for m68k';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,
-                            tf_smartlink_library];
+                            tf_smartlink_library,tf_has_resources];
             cpu          : cpu_m68k;
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
@@ -208,7 +186,7 @@ unit i_linux;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_big;
@@ -238,7 +216,7 @@ unit i_linux;
             name         : 'Linux for PowerPC';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,
-                            tf_smartlink_library];
+                            tf_smartlink_library,tf_has_resources];
             cpu          : cpu_powerpc;
             unit_env     : '';
             extradefines : 'UNIX;HASUNIX';
@@ -268,7 +246,7 @@ unit i_linux;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_big;
@@ -298,7 +276,7 @@ unit i_linux;
             name         : 'Linux for PowerPC64';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,
-                            tf_requires_proper_alignment,tf_smartlink_library];
+                            tf_requires_proper_alignment,tf_smartlink_library,tf_has_resources];
             cpu          : cpu_powerpc64;
             unit_env     : '';
             extradefines : 'UNIX;HASUNIX';
@@ -328,7 +306,7 @@ unit i_linux;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_dwarf2;
             script       : script_unix;
             endian       : endian_big;
@@ -358,7 +336,7 @@ unit i_linux;
             name         : 'Linux for Alpha';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
-                            tf_use_function_relative_addresses,tf_smartlink_library];
+                            tf_use_function_relative_addresses,tf_smartlink_library,tf_has_resources];
             cpu          : cpu_alpha;
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
@@ -388,7 +366,7 @@ unit i_linux;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_little;
@@ -418,7 +396,7 @@ unit i_linux;
             name         : 'Linux for x86-64';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_dwarf_cfi,tf_smartlink_library,
-                            tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
+                            tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_has_resources];
             cpu          : cpu_x86_64;
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
@@ -448,7 +426,7 @@ unit i_linux;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_dwarf2;
             script       : script_unix;
             endian       : endian_little;
@@ -478,7 +456,7 @@ unit i_linux;
             name         : 'Linux for SPARC';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_smartlink_library,
-                            tf_use_function_relative_addresses,tf_requires_proper_alignment];
+                            tf_use_function_relative_addresses,tf_requires_proper_alignment,tf_has_resources];
             cpu          : cpu_SPARC;
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
@@ -508,7 +486,7 @@ unit i_linux;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_big;
@@ -539,7 +517,7 @@ unit i_linux;
             name         : 'Linux for ARMEL';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
-                            tf_use_function_relative_addresses,tf_requires_proper_alignment,tf_smartlink_sections,tf_smartlink_library];
+                            tf_use_function_relative_addresses,tf_requires_proper_alignment,tf_smartlink_sections,tf_smartlink_library,tf_has_resources];
             cpu          : cpu_arm;
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
@@ -569,7 +547,7 @@ unit i_linux;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_little;
@@ -599,7 +577,7 @@ unit i_linux;
             name         : 'Linux for ARM';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
-                            tf_use_function_relative_addresses,tf_requires_proper_alignment,tf_smartlink_sections,tf_smartlink_library];
+                            tf_use_function_relative_addresses,tf_requires_proper_alignment,tf_smartlink_sections,tf_smartlink_library,tf_has_resources];
             cpu          : cpu_arm;
             unit_env     : 'LINUXUNITS';
             extradefines : 'UNIX;HASUNIX';
@@ -629,7 +607,7 @@ unit i_linux;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_little;

+ 5 - 5
compiler/systems/i_sunos.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2008 by Peter Vreman
 
     This unit implements support information structures for solaris
 
@@ -32,7 +32,7 @@ unit i_sunos;
             system       : system_i386_solaris;
             name         : 'Solaris for i386';
             shortname    : 'solaris';
-            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library];
+            flags        : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_smartlink_library,tf_has_resources];
             cpu          : cpu_i386;
             unit_env     : 'SOLARISUNITS';
             extradefines : 'UNIX;LIBC;SUNOS;HASUNIX';
@@ -62,7 +62,7 @@ unit i_sunos;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_gar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_little;
@@ -92,7 +92,7 @@ unit i_sunos;
             name         : 'Solaris for SPARC';
             shortname    : 'solaris';
             flags        : [tf_needs_symbol_size,tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,
-                            tf_requires_proper_alignment,tf_smartlink_library];
+                            tf_requires_proper_alignment,tf_smartlink_library,tf_has_resources];
             cpu          : cpu_SPARC;
             unit_env     : 'SOLARISUNITS';
             extradefines : 'UNIX;LIBC;SUNOS;HASUNIX';
@@ -122,7 +122,7 @@ unit i_sunos;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_gar;
-            res          : res_none;
+            res          : res_elf;
             dbg          : dbg_stabs;
             script       : script_unix;
             endian       : endian_big;

+ 8 - 6
compiler/systems/i_win.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2008 by Peter Vreman
 
     This unit implements support information structures for win32
 
@@ -35,7 +35,7 @@ unit i_win;
             flags        : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses,tf_smartlink_library
                             ,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},
                             tf_winlikewidestring,tf_no_pic_supported,
-                            tf_no_generic_stackcheck];
+                            tf_no_generic_stackcheck,tf_has_resources];
             cpu          : cpu_i386;
             unit_env     : 'WIN32UNITS';
             extradefines : 'MSWINDOWS;WINDOWS';
@@ -96,7 +96,7 @@ unit i_win;
             shortname    : 'Win64';
             flags        : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses,
                             tf_smartlink_sections,tf_smartlink_library,tf_winlikewidestring,tf_no_pic_supported,
-                            tf_no_generic_stackcheck];
+                            tf_no_generic_stackcheck,tf_has_resources];
             cpu          : cpu_x86_64;
             unit_env     : 'WIN64UNITS';
             extradefines : 'MSWINDOWS;WINDOWS';
@@ -156,7 +156,8 @@ unit i_win;
             name         : 'WinCE for ARM';
             shortname    : 'WinCE';
             flags        : [tf_files_case_aware,tf_use_function_relative_addresses{,tf_winlikewidestring},
-                            tf_smartlink_sections,tf_requires_proper_alignment,tf_no_pic_supported];
+                            tf_smartlink_sections,tf_requires_proper_alignment,tf_no_pic_supported,
+                            tf_has_resources];
             cpu          : cpu_arm;
             unit_env     : '';
             extradefines : 'UNDER_CE;WINDOWS;UNICODE';
@@ -186,7 +187,7 @@ unit i_win;
             link         : nil;
             linkextern   : nil;
             ar           : ar_gnu_ar_scripted;
-            res          : res_gnu_wince_windres;
+            res          : res_gnu_windres;
             dbg          : dbg_stabs;
             script       : script_dos;
             endian       : endian_little;
@@ -216,7 +217,8 @@ unit i_win;
             name         : 'WinCE for i386';
             shortname    : 'WinCE';
             flags        : [tf_files_case_aware,tf_use_function_relative_addresses
-                            {,tf_winlikewidestring},tf_smartlink_sections,tf_no_pic_supported];
+                            {,tf_winlikewidestring},tf_smartlink_sections,tf_no_pic_supported,
+                            tf_has_resources];
             cpu          : cpu_i386;
             unit_env     : '';
             extradefines : 'UNDER_CE;WINDOWS;UNICODE';

+ 4 - 1
compiler/systems/t_bsd.pas

@@ -36,7 +36,7 @@ implementation
     verbose,systems,globtype,globals,
     symconst,script,
     fmodule,aasmbase,aasmtai,aasmdata,aasmcpu,cpubase,symsym,symdef,
-    import,export,link,i_bsd,
+    import,export,link,comprsrc,rescmn,i_bsd,
     cgutils,cgbase,cgobj,cpuinfo,ogbase;
 
   type
@@ -780,4 +780,7 @@ initialization
   RegisterExport(system_powerpc64_darwin,texportlibbsd);
   RegisterTarget(system_powerpc64_darwin_info);
 {$endif powerpc64}
+
+  RegisterRes(res_elf_info,TWinLikeResourceFile);
+  RegisterRes(res_macho_info,TWinLikeResourceFile);
 end.

+ 3 - 24
compiler/systems/t_linux.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2008 by Peter Vreman
 
     This unit implements support import,export,link routines
     for the (i386) Linux target
@@ -57,7 +57,6 @@ interface
       procedure InitSysInitUnitName;override;
       function  MakeExecutable:boolean;override;
       function  MakeSharedLibrary:boolean;override;
-      function  postprocessexecutable(const fn : string;isdll:boolean):boolean;
       procedure LoadPredefinedLibraryOrder; override;
     end;
 
@@ -73,7 +72,7 @@ implementation
     aasmbase,aasmtai,aasmdata,aasmcpu,cpubase,
     cgbase,cgobj,cgutils,ogbase,ncgutil,
     comprsrc,
-    i_linux
+    rescmn, i_linux
     ;
 
 {*****************************************************************************
@@ -1063,10 +1062,6 @@ begin
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
    DeleteFile(outputexedir+Info.ResName);
 
-  if (success) then
-    success:=PostProcessExecutable(current_module.exefilename^,false);
-
-
   MakeExecutable:=success;   { otherwise a recursive call to link method }
 end;
 
@@ -1119,21 +1114,6 @@ begin
   MakeSharedLibrary:=success;   { otherwise a recursive call to link method }
 end;
 
-
-function tlinkerLinux.postprocessexecutable(const fn : string;isdll:boolean):boolean;
-var
-  cmdstr: string;
-begin
-  result:=True;
-  if HasResources and
-     (target_res.id=res_elf) then
-    begin
-      cmdstr:=' -f -i '+maybequoted(fn);
-      result:=DoExec(FindUtil(utilsprefix+'fpcres'),cmdstr,false,false);
-    end;
-end;
-
-
 {*****************************************************************************
                                   Initialize
 *****************************************************************************}
@@ -1144,7 +1124,6 @@ initialization
   RegisterImport(system_i386_linux,timportliblinux);
   RegisterExport(system_i386_linux,texportliblinux);
   RegisterTarget(system_i386_linux_info);
-  RegisterRes(res_elf32_info,TWinLikeResourceFile);
 
   RegisterExternalLinker(system_x86_6432_linux_info,TLinkerLinux);
   RegisterImport(system_x86_6432_linux,timportliblinux);
@@ -1180,7 +1159,6 @@ initialization
   RegisterImport(system_x86_64_linux,timportliblinux);
   RegisterExport(system_x86_64_linux,texportliblinux);
   RegisterTarget(system_x86_64_linux_info);
-  RegisterRes(res_elf64_info,TWinLikeResourceFile);
 {$endif x86_64}
 {$ifdef SPARC}
   RegisterExternalLinker(system_sparc_linux_info,TLinkerLinux);
@@ -1194,4 +1172,5 @@ initialization
   RegisterExport(system_arm_linux,texportliblinux);
   RegisterTarget(system_arm_linux_info);
 {$endif ARM}
+  RegisterRes(res_elf_info,TWinLikeResourceFile);
 end.

+ 4 - 2
compiler/systems/t_sunos.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2008 by Peter Vreman
 
     This unit implements support import,export,link routines
     for the (i386) solaris target
@@ -40,7 +40,7 @@ implementation
     symconst,script,
     fmodule,aasmbase,aasmtai,aasmdata,aasmcpu,cpubase,symsym,symdef,
     cgobj,
-    import,export,link,i_sunos,ogbase;
+    import,export,link,comprsrc,rescmn,i_sunos,ogbase;
 
   type
     timportlibsolaris=class(timportlib)
@@ -470,4 +470,6 @@ initialization
   RegisterExport(system_sparc_solaris,TExportLibsolaris);
   RegisterTarget(system_sparc_solaris_info);
 {$endif sparc}
+
+  RegisterRes(res_elf_info,TWinLikeResourceFile);
 end.

+ 10 - 47
compiler/systems/t_win.pas

@@ -1,5 +1,5 @@
 {
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2008 by Peter Vreman
 
     This unit implements support import,export,link routines
     for the (i386) Win32 target
@@ -90,12 +90,6 @@ interface
         function Scan(const binname:string):boolean;override;
       end;
 
-
-      TWinResourceFile = class(TWinLikeResourceFile)
-        procedure PostProcessResourcefile(const s : ansistring);override;
-      end;
-
-
 implementation
 
   uses
@@ -109,32 +103,23 @@ implementation
     res_gnu_windres_info : tresinfo =
         (
           id     : res_gnu_windres;
-          resbin : 'windres';
-          rescmd : '--include $INC -O coff -o $OBJ $RES';
+          resbin : 'fpcres';
+          rescmd : '-o $OBJ -a $ARCH -of coff $DBG';
           rcbin  : 'windres';
           rccmd  : '--include $INC -O res -o $RES $RC';
           resourcefileclass : nil;
+          resflags : [];
         );
-
-    res_gnu_wince_windres_info : tresinfo =
-        (
-          id     : res_gnu_wince_windres;
-          resbin : 'windres';
-          rescmd : '--include $INC -O coff -o $OBJ $RES';
-          rcbin  : 'windres';
-          rccmd  : '--include $INC -O res -o $RES $RC';
-          resourcefileclass : nil;
-        );
-
 {$ifdef x86_64}
     res_win64_gorc_info : tresinfo =
         (
           id     : res_win64_gorc;
-          resbin : 'gorc';
-          rescmd : '/machine x64 /nw /ni /o /fo $OBJ $RES';
+          resbin : 'fpcres';
+          rescmd : '-o $OBJ -a $ARCH -of coff $DBG';
           rcbin  : 'gorc';
           rccmd  : '/machine x64 /nw /ni /r /fo $RES $RC';
           resourcefileclass : nil;
+          resflags : [];
         );
 {$endif x86_64}
 
@@ -1757,28 +1742,6 @@ implementation
         result:=importfound;
       end;
 
-
-{****************************************************************************
-                            TWinResourceFile
-****************************************************************************}
-
-procedure TWinResourceFile.PostProcessResourcefile(const s : ansistring);
-{$ifdef arm}
-var
-  f : file;
-  w : word;
-{$endif arm}
-begin
-{$ifdef arm}
-  assign(f,s);
-  reset(f,1);
-  w:=COFF_MAGIC;
-  blockwrite(f,w,2);
-  close(f);
-{$endif arm}
-end;
-
-
 {*****************************************************************************
                                      Initialize
 *****************************************************************************}
@@ -1791,7 +1754,7 @@ initialization
   RegisterImport(system_i386_win32,TImportLibWin);
   RegisterExport(system_i386_win32,TExportLibWin);
   RegisterDLLScanner(system_i386_win32,TDLLScannerWin);
-  RegisterRes(res_gnu_windres_info,TWinResourceFile);
+  RegisterRes(res_gnu_windres_info,TWinLikeResourceFile);
   RegisterTarget(system_i386_win32_info);
   { WinCE }
   RegisterExternalLinker(system_i386_wince_info,TExternalLinkerWin);
@@ -1806,7 +1769,7 @@ initialization
   RegisterImport(system_x86_64_win64,TImportLibWin);
   RegisterExport(system_x86_64_win64,TExportLibWin);
   RegisterDLLScanner(system_x86_64_win64,TDLLScannerWin);
-  RegisterRes(res_win64_gorc_info,TWinResourceFile);
+  RegisterRes(res_win64_gorc_info,TWinLikeResourceFile);
   RegisterTarget(system_x64_win64_info);
 {$endif x86_64}
 {$ifdef arm}
@@ -1814,7 +1777,7 @@ initialization
   RegisterInternalLinker(system_arm_wince_info,TInternalLinkerWin);
   RegisterImport(system_arm_wince,TImportLibWin);
   RegisterExport(system_arm_wince,TExportLibWin);
-  RegisterRes(res_gnu_wince_windres_info,TWinResourceFile);
+  RegisterRes(res_gnu_windres_info,TWinLikeResourceFile);
   RegisterTarget(system_arm_wince_info);
 {$endif arm}
 end.

+ 1 - 1
rtl/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 1 - 1
rtl/amiga/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 1 - 1
rtl/beos/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 54 - 54
rtl/darwin/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/12]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -273,163 +273,163 @@ ifndef USELIBGGI
 USELIBGGI=NO
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixutil unix initc cmem matrix dynlibs $(CPU_UNITS) dos dl objects printer sockets sysutils typinfo fgl classes math varutils types charset ucomplex getopts heaptrc lineinfo lnfodwrf errors terminfo termio video crt mouse keyboard console variants dateutils convutils stdconvs sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd fpintres fpextres
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst rtlconsts

+ 2 - 1
rtl/darwin/Makefile.fpc

@@ -15,7 +15,8 @@ units=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings sysctl baseunix unixut
       charset ucomplex getopts heaptrc lineinfo lnfodwrf \
       errors terminfo termio video crt mouse keyboard console \
       variants dateutils convutils stdconvs \
-      sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd
+      sysconst cthreads strutils rtlconsts cwstring bsd fmtbcd \
+      fpintres fpextres
 
 rsts=math varutils typinfo classes variants dateutils sysconst rtlconsts
 

+ 1382 - 0
rtl/darwin/extres_multiarch.inc

@@ -0,0 +1,1382 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
+
+    Resource support as external files, for Mac OS X
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+{
+  This file is similar to extres.inc when EXTRES_MMAP is defined.
+  However, two files are searched (an architecture-dependent one and a shared
+  one). They are searched first in Contents/Resources directory of the program
+  application bundle and then in the same directory of the program.
+}
+
+const
+  FPCRES_MAGIC = 'FPCRES';
+  FPCRES_VERSION = 1;
+  {$IFDEF ENDIAN_BIG}
+  FPCRES_ENDIAN = 1;
+  {$ENDIF}
+  {$IFDEF ENDIAN_LITTLE}
+  FPCRES_ENDIAN = 2;
+  {$ENDIF}
+  FPCRES_EXT = '.fpcres';
+  FPCRES_ARCH =
+    {$IFDEF CPUI386}
+    '.i386';
+    {$ELSE}
+      {$IFDEF CPUX86_64}
+      '.x86_64';
+      {$ELSE}
+        {$IFDEF CPUPOWERPC32}
+        '.powerpc';
+        {$ELSE}
+          {$IFDEF CPUPOWERPC64}
+          '.powerpc64';
+          {$ELSE}
+          '';
+          {$ENDIF}
+        {$ENDIF}
+      {$ENDIF}
+    {$ENDIF}
+
+type
+  TExtHeader = packed record
+    magic : array[0..5] of char;//'FPCRES'
+    version : byte;             //EXT_CURRENT_VERSION
+    endianess : byte;           //EXT_ENDIAN_BIG or EXT_ENDIAN_LITTLE
+    count : longword;           //resource count
+    nodesize : longword;        //size of header (up to string table, excluded)
+    hdrsize  : longword;        //size of header (up to string table, included)
+    reserved1 : longword;
+    reserved2 : longword;
+    reserved3 : longword;
+  end;
+  PExtHeader = ^TExtHeader;
+
+  TResInfoNode = packed record
+    nameid : longword;          //name offset / integer ID / languageID
+    ncounthandle : longword;    //named sub-entries count/resource handle
+    idcountsize : longword;     //id sub-entries count / resource size
+    subptr : longword;          //first sub-entry offset
+  end;
+  PResInfoNode = ^TResInfoNode;
+
+  TResFileInfo = record
+    ResHeader : PExtHeader;
+    fd : integer;
+    size : longword;
+  end;
+
+var
+  ResFileInfo     : TResFileInfo = (ResHeader : nil; fd : 0; size : 0);
+  ResFileInfoArch : TResFileInfo = (ResHeader : nil; fd : 0; size : 0);
+  reshandles : PPointer = nil;
+  usedhandles : longword = 0;
+  rescount : longword = 0;
+
+(*****************************************************************************
+                             Private Helper Functions
+*****************************************************************************)
+
+//resource functions are case insensitive... copied from genstr.inc
+function ResStrIComp(Str1, Str2 : PChar): SizeInt;
+var
+  counter: SizeInt;
+  c1, c2: char;
+begin
+  counter := 0;
+  c1 := upcase(str1[counter]);
+  c2 := upcase(str2[counter]);
+  while c1 = c2 do
+  begin
+    if (c1 = #0) or (c2 = #0) then break;
+    inc(counter);
+    c1 := upcase(str1[counter]);
+    c2 := upcase(str2[counter]);
+  end;
+  ResStrIComp := ord(c1) - ord(c2);
+end;
+
+{!fixme!}
+//function InternalIsIntResource(aStr : pchar; out aInt : PtrUint) : boolean;
+function InternalIsIntResource(aStr : pchar; var aInt : PtrUint) : boolean;
+var i : integer;
+    s : shortstring;
+    code : word;
+begin
+  InternalIsIntResource:=((PtrUInt(aStr) shr 16)=0);
+  if InternalIsIntResource then aInt:=PtrUInt(aStr)
+  else
+  begin
+    //a string like #number specifies an integer id
+    if aStr[0]='#' then
+    begin
+      i:=1;
+      while aStr[i]<>#0 do
+        inc(i);
+      if i>256 then i:=256;
+      s[0]:=chr(i-1);
+      Move(aStr[1],s[1],i-1);
+      Val(s,aInt,code);
+      InternalIsIntResource:=code=0;
+    end;
+  end;
+end;
+
+function GetResInfoPtr(base : PExtHeader; const offset : longword) : PResInfoNode; inline;
+begin
+  GetResInfoPtr:=PResInfoNode(PtrUInt(base)+offset);
+end;
+
+function GetPchar(base : PExtHeader; const offset : longword) : Pchar; inline;
+begin
+  GetPchar:=Pchar(PtrUInt(base)+offset);
+end;
+
+function GetPtr(base : PExtHeader; const offset : longword) : Pointer; inline;
+begin
+  GetPtr:=Pointer(PtrUInt(base)+offset);
+end;
+
+procedure FixResEndian(ResHeader : PExtHeader);
+var ptr : plongword;
+    blockend : plongword;
+begin
+  //all info nodes reside in a contiguos block of memory.
+  //they are all 16 bytes long and made by longwords
+  //so, simply swap each longword in the block
+  ptr:=GetPtr(ResHeader,sizeof(TExtHeader));
+  blockend:=GetPtr(ResHeader,ResHeader^.nodesize);
+  while ptr<blockend do
+  begin
+    ptr^:=SwapEndian(ptr^);
+    inc(ptr);
+  end;
+end;
+
+function GetExtResBasePath : shortstring;
+var exename : shortstring;
+    len, i, extpos, namepos: integer;
+begin
+  GetExtResBasePath:=paramstr(0);
+  len:=byte(GetExtResBasePath[0]);
+  i:=len;
+//  writeln('exe name is ',GetExtResBasePath);
+  //find position of extension
+  while (i>0) and (not (GetExtResBasePath[i] in ['.',DirectorySeparator])) do
+    dec(i);
+  //find position of last directory separator
+  if (i>0) and (GetExtResBasePath[i]='.') then extpos:=i-1
+  else extpos:=len;
+  while (i>0) and (GetExtResBasePath[i] <> DirectorySeparator) do
+    dec(i);
+  namepos:=i;
+  exename:=copy(GetExtResBasePath,i+1,extpos-i);
+  dec(i);
+  //is executable in 'MacOS' directory? find previous dir separator...
+  while (i>0) and (GetExtResBasePath[i] <> DirectorySeparator) do
+    dec(i);
+  if i<0 then i:=0;
+  //yes, search file in <bundle>/Contents/Resources directory
+  if (namepos>i) and (copy(GetExtResBasePath,i+1,namepos-i-1)='MacOS') then
+  begin
+    GetExtResBasePath[0]:=Chr(i);
+    GetExtResBasePath:=GetExtResBasePath+'Resources'+DirectorySeparator+exename;
+  end
+  else //no, search file in exe directory
+    GetExtResBasePath[0]:=Chr(extpos);
+//  writeln('base path is ',GetExtResBasePath);
+end;
+
+function GetExtResPathArch(const base : shortstring) : pchar;
+var len : integer;
+begin
+  len:=byte(base[0]);
+  GetExtResPathArch:=GetMem(len+length(FPCRES_ARCH)+length(FPCRES_EXT)+1);
+  Move(base[1],GetExtResPathArch[0],len);
+  Move(FPCRES_ARCH[1],GetExtResPathArch[len],length(FPCRES_ARCH));
+  inc(len,length(FPCRES_ARCH));
+  Move(FPCRES_EXT[1],GetExtResPathArch[len],length(FPCRES_EXT));
+  inc(len,length(FPCRES_EXT));
+  GetExtResPathArch[len]:=#0;
+//  writeln('Arch-dependent resource file is ',GetExtResPathArch);
+end;
+
+function GetExtResPath(const base : shortstring) : pchar;
+var len : integer;
+begin
+  len:=byte(base[0]);
+  GetExtResPath:=GetMem(len+length(FPCRES_EXT)+1);
+  Move(base[1],GetExtResPath[0],len);
+  Move(FPCRES_EXT[1],GetExtResPath[len],length(FPCRES_EXT));
+  inc(len,length(FPCRES_EXT));
+  GetExtResPath[len]:=#0;
+//  writeln('Shared resource file is ',GetExtResPath);
+end;
+
+procedure MapResFile(var aInfo : TResFileInfo; aName : pchar);
+const
+  PROT_READ  = 1;
+  PROT_WRITE = 2;
+var fdstat : stat;
+begin
+  aInfo.fd:=FpOpen(aName,O_RDONLY,0);
+  FreeMem(aName);
+//  writeln('fpopen returned ',aInfo.fd);
+  if (aInfo.fd=-1) then exit;
+  if FpFStat(aInfo.fd,fdstat)<>0 then
+  begin
+//    writeln('fpfstat failed');
+    FpClose(aInfo.fd);
+    exit;
+  end;
+//  writeln('fpfstat suceeded');
+  aInfo.size:=fdstat.st_size;
+  aInfo.ResHeader:=PExtHeader(Fpmmap(nil,aInfo.size,PROT_READ or PROT_WRITE,
+    MAP_PRIVATE,aInfo.fd,0));
+//  writeln('fpmmap returned ',PtrInt(aInfo.ResHeader));
+  if PtrInt(aInfo.ResHeader)=-1 then
+  begin
+    FpClose(aInfo.fd);
+    exit;
+  end;
+  if (aInfo.ResHeader^.magic<>FPCRES_MAGIC) or
+    (aInfo.ResHeader^.version<>FPCRES_VERSION) then
+  begin
+    FpClose(aInfo.fd);
+    exit;
+  end;
+//  writeln('magic ok');
+  if aInfo.ResHeader^.endianess<>FPCRES_ENDIAN then
+  begin
+    aInfo.ResHeader^.count:=SwapEndian(aInfo.ResHeader^.count);
+    aInfo.ResHeader^.nodesize:=SwapEndian(aInfo.ResHeader^.nodesize);
+    aInfo.ResHeader^.hdrsize:=SwapEndian(aInfo.ResHeader^.hdrsize);
+    FixResEndian(aInfo.ResHeader);
+  end;
+  inc(rescount,aInfo.ResHeader^.count);
+end;
+
+procedure InitResources;
+var respathArch : pchar;
+    respath : pchar;
+    basepath : shortstring;
+begin
+  basepath:=GetExtResBasePath;
+  respathArch:=GetExtResPathArch(basepath);
+  respath:=GetExtResPath(basepath);
+  MapResFile(ResFileInfoArch,respathArch);
+  MapResFile(ResFileInfo,respath);
+
+  if rescount=0 then exit;
+  reshandles:=GetMem(sizeof(Pointer)*rescount);
+  FillByte(reshandles^,sizeof(Pointer)*rescount,0);
+end;
+
+procedure FinalizeResources;
+begin
+  if (ResFileInfoArch.Resheader=nil) and (ResFileInfo.Resheader=nil) then exit;
+  FreeMem(reshandles);
+  if ResFileInfoArch.Resheader<>nil then
+  begin
+    Fpmunmap(ResFileInfoArch.ResHeader,ResFileInfoArch.size);
+    FpClose(ResFileInfoArch.fd);
+  end;
+  if ResFileInfo.Resheader<>nil then
+  begin
+    Fpmunmap(ResFileInfo.ResHeader,ResFileInfo.size);
+    FpClose(ResFileInfo.fd);
+  end;
+end;
+
+function BinSearchStr(base : PExtHeader; arr : PResInfoNode; query : pchar;
+  left, right : integer) : PResInfoNode;
+var pivot, res : integer;
+    resstr : pchar;
+begin
+  BinSearchStr:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    resstr:=GetPchar(base,arr[pivot].nameid);
+    res:=ResStrIComp(resstr,query);
+    if res<0 then left:=pivot+1
+    else if res>0 then right:=pivot-1
+    else
+    begin
+      BinSearchStr:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchInt(arr : PResInfoNode; query : pchar; left, right : integer)
+: PResInfoNode;
+var pivot : integer;
+begin
+  BinSearchInt:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    if arr[pivot].nameid<PtrUInt(query) then left:=pivot+1
+    else if arr[pivot].nameid>PtrUInt(query) then right:=pivot-1
+    else
+    begin
+      BinSearchInt:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchRes(base : PExtHeader; root : PResInfoNode; aDesc : PChar)
+: PResInfoNode;
+var aID : PtrUint;
+begin
+  if InternalIsIntResource(aDesc,aID) then
+    BinSearchRes:=BinSearchInt(GetResInfoPtr(base,root^.subptr),PChar(aID),
+      root^.ncounthandle,root^.ncounthandle+root^.idcountsize-1)
+  else
+    BinSearchRes:=BinSearchStr(base,GetResInfoPtr(base,root^.subptr),aDesc,0,
+      root^.ncounthandle-1);
+end;
+
+function FindSubLanguage(base : PExtHeader; aPtr : PResInfoNode; aLangID : word;
+  aMask: word) : PResInfoNode;
+var arr : PResInfoNode;
+    i : longword;
+begin
+  FindSubLanguage:=nil;
+  arr:=GetResInfoPtr(base,aPtr^.subptr);
+  i:=0;
+  while i<aPtr^.idcountsize do
+  begin
+    if (PtrUInt(arr[i].nameid) and aMask)=(aLangID and aMask) then
+    begin
+      FindSubLanguage:=@arr[i];
+      exit;
+    end;
+    inc(i);
+  end;
+end;
+
+//Returns a pointer to a name node.
+function InternalFindResource(base : PExtHeader; ResourceName, ResourceType: PChar):
+ PResInfoNode;
+begin
+  InternalFindResource:=nil;
+  if base=nil then exit;
+  InternalFindResource:=GetResInfoPtr(base,sizeof(TExtHeader));
+
+  InternalFindResource:=BinSearchRes(base,InternalFindResource,ResourceType);
+  if InternalFindResource<>nil then
+    InternalFindResource:=BinSearchRes(base,InternalFindResource,ResourceName);
+end;
+
+function FindResourceSingleFile(ResHeader : PExtHeader; ResourceName,
+  ResourceType: PChar) : TFPResourceHandle;
+var ptr : PResInfoNode;
+begin
+  FindResourceSingleFile:=0;
+  ptr:=InternalFindResource(ResHeader,ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  //first language id
+  ptr:=GetResInfoPtr(ResHeader,ptr^.subptr);
+  if ptr^.ncounthandle=0 then
+  begin
+    reshandles[usedhandles]:=ptr;
+    inc(usedhandles);
+    ptr^.ncounthandle:=usedhandles;
+  end;
+  FindResourceSingleFile:=ptr^.ncounthandle;
+end;
+
+{!fixme!}
+//function FindResourceExSingleFile(ResHeader : PExtHeader; ResourceType,
+//  ResourceName: PChar;  Language : word; out precision : integer): TFPResourceHandle;
+function FindResourceExSingleFile(ResHeader : PExtHeader; ResourceType,
+  ResourceName: PChar;  Language : word; var precision : integer): TFPResourceHandle;
+const LANG_NEUTRAL = 0;
+      LANG_ENGLISH = 9;
+var nameptr,ptr : PResInfoNode;
+begin
+  FindResourceExSingleFile:=0;
+  precision:=-1;
+  nameptr:=InternalFindResource(ResHeader,ResourceName,ResourceType);
+  if nameptr=nil then exit;
+
+  precision:=4;
+  //try exact match
+  ptr:=FindSubLanguage(ResHeader,nameptr,Language,$FFFF);
+  //try primary language
+  if ptr=nil then
+  begin
+    dec(precision);
+    ptr:=FindSubLanguage(ResHeader,nameptr,Language,$3FF);
+  end;
+  //try language neutral
+  if ptr=nil then
+  begin
+    dec(precision);
+    ptr:=FindSubLanguage(ResHeader,nameptr,LANG_NEUTRAL,$3FF);
+  end;
+  //try english
+  if ptr=nil then
+  begin
+    dec(precision);
+    ptr:=FindSubLanguage(ResHeader,nameptr,LANG_ENGLISH,$3FF);
+  end;
+  //nothing found, return the first one
+  if ptr=nil then
+  begin
+    dec(precision);
+    ptr:=GetResInfoPtr(ResHeader,nameptr^.subptr);
+  end;
+
+  if ptr^.ncounthandle=0 then
+  begin
+    reshandles[usedhandles]:=ptr;
+    inc(usedhandles);
+    ptr^.ncounthandle:=usedhandles;
+  end;
+  FindResourceExSingleFile:=ptr^.ncounthandle;
+end;
+
+function EnumResourceTypesSingleFile(ResHeader,Other : PExtHeader; ModuleHandle
+ : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+var ptr,otarr : PResInfoNode;
+    totn, totid, ottotn, ottotid, i : longword;
+    pc : pchar;
+begin
+  EnumResourceTypesSingleFile:=false;
+  if ResHeader=nil then exit;
+
+  ptr:=GetResInfoPtr(Resheader,sizeof(TExtHeader));
+  totn:=ptr^.ncounthandle;
+  totid:=totn+ptr^.idcountsize;
+  ptr:=GetResInfoPtr(Resheader,ptr^.subptr);
+
+  if Other<>nil then
+  begin
+    otarr:=GetResInfoPtr(Other,sizeof(TExtHeader));
+    ottotn:=otarr^.ncounthandle;
+    ottotid:=ottotn+otarr^.idcountsize-1;
+    otarr:=GetResInfoPtr(Other,otarr^.subptr)
+  end;
+
+  EnumResourceTypesSingleFile:=true;
+  i:=0;
+  while i<totn do //named entries
+  begin
+    pc:=GetPChar(Resheader,ptr[i].nameid);
+    if (Other=nil) or (BinSearchStr(Other,otarr,pc,0,ottotn-1)=nil) then
+      if not EnumFunc(ModuleHandle,pc,lParam) then exit;
+    inc(i);
+  end;
+  while i<totid do
+  begin
+    if (Other=nil) or (BinSearchInt(otarr,PChar(ptr[i].nameid),ottotn,ottotid)=nil) then
+      if not EnumFunc(ModuleHandle,PChar(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+function EnumResourceNamesSingleFile(ResHeader,Other : PExtHeader;
+  ModuleHandle : TFPResourceHMODULE; ResourceType : PChar;
+  EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+var ptr,otarr : PResInfoNode;
+    totn, totid, ottotn, ottotid, i : longword;
+    pc : pchar;
+begin
+  EnumResourceNamesSingleFile:=False;
+  if ResHeader=nil then exit;
+
+  ptr:=GetResInfoPtr(ResHeader,sizeof(TExtHeader));
+  ptr:=BinSearchRes(ResHeader,ptr,ResourceType);
+  if ptr=nil then exit;
+  totn:=ptr^.ncounthandle;
+  totid:=totn+ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ResHeader,ptr^.subptr);
+
+  if Other<>nil then
+  begin
+    otarr:=GetResInfoPtr(Other,sizeof(TExtHeader));
+    otarr:=BinSearchRes(Other,otarr,ResourceType);
+    if otarr<>nil then
+    begin
+      ottotn:=otarr^.ncounthandle;
+      ottotid:=ottotn+otarr^.idcountsize-1;
+      otarr:=GetResInfoPtr(Other,otarr^.subptr)
+    end;
+  end
+  else otarr:=nil;
+
+  EnumResourceNamesSingleFile:=true;
+  i:=0;
+  while i<totn do //named entries
+  begin
+    pc:=GetPChar(ResHeader,ptr[i].nameid);
+    if (otarr=nil) or (BinSearchStr(Other,otarr,pc,0,ottotn-1)=nil) then
+      if not EnumFunc(ModuleHandle,ResourceType,pc,lParam) then exit;
+    inc(i);
+  end;
+  while i<totid do
+  begin
+    if (otarr=nil) or (BinSearchInt(otarr,PChar(ptr[i].nameid),ottotn,ottotid)=nil) then
+      if not EnumFunc(ModuleHandle,ResourceType,PChar(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+function EnumResourceLanguagesSingleFile(ResHeader,Other : PExtHeader;
+  ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar;
+  EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+var ptr, otarr : PResInfoNode;
+    tot, ottot, i : integer;
+begin
+  EnumResourceLanguagesSingleFile:=False;
+  ptr:=InternalFindResource(ResHeader,ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  tot:=ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ResHeader,ptr^.subptr);
+  
+  if Other<>nil then
+  begin
+    otarr:=InternalFindResource(Other,ResourceName,ResourceType);
+    if otarr<>nil then
+    begin
+      ottot:=otarr^.idcountsize-1;
+      otarr:=GetResInfoPtr(Other,otarr^.subptr)
+    end;
+  end
+  else otarr:=nil;
+
+  EnumResourceLanguagesSingleFile:=true;
+  i:=0;
+  while i<tot do
+  begin
+    if (otarr=nil) or (BinSearchInt(otarr,PChar(ptr[i].nameid),0,ottot)=nil) then
+      if not EnumFunc(ModuleHandle,ResourceType,ResourceName,PtrUInt(
+        ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+(*****************************************************************************
+                             Public Resource Functions
+*****************************************************************************)
+
+function ExtHINSTANCE : TFPResourceHMODULE;
+begin
+  ExtHINSTANCE:=0;
+end;
+
+function ExtEnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+begin
+  ExtEnumResourceTypes:=false;
+  if EnumResourceTypesSingleFile(ResFileInfoArch.Resheader,nil,ModuleHandle,
+    EnumFunc,lParam) then ExtEnumResourceTypes:=true;
+  if EnumResourceTypesSingleFile(ResFileInfo.Resheader,
+    ResFileInfoArch.Resheader,ModuleHandle,EnumFunc,lParam) then ExtEnumResourceTypes:=true;
+end;
+
+function ExtEnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+begin
+  ExtEnumResourceNames:=False;
+  if EnumResourceNamesSingleFile(ResFileInfoArch.Resheader,nil,ModuleHandle,
+    ResourceType,EnumFunc,lParam) then ExtEnumResourceNames:=true;
+  if EnumResourceNamesSingleFile(ResFileInfo.Resheader,
+    ResFileInfoArch.Resheader,ModuleHandle,ResourceType,EnumFunc,lParam) then ExtEnumResourceNames:=true;
+end;
+
+function ExtEnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+begin
+  ExtEnumResourceLanguages:=False;
+  if EnumResourceLanguagesSingleFile(ResFileInfoArch.Resheader,nil,ModuleHandle,
+    ResourceType,ResourceName,EnumFunc,lParam) then ExtEnumResourceLanguages:=true;
+  if EnumResourceLanguagesSingleFile(ResFileInfo.Resheader,
+    ResFileInfoArch.Resheader,ModuleHandle,ResourceType,ResourceName,EnumFunc,
+    lParam) then ExtEnumResourceLanguages:=true;
+end;
+
+function ExtFindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar): TFPResourceHandle;
+begin
+  //search for resource in architecture-dependent res file first
+  ExtFindResource:=FindResourceSingleFile(ResFileInfoArch.ResHeader,ResourceName,ResourceType);
+  if ExtFindResource=0 then
+    ExtFindResource:=FindResourceSingleFile(ResFileInfo.ResHeader,ResourceName,ResourceType);
+end;
+
+function ExtFindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: PChar; Language : word): TFPResourceHandle;
+var precar, precsh : integer;
+    handlear, handlesh : TResourceHandle;
+begin
+  //architecture-dependent res file
+  handlear:=FindResourceExSingleFile(ResFileInfoArch.ResHeader,ResourceType,
+    ResourceName,Language,precar);
+  //architecture-independent res file
+  handlesh:=FindResourceExSingleFile(ResFileInfo.ResHeader,ResourceType,
+    ResourceName,Language,precsh);
+
+  //return architecture-independent resource only if its language id is closer
+  //to the one user asked for
+  if precsh>precar then ExtFindResourceEx:=handlesh
+  else ExtFindResourceEx:=handlear;
+end;
+
+function ExtLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+var ptr : PResInfoNode;
+    base : PExtHeader;
+begin
+  ExtLoadResource:=0;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ptr:=PResInfoNode(reshandles[ResHandle-1]);
+  base:=ResFileInfoArch.ResHeader;
+  //if ptr isn't in architecture-dependent file memory area...
+  if (base=nil) or (pointer(ptr)<=pointer(base))
+    or (pointer(ptr)>=GetPtr(base,base^.hdrsize)) then
+      base:=ResFileInfo.ResHeader;
+  ExtLoadResource:=TFPResourceHGLOBAL(GetPtr(base,ptr^.subptr));
+end;
+
+function ExtSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+begin
+  ExtSizeofResource:=0;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ExtSizeofResource:=PResInfoNode(reshandles[ResHandle-1])^.idcountsize;
+end;
+
+function ExtLockResource(ResData: TFPResourceHGLOBAL): Pointer;
+begin
+  ExtLockResource:=Nil;
+  if (ResFileInfoArch.Resheader=nil) and (ResFileInfo.Resheader=nil) then exit;
+  ExtLockResource:=Pointer(ResData);
+end;
+
+function ExtUnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  ExtUnlockResource:=(ResFileInfoArch.Resheader<>nil) or (ResFileInfo.Resheader<>nil);
+end;
+
+function ExtFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  ExtFreeResource:=(ResFileInfoArch.Resheader<>nil) or (ResFileInfo.Resheader<>nil);
+end;
+
+const
+  ExternalResourceManager : TResourceManager =
+  (
+    HINSTANCEFunc : @ExtHINSTANCE;
+    EnumResourceTypesFunc : @ExtEnumResourceTypes;
+    EnumResourceNamesFunc : @ExtEnumResourceNames;
+    EnumResourceLanguagesFunc : @ExtEnumResourceLanguages;
+    FindResourceFunc : @ExtFindResource;
+    FindResourceExFunc : @ExtFindResourceEx;
+    LoadResourceFunc : @ExtLoadResource;
+    SizeofResourceFunc : @ExtSizeofResource;
+    LockResourceFunc : @ExtLockResource;
+    UnlockResourceFunc : @ExtUnlockResource;
+    FreeResourceFunc : @ExtFreeResource;
+  );
+
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
+
+    Resource support as external files, for Mac OS X
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+{
+  This file is similar to extres.inc when EXTRES_MMAP is defined.
+  However, two files are searched (an architecture-dependent one and a shared
+  one). They are searched first in Contents/Resources directory of the program
+  application bundle and then in the same directory of the program.
+}
+
+const
+  FPCRES_MAGIC = 'FPCRES';
+  FPCRES_VERSION = 1;
+  {$IFDEF ENDIAN_BIG}
+  FPCRES_ENDIAN = 1;
+  {$ENDIF}
+  {$IFDEF ENDIAN_LITTLE}
+  FPCRES_ENDIAN = 2;
+  {$ENDIF}
+  FPCRES_EXT = '.fpcres';
+  FPCRES_ARCH =
+    {$IFDEF CPUI386}
+    '.i386';
+    {$ELSE}
+      {$IFDEF CPUX86_64}
+      '.x86_64';
+      {$ELSE}
+        {$IFDEF CPUPOWERPC32}
+        '.powerpc';
+        {$ELSE}
+          {$IFDEF CPUPOWERPC64}
+          '.powerpc64';
+          {$ELSE}
+          '';
+          {$ENDIF}
+        {$ENDIF}
+      {$ENDIF}
+    {$ENDIF}
+
+type
+  TExtHeader = packed record
+    magic : array[0..5] of char;//'FPCRES'
+    version : byte;             //EXT_CURRENT_VERSION
+    endianess : byte;           //EXT_ENDIAN_BIG or EXT_ENDIAN_LITTLE
+    count : longword;           //resource count
+    nodesize : longword;        //size of header (up to string table, excluded)
+    hdrsize  : longword;        //size of header (up to string table, included)
+    reserved1 : longword;
+    reserved2 : longword;
+    reserved3 : longword;
+  end;
+  PExtHeader = ^TExtHeader;
+
+  TResInfoNode = packed record
+    nameid : longword;          //name offset / integer ID / languageID
+    ncounthandle : longword;    //named sub-entries count/resource handle
+    idcountsize : longword;     //id sub-entries count / resource size
+    subptr : longword;          //first sub-entry offset
+  end;
+  PResInfoNode = ^TResInfoNode;
+
+  TResFileInfo = record
+    ResHeader : PExtHeader;
+    fd : integer;
+    size : longword;
+  end;
+
+var
+  ResFileInfo     : TResFileInfo = (ResHeader : nil; fd : 0; size : 0);
+  ResFileInfoArch : TResFileInfo = (ResHeader : nil; fd : 0; size : 0);
+  reshandles : PPointer = nil;
+  usedhandles : longword = 0;
+  rescount : longword = 0;
+
+(*****************************************************************************
+                             Private Helper Functions
+*****************************************************************************)
+
+//resource functions are case insensitive... copied from genstr.inc
+function ResStrIComp(Str1, Str2 : PChar): SizeInt;
+var
+  counter: SizeInt;
+  c1, c2: char;
+begin
+  counter := 0;
+  c1 := upcase(str1[counter]);
+  c2 := upcase(str2[counter]);
+  while c1 = c2 do
+  begin
+    if (c1 = #0) or (c2 = #0) then break;
+    inc(counter);
+    c1 := upcase(str1[counter]);
+    c2 := upcase(str2[counter]);
+  end;
+  ResStrIComp := ord(c1) - ord(c2);
+end;
+
+{!fixme!}
+//function InternalIsIntResource(aStr : pchar; out aInt : PtrUint) : boolean;
+function InternalIsIntResource(aStr : pchar; var aInt : PtrUint) : boolean;
+var i : integer;
+    s : shortstring;
+    code : word;
+begin
+  InternalIsIntResource:=((PtrUInt(aStr) shr 16)=0);
+  if InternalIsIntResource then aInt:=PtrUInt(aStr)
+  else
+  begin
+    //a string like #number specifies an integer id
+    if aStr[0]='#' then
+    begin
+      i:=1;
+      while aStr[i]<>#0 do
+        inc(i);
+      if i>256 then i:=256;
+      s[0]:=chr(i-1);
+      Move(aStr[1],s[1],i-1);
+      Val(s,aInt,code);
+      InternalIsIntResource:=code=0;
+    end;
+  end;
+end;
+
+function GetResInfoPtr(base : PExtHeader; const offset : longword) : PResInfoNode; inline;
+begin
+  GetResInfoPtr:=PResInfoNode(PtrUInt(base)+offset);
+end;
+
+function GetPchar(base : PExtHeader; const offset : longword) : Pchar; inline;
+begin
+  GetPchar:=Pchar(PtrUInt(base)+offset);
+end;
+
+function GetPtr(base : PExtHeader; const offset : longword) : Pointer; inline;
+begin
+  GetPtr:=Pointer(PtrUInt(base)+offset);
+end;
+
+procedure FixResEndian(ResHeader : PExtHeader);
+var ptr : plongword;
+    blockend : plongword;
+begin
+  //all info nodes reside in a contiguos block of memory.
+  //they are all 16 bytes long and made by longwords
+  //so, simply swap each longword in the block
+  ptr:=GetPtr(ResHeader,sizeof(TExtHeader));
+  blockend:=GetPtr(ResHeader,ResHeader^.nodesize);
+  while ptr<blockend do
+  begin
+    ptr^:=SwapEndian(ptr^);
+    inc(ptr);
+  end;
+end;
+
+function GetExtResBasePath : shortstring;
+var exename : shortstring;
+    len, i, extpos, namepos: integer;
+begin
+  GetExtResBasePath:=paramstr(0);
+  len:=byte(GetExtResBasePath[0]);
+  i:=len;
+//  writeln('exe name is ',GetExtResBasePath);
+  //find position of extension
+  while (i>0) and (not (GetExtResBasePath[i] in ['.',DirectorySeparator])) do
+    dec(i);
+  //find position of last directory separator
+  if (i>0) and (GetExtResBasePath[i]='.') then extpos:=i-1
+  else extpos:=len;
+  while (i>0) and (GetExtResBasePath[i] <> DirectorySeparator) do
+    dec(i);
+  namepos:=i;
+  exename:=copy(GetExtResBasePath,i+1,extpos-i);
+  dec(i);
+  //is executable in 'MacOS' directory? find previous dir separator...
+  while (i>0) and (GetExtResBasePath[i] <> DirectorySeparator) do
+    dec(i);
+  if i<0 then i:=0;
+  //yes, search file in <bundle>/Contents/Resources directory
+  if (namepos>i) and (copy(GetExtResBasePath,i+1,namepos-i-1)='MacOS') then
+  begin
+    GetExtResBasePath[0]:=Chr(i);
+    GetExtResBasePath:=GetExtResBasePath+'Resources'+DirectorySeparator+exename;
+  end
+  else //no, search file in exe directory
+    GetExtResBasePath[0]:=Chr(extpos);
+//  writeln('base path is ',GetExtResBasePath);
+end;
+
+function GetExtResPathArch(const base : shortstring) : pchar;
+var len : integer;
+begin
+  len:=byte(base[0]);
+  GetExtResPathArch:=GetMem(len+length(FPCRES_ARCH)+length(FPCRES_EXT)+1);
+  Move(base[1],GetExtResPathArch[0],len);
+  Move(FPCRES_ARCH[1],GetExtResPathArch[len],length(FPCRES_ARCH));
+  inc(len,length(FPCRES_ARCH));
+  Move(FPCRES_EXT[1],GetExtResPathArch[len],length(FPCRES_EXT));
+  inc(len,length(FPCRES_EXT));
+  GetExtResPathArch[len]:=#0;
+//  writeln('Arch-dependent resource file is ',GetExtResPathArch);
+end;
+
+function GetExtResPath(const base : shortstring) : pchar;
+var len : integer;
+begin
+  len:=byte(base[0]);
+  GetExtResPath:=GetMem(len+length(FPCRES_EXT)+1);
+  Move(base[1],GetExtResPath[0],len);
+  Move(FPCRES_EXT[1],GetExtResPath[len],length(FPCRES_EXT));
+  inc(len,length(FPCRES_EXT));
+  GetExtResPath[len]:=#0;
+//  writeln('Shared resource file is ',GetExtResPath);
+end;
+
+procedure MapResFile(var aInfo : TResFileInfo; aName : pchar);
+const
+  PROT_READ  = 1;
+  PROT_WRITE = 2;
+var fdstat : stat;
+begin
+  aInfo.fd:=FpOpen(aName,O_RDONLY,0);
+  FreeMem(aName);
+//  writeln('fpopen returned ',aInfo.fd);
+  if (aInfo.fd=-1) then exit;
+  if FpFStat(aInfo.fd,fdstat)<>0 then
+  begin
+//    writeln('fpfstat failed');
+    FpClose(aInfo.fd);
+    exit;
+  end;
+//  writeln('fpfstat suceeded');
+  aInfo.size:=fdstat.st_size;
+  aInfo.ResHeader:=PExtHeader(Fpmmap(nil,aInfo.size,PROT_READ or PROT_WRITE,
+    MAP_PRIVATE,aInfo.fd,0));
+//  writeln('fpmmap returned ',PtrInt(aInfo.ResHeader));
+  if PtrInt(aInfo.ResHeader)=-1 then
+  begin
+    FpClose(aInfo.fd);
+    exit;
+  end;
+  if (aInfo.ResHeader^.magic<>FPCRES_MAGIC) or
+    (aInfo.ResHeader^.version<>FPCRES_VERSION) then
+  begin
+    FpClose(aInfo.fd);
+    exit;
+  end;
+//  writeln('magic ok');
+  if aInfo.ResHeader^.endianess<>FPCRES_ENDIAN then
+  begin
+    aInfo.ResHeader^.count:=SwapEndian(aInfo.ResHeader^.count);
+    aInfo.ResHeader^.nodesize:=SwapEndian(aInfo.ResHeader^.nodesize);
+    aInfo.ResHeader^.hdrsize:=SwapEndian(aInfo.ResHeader^.hdrsize);
+    FixResEndian(aInfo.ResHeader);
+  end;
+  inc(rescount,aInfo.ResHeader^.count);
+end;
+
+procedure InitResources;
+var respathArch : pchar;
+    respath : pchar;
+    basepath : shortstring;
+begin
+  basepath:=GetExtResBasePath;
+  respathArch:=GetExtResPathArch(basepath);
+  respath:=GetExtResPath(basepath);
+  MapResFile(ResFileInfoArch,respathArch);
+  MapResFile(ResFileInfo,respath);
+
+  if rescount=0 then exit;
+  reshandles:=GetMem(sizeof(Pointer)*rescount);
+  FillByte(reshandles^,sizeof(Pointer)*rescount,0);
+end;
+
+procedure FinalizeResources;
+begin
+  if (ResFileInfoArch.Resheader=nil) and (ResFileInfo.Resheader=nil) then exit;
+  FreeMem(reshandles);
+  if ResFileInfoArch.Resheader<>nil then
+  begin
+    Fpmunmap(ResFileInfoArch.ResHeader,ResFileInfoArch.size);
+    FpClose(ResFileInfoArch.fd);
+  end;
+  if ResFileInfo.Resheader<>nil then
+  begin
+    Fpmunmap(ResFileInfo.ResHeader,ResFileInfo.size);
+    FpClose(ResFileInfo.fd);
+  end;
+end;
+
+function BinSearchStr(base : PExtHeader; arr : PResInfoNode; query : pchar;
+  left, right : integer) : PResInfoNode;
+var pivot, res : integer;
+    resstr : pchar;
+begin
+  BinSearchStr:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    resstr:=GetPchar(base,arr[pivot].nameid);
+    res:=ResStrIComp(resstr,query);
+    if res<0 then left:=pivot+1
+    else if res>0 then right:=pivot-1
+    else
+    begin
+      BinSearchStr:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchInt(arr : PResInfoNode; query : pchar; left, right : integer)
+: PResInfoNode;
+var pivot : integer;
+begin
+  BinSearchInt:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    if arr[pivot].nameid<PtrUInt(query) then left:=pivot+1
+    else if arr[pivot].nameid>PtrUInt(query) then right:=pivot-1
+    else
+    begin
+      BinSearchInt:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchRes(base : PExtHeader; root : PResInfoNode; aDesc : PChar)
+: PResInfoNode;
+var aID : PtrUint;
+begin
+  if InternalIsIntResource(aDesc,aID) then
+    BinSearchRes:=BinSearchInt(GetResInfoPtr(base,root^.subptr),PChar(aID),
+      root^.ncounthandle,root^.ncounthandle+root^.idcountsize-1)
+  else
+    BinSearchRes:=BinSearchStr(base,GetResInfoPtr(base,root^.subptr),aDesc,0,
+      root^.ncounthandle-1);
+end;
+
+function FindSubLanguage(base : PExtHeader; aPtr : PResInfoNode; aLangID : word;
+  aMask: word) : PResInfoNode;
+var arr : PResInfoNode;
+    i : longword;
+begin
+  FindSubLanguage:=nil;
+  arr:=GetResInfoPtr(base,aPtr^.subptr);
+  i:=0;
+  while i<aPtr^.idcountsize do
+  begin
+    if (PtrUInt(arr[i].nameid) and aMask)=(aLangID and aMask) then
+    begin
+      FindSubLanguage:=@arr[i];
+      exit;
+    end;
+    inc(i);
+  end;
+end;
+
+//Returns a pointer to a name node.
+function InternalFindResource(base : PExtHeader; ResourceName, ResourceType: PChar):
+ PResInfoNode;
+begin
+  InternalFindResource:=nil;
+  if base=nil then exit;
+  InternalFindResource:=GetResInfoPtr(base,sizeof(TExtHeader));
+
+  InternalFindResource:=BinSearchRes(base,InternalFindResource,ResourceType);
+  if InternalFindResource<>nil then
+    InternalFindResource:=BinSearchRes(base,InternalFindResource,ResourceName);
+end;
+
+function FindResourceSingleFile(ResHeader : PExtHeader; ResourceName,
+  ResourceType: PChar) : TFPResourceHandle;
+var ptr : PResInfoNode;
+begin
+  FindResourceSingleFile:=0;
+  ptr:=InternalFindResource(ResHeader,ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  //first language id
+  ptr:=GetResInfoPtr(ResHeader,ptr^.subptr);
+  if ptr^.ncounthandle=0 then
+  begin
+    reshandles[usedhandles]:=ptr;
+    inc(usedhandles);
+    ptr^.ncounthandle:=usedhandles;
+  end;
+  FindResourceSingleFile:=ptr^.ncounthandle;
+end;
+
+{!fixme!}
+//function FindResourceExSingleFile(ResHeader : PExtHeader; ResourceType,
+//  ResourceName: PChar;  Language : word; out precision : integer): TFPResourceHandle;
+function FindResourceExSingleFile(ResHeader : PExtHeader; ResourceType,
+  ResourceName: PChar;  Language : word; var precision : integer): TFPResourceHandle;
+const LANG_NEUTRAL = 0;
+      LANG_ENGLISH = 9;
+var nameptr,ptr : PResInfoNode;
+begin
+  FindResourceExSingleFile:=0;
+  precision:=-1;
+  nameptr:=InternalFindResource(ResHeader,ResourceName,ResourceType);
+  if nameptr=nil then exit;
+
+  precision:=4;
+  //try exact match
+  ptr:=FindSubLanguage(ResHeader,nameptr,Language,$FFFF);
+  //try primary language
+  if ptr=nil then
+  begin
+    dec(precision);
+    ptr:=FindSubLanguage(ResHeader,nameptr,Language,$3FF);
+  end;
+  //try language neutral
+  if ptr=nil then
+  begin
+    dec(precision);
+    ptr:=FindSubLanguage(ResHeader,nameptr,LANG_NEUTRAL,$3FF);
+  end;
+  //try english
+  if ptr=nil then
+  begin
+    dec(precision);
+    ptr:=FindSubLanguage(ResHeader,nameptr,LANG_ENGLISH,$3FF);
+  end;
+  //nothing found, return the first one
+  if ptr=nil then
+  begin
+    dec(precision);
+    ptr:=GetResInfoPtr(ResHeader,nameptr^.subptr);
+  end;
+
+  if ptr^.ncounthandle=0 then
+  begin
+    reshandles[usedhandles]:=ptr;
+    inc(usedhandles);
+    ptr^.ncounthandle:=usedhandles;
+  end;
+  FindResourceExSingleFile:=ptr^.ncounthandle;
+end;
+
+function EnumResourceTypesSingleFile(ResHeader,Other : PExtHeader; ModuleHandle
+ : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+var ptr,otarr : PResInfoNode;
+    totn, totid, ottotn, ottotid, i : longword;
+    pc : pchar;
+begin
+  EnumResourceTypesSingleFile:=false;
+  if ResHeader=nil then exit;
+
+  ptr:=GetResInfoPtr(Resheader,sizeof(TExtHeader));
+  totn:=ptr^.ncounthandle;
+  totid:=totn+ptr^.idcountsize;
+  ptr:=GetResInfoPtr(Resheader,ptr^.subptr);
+
+  if Other<>nil then
+  begin
+    otarr:=GetResInfoPtr(Other,sizeof(TExtHeader));
+    ottotn:=otarr^.ncounthandle;
+    ottotid:=ottotn+otarr^.idcountsize-1;
+    otarr:=GetResInfoPtr(Other,otarr^.subptr)
+  end;
+
+  EnumResourceTypesSingleFile:=true;
+  i:=0;
+  while i<totn do //named entries
+  begin
+    pc:=GetPChar(Resheader,ptr[i].nameid);
+    if (Other=nil) or (BinSearchStr(Other,otarr,pc,0,ottotn-1)=nil) then
+      if not EnumFunc(ModuleHandle,pc,lParam) then exit;
+    inc(i);
+  end;
+  while i<totid do
+  begin
+    if (Other=nil) or (BinSearchInt(otarr,PChar(ptr[i].nameid),ottotn,ottotid)=nil) then
+      if not EnumFunc(ModuleHandle,PChar(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+function EnumResourceNamesSingleFile(ResHeader,Other : PExtHeader;
+  ModuleHandle : TFPResourceHMODULE; ResourceType : PChar;
+  EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+var ptr,otarr : PResInfoNode;
+    totn, totid, ottotn, ottotid, i : longword;
+    pc : pchar;
+begin
+  EnumResourceNamesSingleFile:=False;
+  if ResHeader=nil then exit;
+
+  ptr:=GetResInfoPtr(ResHeader,sizeof(TExtHeader));
+  ptr:=BinSearchRes(ResHeader,ptr,ResourceType);
+  if ptr=nil then exit;
+  totn:=ptr^.ncounthandle;
+  totid:=totn+ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ResHeader,ptr^.subptr);
+
+  if Other<>nil then
+  begin
+    otarr:=GetResInfoPtr(Other,sizeof(TExtHeader));
+    otarr:=BinSearchRes(Other,otarr,ResourceType);
+    if otarr<>nil then
+    begin
+      ottotn:=otarr^.ncounthandle;
+      ottotid:=ottotn+otarr^.idcountsize-1;
+      otarr:=GetResInfoPtr(Other,otarr^.subptr)
+    end;
+  end
+  else otarr:=nil;
+
+  EnumResourceNamesSingleFile:=true;
+  i:=0;
+  while i<totn do //named entries
+  begin
+    pc:=GetPChar(ResHeader,ptr[i].nameid);
+    if (otarr=nil) or (BinSearchStr(Other,otarr,pc,0,ottotn-1)=nil) then
+      if not EnumFunc(ModuleHandle,ResourceType,pc,lParam) then exit;
+    inc(i);
+  end;
+  while i<totid do
+  begin
+    if (otarr=nil) or (BinSearchInt(otarr,PChar(ptr[i].nameid),ottotn,ottotid)=nil) then
+      if not EnumFunc(ModuleHandle,ResourceType,PChar(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+function EnumResourceLanguagesSingleFile(ResHeader,Other : PExtHeader;
+  ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar;
+  EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+var ptr, otarr : PResInfoNode;
+    tot, ottot, i : integer;
+begin
+  EnumResourceLanguagesSingleFile:=False;
+  ptr:=InternalFindResource(ResHeader,ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  tot:=ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ResHeader,ptr^.subptr);
+  
+  if Other<>nil then
+  begin
+    otarr:=InternalFindResource(Other,ResourceName,ResourceType);
+    if otarr<>nil then
+    begin
+      ottot:=otarr^.idcountsize-1;
+      otarr:=GetResInfoPtr(Other,otarr^.subptr)
+    end;
+  end
+  else otarr:=nil;
+
+  EnumResourceLanguagesSingleFile:=true;
+  i:=0;
+  while i<tot do
+  begin
+    if (otarr=nil) or (BinSearchInt(otarr,PChar(ptr[i].nameid),0,ottot)=nil) then
+      if not EnumFunc(ModuleHandle,ResourceType,ResourceName,PtrUInt(
+        ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+(*****************************************************************************
+                             Public Resource Functions
+*****************************************************************************)
+
+function ExtHINSTANCE : TFPResourceHMODULE;
+begin
+  ExtHINSTANCE:=0;
+end;
+
+function ExtEnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+begin
+  ExtEnumResourceTypes:=false;
+  if EnumResourceTypesSingleFile(ResFileInfoArch.Resheader,nil,ModuleHandle,
+    EnumFunc,lParam) then ExtEnumResourceTypes:=true;
+  if EnumResourceTypesSingleFile(ResFileInfo.Resheader,
+    ResFileInfoArch.Resheader,ModuleHandle,EnumFunc,lParam) then ExtEnumResourceTypes:=true;
+end;
+
+function ExtEnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+begin
+  ExtEnumResourceNames:=False;
+  if EnumResourceNamesSingleFile(ResFileInfoArch.Resheader,nil,ModuleHandle,
+    ResourceType,EnumFunc,lParam) then ExtEnumResourceNames:=true;
+  if EnumResourceNamesSingleFile(ResFileInfo.Resheader,
+    ResFileInfoArch.Resheader,ModuleHandle,ResourceType,EnumFunc,lParam) then ExtEnumResourceNames:=true;
+end;
+
+function ExtEnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+begin
+  ExtEnumResourceLanguages:=False;
+  if EnumResourceLanguagesSingleFile(ResFileInfoArch.Resheader,nil,ModuleHandle,
+    ResourceType,ResourceName,EnumFunc,lParam) then ExtEnumResourceLanguages:=true;
+  if EnumResourceLanguagesSingleFile(ResFileInfo.Resheader,
+    ResFileInfoArch.Resheader,ModuleHandle,ResourceType,ResourceName,EnumFunc,
+    lParam) then ExtEnumResourceLanguages:=true;
+end;
+
+function ExtFindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar): TFPResourceHandle;
+begin
+  //search for resource in architecture-dependent res file first
+  ExtFindResource:=FindResourceSingleFile(ResFileInfoArch.ResHeader,ResourceName,ResourceType);
+  if ExtFindResource=0 then
+    ExtFindResource:=FindResourceSingleFile(ResFileInfo.ResHeader,ResourceName,ResourceType);
+end;
+
+function ExtFindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: PChar; Language : word): TFPResourceHandle;
+var precar, precsh : integer;
+    handlear, handlesh : TResourceHandle;
+begin
+  //architecture-dependent res file
+  handlear:=FindResourceExSingleFile(ResFileInfoArch.ResHeader,ResourceType,
+    ResourceName,Language,precar);
+  //architecture-independent res file
+  handlesh:=FindResourceExSingleFile(ResFileInfo.ResHeader,ResourceType,
+    ResourceName,Language,precsh);
+
+  //return architecture-independent resource only if its language id is closer
+  //to the one user asked for
+  if precsh>precar then ExtFindResourceEx:=handlesh
+  else ExtFindResourceEx:=handlear;
+end;
+
+function ExtLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+var ptr : PResInfoNode;
+    base : PExtHeader;
+begin
+  ExtLoadResource:=0;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ptr:=PResInfoNode(reshandles[ResHandle-1]);
+  base:=ResFileInfoArch.ResHeader;
+  //if ptr isn't in architecture-dependent file memory area...
+  if (base=nil) or (pointer(ptr)<=pointer(base))
+    or (pointer(ptr)>=GetPtr(base,base^.hdrsize)) then
+      base:=ResFileInfo.ResHeader;
+  ExtLoadResource:=TFPResourceHGLOBAL(GetPtr(base,ptr^.subptr));
+end;
+
+function ExtSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+begin
+  ExtSizeofResource:=0;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ExtSizeofResource:=PResInfoNode(reshandles[ResHandle-1])^.idcountsize;
+end;
+
+function ExtLockResource(ResData: TFPResourceHGLOBAL): Pointer;
+begin
+  ExtLockResource:=Nil;
+  if (ResFileInfoArch.Resheader=nil) and (ResFileInfo.Resheader=nil) then exit;
+  ExtLockResource:=Pointer(ResData);
+end;
+
+function ExtUnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  ExtUnlockResource:=(ResFileInfoArch.Resheader<>nil) or (ResFileInfo.Resheader<>nil);
+end;
+
+function ExtFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  ExtFreeResource:=(ResFileInfoArch.Resheader<>nil) or (ResFileInfo.Resheader<>nil);
+end;
+
+const
+  ExternalResourceManager : TResourceManager =
+  (
+    HINSTANCEFunc : @ExtHINSTANCE;
+    EnumResourceTypesFunc : @ExtEnumResourceTypes;
+    EnumResourceNamesFunc : @ExtEnumResourceNames;
+    EnumResourceLanguagesFunc : @ExtEnumResourceLanguages;
+    FindResourceFunc : @ExtFindResource;
+    FindResourceExFunc : @ExtFindResourceEx;
+    LoadResourceFunc : @ExtLoadResource;
+    SizeofResourceFunc : @ExtSizeofResource;
+    LockResourceFunc : @ExtLockResource;
+    UnlockResourceFunc : @ExtUnlockResource;
+    FreeResourceFunc : @ExtFreeResource;
+  );
+

+ 1 - 1
rtl/emx/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 54 - 54
rtl/freebsd/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -270,163 +270,163 @@ override FPCOPT+=-Ur
 endif
 OBJPASDIR=$(RTL)/objpas
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets ipc terminfo bsd freebsd video mouse keyboard console serial dateutils sysconst cthreads strutils convutils stdconvs dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt0 cprt0 gprt0

+ 2 - 1
rtl/freebsd/Makefile.fpc

@@ -17,7 +17,8 @@ units=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseun
       $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo \
       errors sockets ipc terminfo bsd freebsd \
       video mouse keyboard console serial dateutils \
-      sysconst cthreads strutils convutils stdconvs dos objects cwstring
+      sysconst cthreads strutils convutils stdconvs dos objects cwstring \
+      fpintres
 
 rsts=math varutils typinfo classes variants dateutils sysconst
 

+ 1 - 1
rtl/gba/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 1 - 1
rtl/go32v2/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 1322 - 0
rtl/inc/extres.inc

@@ -0,0 +1,1322 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
+
+    Resource support as external files
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+{
+  This file implements two kinds of external resource support:
+   - one for systems that support the mmap call (usually unix-like oses)
+   - one fallback implementation based on pascal files and GetMem/FreeMem
+   
+  Be sure to define EXTRES_MMAP or EXTRES_GENERIC before including this file!
+}
+{$IF defined(EXTRES_MMAP) and defined(EXTRES_GENERIC)}
+{$FATAL EXTRES_MMAP and EXTRES_GENERIC can't be defined together}
+{$ENDIF}
+
+{$IF (not defined(EXTRES_MMAP)) and (not defined(EXTRES_GENERIC))}
+{$FATAL EXTRES_MMAP or EXTRES_GENERIC must be defined}
+{$ENDIF}
+
+const
+  FPCRES_MAGIC = 'FPCRES';
+  FPCRES_VERSION = 1;
+  {$IFDEF ENDIAN_BIG}
+  FPCRES_ENDIAN = 1;
+  {$ENDIF}
+  {$IFDEF ENDIAN_LITTLE}
+  FPCRES_ENDIAN = 2;
+  {$ENDIF}
+  FPCRES_EXT = '.fpcres';
+
+type
+  TExtHeader = packed record
+    magic : array[0..5] of char;//'FPCRES'
+    version : byte;             //EXT_CURRENT_VERSION
+    endianess : byte;           //EXT_ENDIAN_BIG or EXT_ENDIAN_LITTLE
+    count : longword;           //resource count
+    nodesize : longword;        //size of header (up to string table, excluded)
+    hdrsize  : longword;        //size of header (up to string table, included)
+    reserved1 : longword;
+    reserved2 : longword;
+    reserved3 : longword;
+  end;
+  PExtHeader = ^TExtHeader;
+
+  TResInfoNode = packed record
+    nameid : longword;          //name offset / integer ID / languageID
+    ncounthandle : longword;    //named sub-entries count/resource handle
+    idcountsize : longword;     //id sub-entries count / resource size
+    subptr : longword;          //first sub-entry offset
+  end;
+  PResInfoNode = ^TResInfoNode;
+
+  {$IFDEF EXTRES_GENERIC}
+  TResHandle = record
+    info : PResInfoNode;
+    ptr : Pointer;
+  end;
+  PResHandle = ^TResHandle;
+  {$ENDIF}
+
+var ResHeader : PExtHeader = nil;
+    usedhandles : longword = 0;
+    {$IFDEF EXTRES_MMAP}
+    fd : integer;
+    fd_size : longword;
+    reshandles : PPointer = nil;
+    {$ENDIF}
+    {$IFDEF EXTRES_GENERIC}
+    fd : file;
+    reshandles : PResHandle = nil;
+    {$ENDIF}
+
+(*****************************************************************************
+                             Private Helper Functions
+*****************************************************************************)
+
+//resource functions are case insensitive... copied from genstr.inc
+function ResStrIComp(Str1, Str2 : PChar): SizeInt;
+var
+  counter: SizeInt;
+  c1, c2: char;
+begin
+  counter := 0;
+  c1 := upcase(str1[counter]);
+  c2 := upcase(str2[counter]);
+  while c1 = c2 do
+  begin
+    if (c1 = #0) or (c2 = #0) then break;
+    inc(counter);
+    c1 := upcase(str1[counter]);
+    c2 := upcase(str2[counter]);
+  end;
+  ResStrIComp := ord(c1) - ord(c2);
+end;
+
+{!fixme!}
+//function InternalIsIntResource(aStr : pchar; out aInt : PtrUint) : boolean;
+function InternalIsIntResource(aStr : pchar; var aInt : PtrUint) : boolean;
+var i : integer;
+    s : shortstring;
+    code : word;
+begin
+  InternalIsIntResource:=((PtrUInt(aStr) shr 16)=0);
+  if InternalIsIntResource then aInt:=PtrUInt(aStr)
+  else
+  begin
+    //a string like #number specifies an integer id
+    if aStr[0]='#' then
+    begin
+      i:=1;
+      while aStr[i]<>#0 do
+        inc(i);
+      if i>256 then i:=256;
+      s[0]:=chr(i-1);
+      Move(aStr[1],s[1],i-1);
+      Val(s,aInt,code);
+      InternalIsIntResource:=code=0;
+    end;
+  end;
+end;
+
+function GetResInfoPtr(const offset : longword) : PResInfoNode; inline;
+begin
+  GetResInfoPtr:=PResInfoNode(PtrUInt(ResHeader)+offset);
+end;
+
+function GetPchar(const offset : longword) : Pchar; inline;
+begin
+  GetPchar:=Pchar(PtrUInt(ResHeader)+offset);
+end;
+
+function GetPtr(const offset : longword) : Pointer; inline;
+begin
+  GetPtr:=Pointer(PtrUInt(ResHeader)+offset);
+end;
+
+procedure FixResEndian;
+var ptr : plongword;
+    blockend : plongword;
+begin
+  //all info nodes reside in a contiguos block of memory.
+  //they are all 16 bytes long and made by longwords
+  //so, simply swap each longword in the block
+  ptr:=GetPtr(sizeof(TExtHeader));
+  blockend:=GetPtr(ResHeader^.nodesize);
+  while ptr<blockend do
+  begin
+    ptr^:=SwapEndian(ptr^);
+    inc(ptr);
+  end;
+end;
+
+function GetExtResPath : pchar;
+var len, i : integer;
+    pathstr : shortstring;
+begin
+  pathstr:=paramstr(0);
+  len:=byte(pathstr[0]);
+  i:=len;
+  //writeln('exe name is ',pathstr);
+  //find position of extension
+  while (i>0) and (not (pathstr[i] in ['.',DirectorySeparator])) do
+    dec(i);
+  if (i>0) and (pathstr[i]='.') then dec(i)
+  else i:=len;
+  pathstr[0]:=Chr(i);
+  pathstr:=pathstr+FPCRES_EXT;
+  len:=byte(pathstr[0]);
+  GetExtResPath:=GetMem(len+1);
+  Move(pathstr[1],GetExtResPath[0],len);
+  GetExtResPath[len]:=#0;
+  //writeln('Resource file is ',GetExtResPath);
+end;
+
+function BinSearchStr(arr : PResInfoNode; query : pchar; left, right : integer)
+: PResInfoNode;
+var pivot, res : integer;
+    resstr : pchar;
+begin
+  BinSearchStr:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    resstr:=GetPchar(arr[pivot].nameid);
+    res:=ResStrIComp(resstr,query);
+    if res<0 then left:=pivot+1
+    else if res>0 then right:=pivot-1
+    else
+    begin
+      BinSearchStr:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchInt(arr : PResInfoNode; query : pchar; left, right : integer)
+: PResInfoNode;
+var pivot : integer;
+begin
+  BinSearchInt:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    if arr[pivot].nameid<PtrUInt(query) then left:=pivot+1
+    else if arr[pivot].nameid>PtrUInt(query) then right:=pivot-1
+    else
+    begin
+      BinSearchInt:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchRes(root : PResInfoNode; aDesc : PChar) : PResInfoNode;
+var aID : PtrUint;
+begin
+  if InternalIsIntResource(aDesc,aID) then
+    BinSearchRes:=BinSearchInt(GetResInfoPtr(root^.subptr),PChar(aID),
+      root^.ncounthandle,root^.ncounthandle+root^.idcountsize-1)
+  else
+    BinSearchRes:=BinSearchStr(GetResInfoPtr(root^.subptr),aDesc,0,
+      root^.ncounthandle-1);
+end;
+
+//Returns a pointer to a name node.
+function InternalFindResource(ResourceName, ResourceType: PChar):
+ PResInfoNode;
+begin
+  InternalFindResource:=nil;
+  if ResHeader=nil then exit;
+  InternalFindResource:=GetResInfoPtr(sizeof(TExtHeader));
+
+  InternalFindResource:=BinSearchRes(InternalFindResource,ResourceType);
+  if InternalFindResource<>nil then
+    InternalFindResource:=BinSearchRes(InternalFindResource,ResourceName);
+end;
+
+function FindSubLanguage(aPtr : PResInfoNode; aLangID : word; aMask: word) : PResInfoNode;
+var arr : PResInfoNode;
+    i : longword;
+begin
+  FindSubLanguage:=nil;
+  arr:=GetResInfoPtr(aPtr^.subptr);
+  i:=0;
+  while i<aPtr^.idcountsize do
+  begin
+    if (PtrUInt(arr[i].nameid) and aMask)=(aLangID and aMask) then
+    begin
+      FindSubLanguage:=@arr[i];
+      exit;
+    end;
+    inc(i);
+  end;
+end;
+
+{$IFDEF EXTRES_MMAP}
+procedure InitResources;
+const
+  PROT_READ  = 1;
+  PROT_WRITE = 2;
+var respath : pchar;
+    fdstat : stat;
+begin
+  respath:=GetExtResPath;
+//  writeln('respath ',respath);
+  fd:=FpOpen(respath,O_RDONLY,0);
+//  writeln('fpopen returned ',fd);
+  FreeMem(respath);
+  if fd=-1 then exit;
+  if FpFStat(fd,fdstat)<>0 then
+  begin
+//    writeln('fpfstat failed');
+    FpClose(fd);
+    exit;
+  end;
+//  writeln('fpfstat suceeded');
+  fd_size:=fdstat.st_size;
+  ResHeader:=PExtHeader(Fpmmap(nil,fd_size,PROT_READ or PROT_WRITE,
+    MAP_PRIVATE,fd,0));
+//  writeln('fpmmap returned ',PtrInt(ResHeader));
+  if PtrInt(ResHeader)=-1 then
+  begin
+    FpClose(fd);
+    exit;
+  end;
+  if (ResHeader^.magic<>FPCRES_MAGIC) or
+    (ResHeader^.version<>fpcres_version) then
+  begin
+    FpClose(fd);
+    exit;
+  end;
+//  writeln('magic ok');
+  if ResHeader^.endianess<>FPCRES_ENDIAN then
+  begin
+    ResHeader^.count:=SwapEndian(ResHeader^.count);
+    ResHeader^.nodesize:=SwapEndian(ResHeader^.nodesize);
+    ResHeader^.hdrsize:=SwapEndian(ResHeader^.hdrsize);
+    FixResEndian;
+  end;
+  reshandles:=GetMem(sizeof(Pointer)*ResHeader^.count);
+  FillByte(reshandles^,sizeof(Pointer)*ResHeader^.count,0);
+end;
+
+procedure FinalizeResources;
+begin
+  if ResHeader=nil then exit;
+  FreeMem(reshandles);
+  Fpmunmap(ResHeader,fd_size);
+  FpClose(fd);
+end;
+{$ENDIF}
+
+{$IFDEF EXTRES_GENERIC}
+procedure InitResources;
+var respath : pchar;
+    tmp : longword;
+    tmpptr : pbyte;
+label ExitErrMem, ExitErrFile, ExitNoErr;
+begin
+  respath:=GetExtResPath;
+//  writeln('respath ',respath);
+  Assign(fd,respath);
+  FreeMem(respath);
+  {$I-}
+  Reset(fd,1);
+  {$I+}
+  if IOResult<>0 then exit;
+//  writeln('file opened');
+  ResHeader:=GetMem(sizeof(TExtHeader));
+  if ResHeader=nil then goto ExitErrFile;
+  {$I-}
+  BlockRead(fd,ResHeader^,sizeof(TExtHeader),tmp);
+  {$I+}
+  if (IOResult<>0) or (tmp<>sizeof(TExtHeader)) then goto ExitErrMem;
+  if (ResHeader^.magic<>FPCRES_MAGIC) or (ResHeader^.version<>fpcres_version)
+    then goto ExitErrMem;
+//  writeln('magic ok');
+  if ResHeader^.endianess<>FPCRES_ENDIAN then
+  begin
+    ResHeader^.count:=SwapEndian(ResHeader^.count);
+    ResHeader^.nodesize:=SwapEndian(ResHeader^.nodesize);
+    ResHeader^.hdrsize:=SwapEndian(ResHeader^.hdrsize);
+  end;
+  SysReallocMem(ResHeader,ResHeader^.hdrsize);
+  if ResHeader=nil then goto ExitErrFile;
+  tmpptr:=pbyte(ResHeader);
+  inc(tmpptr,sizeof(TExtHeader));
+  {$I-}
+  BlockRead(fd,tmpptr^,ResHeader^.hdrsize-sizeof(TExtHeader),tmp);
+  {$I+}
+  if (IOResult<>0) or (tmp<>ResHeader^.hdrsize-sizeof(TExtHeader)) then goto ExitErrMem;
+  if ResHeader^.endianess<>FPCRES_ENDIAN then
+    FixResEndian;
+  reshandles:=GetMem(sizeof(TResHandle)*ResHeader^.count);
+  FillByte(reshandles^,sizeof(TResHandle)*ResHeader^.count,0);
+  goto ExitNoErr;
+
+  ExitErrMem:
+    FreeMem(ResHeader);
+    ResHeader:=nil;
+  ExitErrFile:
+    {$I-}
+    Close(fd);
+    {$I+}
+  ExitNoErr:
+end;
+
+procedure FinalizeResources;
+begin
+  if ResHeader=nil then exit;
+  FreeMem(reshandles);
+  FreeMem(ResHeader);
+  Close(fd);
+end;
+{$ENDIF}
+
+(*****************************************************************************
+                             Public Resource Functions
+*****************************************************************************)
+
+Function ExtHINSTANCE : TFPResourceHMODULE;
+begin
+  ExtHINSTANCE:=0;
+end;
+
+function ExtEnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+var ptr : PResInfoNode;
+    totn, totid, i : longword;
+    pc : pchar;
+begin
+  ExtEnumResourceTypes:=False;
+  if ResHeader=nil then exit;
+  ptr:=GetResInfoPtr(sizeof(TExtHeader));
+  totn:=ptr^.ncounthandle;
+  totid:=totn+ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ptr^.subptr);
+  ExtEnumResourceTypes:=true;
+  i:=0;
+  while i<totn do //named entries
+  begin
+    pc:=GetPChar(ptr[i].nameid);
+    if not EnumFunc(ModuleHandle,pc,lParam) then exit;
+    inc(i);
+  end;
+  while i<totid do
+  begin
+    if not EnumFunc(ModuleHandle,PChar(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+function ExtEnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+var ptr : PResInfoNode;
+    totn, totid, i : longword;
+    pc : pchar;
+begin
+  ExtEnumResourceNames:=False;
+  if ResHeader=nil then exit;
+  ptr:=GetResInfoPtr(sizeof(TExtHeader));
+
+  ptr:=BinSearchRes(ptr,ResourceType);
+  if ptr=nil then exit;
+
+  totn:=ptr^.ncounthandle;
+  totid:=totn+ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ptr^.subptr);
+  ExtEnumResourceNames:=true;
+  i:=0;
+  while i<totn do //named entries
+  begin
+    pc:=GetPChar(ptr[i].nameid);
+    if not EnumFunc(ModuleHandle,ResourceType,pc,lParam) then exit;
+    inc(i);
+  end;
+  while i<totid do
+  begin
+    if not EnumFunc(ModuleHandle,ResourceType,PChar(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+function ExtEnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+var ptr : PResInfoNode;
+    tot, i : integer;
+begin
+  ExtEnumResourceLanguages:=False;
+  ptr:=InternalFindResource(ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  tot:=ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ptr^.subptr);
+  ExtEnumResourceLanguages:=true;
+  i:=0;
+  while i<tot do
+  begin
+    if not EnumFunc(ModuleHandle,ResourceType,ResourceName,PtrUInt(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+Function ExtFindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar)
+: TFPResourceHandle;
+var ptr : PResInfoNode;
+begin
+  ExtFindResource:=0;
+  ptr:=InternalFindResource(ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  //first language id
+  ptr:=GetResInfoPtr(ptr^.subptr);
+  if ptr^.ncounthandle=0 then
+  begin
+    {$IFDEF EXTRES_MMAP}
+    reshandles[usedhandles]:=ptr;
+    {$ENDIF}
+    {$IFDEF EXTRES_GENERIC}
+    reshandles[usedhandles].info:=ptr;
+    {$ENDIF}
+    inc(usedhandles);
+    ptr^.ncounthandle:=usedhandles;
+  end;
+  ExtFindResource:=ptr^.ncounthandle;
+end;
+
+Function ExtFindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType,
+  ResourceName: PChar; Language : word): TFPResourceHandle;
+const LANG_NEUTRAL = 0;
+      LANG_ENGLISH = 9;
+var nameptr,ptr : PResInfoNode;
+begin
+  ExtFindResourceEx:=0;
+  nameptr:=InternalFindResource(ResourceName,ResourceType);
+  if nameptr=nil then exit;
+
+  //try exact match
+  ptr:=FindSubLanguage(nameptr,Language,$FFFF);
+  //try primary language
+  if ptr=nil then
+    ptr:=FindSubLanguage(nameptr,Language,$3FF);
+  //try language neutral
+  if ptr=nil then
+    ptr:=FindSubLanguage(nameptr,LANG_NEUTRAL,$3FF);
+  //try english
+  if ptr=nil then
+    ptr:=FindSubLanguage(nameptr,LANG_ENGLISH,$3FF);
+  //nothing found, return the first one
+  if ptr=nil then
+    ptr:=GetResInfoPtr(nameptr^.subptr);
+
+  if ptr^.ncounthandle=0 then
+  begin
+    {$IFDEF EXTRES_MMAP}
+    reshandles[usedhandles]:=ptr;
+    {$ENDIF}
+    {$IFDEF EXTRES_GENERIC}
+    reshandles[usedhandles].info:=ptr;
+    {$ENDIF}
+    inc(usedhandles);
+    ptr^.ncounthandle:=usedhandles;
+  end;
+  ExtFindResourceEx:=ptr^.ncounthandle;
+end;
+
+{$IFDEF EXTRES_MMAP}
+Function ExtLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+begin
+  ExtLoadResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ExtLoadResource:=TFPResourceHGLOBAL(GetPtr(PResInfoNode(reshandles[ResHandle-1])^.subptr));
+end;
+
+Function ExtFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  ExtFreeResource:=(ResHeader<>nil);
+end;
+
+Function ExtSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+begin
+  ExtSizeofResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ExtSizeofResource:=PResInfoNode(reshandles[ResHandle-1])^.idcountsize;
+end;
+{$ENDIF}
+
+{$IFDEF EXTRES_GENERIC}
+(*
+Resource data memory layout:
+-2*sizeof(pointer)  Reference count
+  -sizeof(pointer)  Pointer to resource info
+                 0  Resource data
+*)
+Function ExtLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+var ptr : PPtrUInt;
+    tmp : longword;
+begin
+  ExtLoadResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+
+  if reshandles[ResHandle-1].ptr=nil then
+  begin
+    {$I-}
+    Seek(fd,reshandles[ResHandle-1].info^.subptr);
+    {$I+}
+    if IOResult<>0 then exit;
+    ptr:=GetMem(reshandles[ResHandle-1].info^.idcountsize+2*sizeof(PtrUint));
+    if ptr=nil then exit;
+    ptr^:=1; //refcount
+    inc(ptr);
+    ptr^:=PtrUInt(reshandles[ResHandle-1].info); //ptr to resource info
+    inc(ptr);
+    {$I-}
+    BlockRead(fd,ptr^,reshandles[ResHandle-1].info^.idcountsize,tmp);
+    {$I+}
+    if (IOResult<>0) or (tmp<>reshandles[ResHandle-1].info^.idcountsize) then
+    begin
+      FreeMem(ptr);
+      exit;
+    end;
+    reshandles[ResHandle-1].ptr:=ptr;
+  end
+  else
+  begin
+    ptr:=reshandles[ResHandle-1].ptr;
+    dec(ptr,2);
+    inc(ptr^,1); //increase reference count
+  end;
+  ExtLoadResource:=TFPResourceHGLOBAL(reshandles[ResHandle-1].ptr);
+end;
+
+Function ExtFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+var ptrinfo : PResInfoNode;
+    ptr : PPtrUInt;
+begin
+  ExtFreeResource:=(ResHeader<>nil);
+  if not ExtFreeResource then exit;
+  ptr:=PPtrUInt(ResData);
+  dec(ptr,2);
+  dec(ptr^); //decrease reference count
+  if ptr^=0 then
+  begin
+    inc(ptr);
+    ptrinfo:=PResInfoNode(ptr^);
+    dec(ptr);
+    FreeMem(ptr);
+    reshandles[ptrinfo^.ncounthandle-1].ptr:=nil;
+  end;
+  ExtFreeResource:=true;
+end;
+
+Function ExtSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+var ptrinfo : PResInfoNode;
+begin
+  ExtSizeofResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ptrinfo:=PResInfoNode(reshandles[ResHandle-1].info);
+  ExtSizeofResource:=ptrinfo^.idcountsize;
+end;
+{$ENDIF}
+
+Function ExtLockResource(ResData: TFPResourceHGLOBAL): Pointer;
+begin
+  ExtLockResource:=Nil;
+  if ResHeader=nil then exit;
+  ExtLockResource:=Pointer(ResData);
+end;
+
+Function ExtUnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  ExtUnlockResource:=(ResHeader<>nil);
+end;
+
+const
+  ExternalResourceManager : TResourceManager =
+  (
+    HINSTANCEFunc : @ExtHINSTANCE;
+    EnumResourceTypesFunc : @ExtEnumResourceTypes;
+    EnumResourceNamesFunc : @ExtEnumResourceNames;
+    EnumResourceLanguagesFunc : @ExtEnumResourceLanguages;
+    FindResourceFunc : @ExtFindResource;
+    FindResourceExFunc : @ExtFindResourceEx;
+    LoadResourceFunc : @ExtLoadResource;
+    SizeofResourceFunc : @ExtSizeofResource;
+    LockResourceFunc : @ExtLockResource;
+    UnlockResourceFunc : @ExtUnlockResource;
+    FreeResourceFunc : @ExtFreeResource;
+  );
+
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
+
+    Resource support as external files
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+{
+  This file implements two kinds of external resource support:
+   - one for systems that support the mmap call (usually unix-like oses)
+   - one fallback implementation based on pascal files and GetMem/FreeMem
+   
+  Be sure to define EXTRES_MMAP or EXTRES_GENERIC before including this file!
+}
+{$IF defined(EXTRES_MMAP) and defined(EXTRES_GENERIC)}
+{$FATAL EXTRES_MMAP and EXTRES_GENERIC can't be defined together}
+{$ENDIF}
+
+{$IF (not defined(EXTRES_MMAP)) and (not defined(EXTRES_GENERIC))}
+{$FATAL EXTRES_MMAP or EXTRES_GENERIC must be defined}
+{$ENDIF}
+
+const
+  FPCRES_MAGIC = 'FPCRES';
+  FPCRES_VERSION = 1;
+  {$IFDEF ENDIAN_BIG}
+  FPCRES_ENDIAN = 1;
+  {$ENDIF}
+  {$IFDEF ENDIAN_LITTLE}
+  FPCRES_ENDIAN = 2;
+  {$ENDIF}
+  FPCRES_EXT = '.fpcres';
+
+type
+  TExtHeader = packed record
+    magic : array[0..5] of char;//'FPCRES'
+    version : byte;             //EXT_CURRENT_VERSION
+    endianess : byte;           //EXT_ENDIAN_BIG or EXT_ENDIAN_LITTLE
+    count : longword;           //resource count
+    nodesize : longword;        //size of header (up to string table, excluded)
+    hdrsize  : longword;        //size of header (up to string table, included)
+    reserved1 : longword;
+    reserved2 : longword;
+    reserved3 : longword;
+  end;
+  PExtHeader = ^TExtHeader;
+
+  TResInfoNode = packed record
+    nameid : longword;          //name offset / integer ID / languageID
+    ncounthandle : longword;    //named sub-entries count/resource handle
+    idcountsize : longword;     //id sub-entries count / resource size
+    subptr : longword;          //first sub-entry offset
+  end;
+  PResInfoNode = ^TResInfoNode;
+
+  {$IFDEF EXTRES_GENERIC}
+  TResHandle = record
+    info : PResInfoNode;
+    ptr : Pointer;
+  end;
+  PResHandle = ^TResHandle;
+  {$ENDIF}
+
+var ResHeader : PExtHeader = nil;
+    usedhandles : longword = 0;
+    {$IFDEF EXTRES_MMAP}
+    fd : integer;
+    fd_size : longword;
+    reshandles : PPointer = nil;
+    {$ENDIF}
+    {$IFDEF EXTRES_GENERIC}
+    fd : file;
+    reshandles : PResHandle = nil;
+    {$ENDIF}
+
+(*****************************************************************************
+                             Private Helper Functions
+*****************************************************************************)
+
+//resource functions are case insensitive... copied from genstr.inc
+function ResStrIComp(Str1, Str2 : PChar): SizeInt;
+var
+  counter: SizeInt;
+  c1, c2: char;
+begin
+  counter := 0;
+  c1 := upcase(str1[counter]);
+  c2 := upcase(str2[counter]);
+  while c1 = c2 do
+  begin
+    if (c1 = #0) or (c2 = #0) then break;
+    inc(counter);
+    c1 := upcase(str1[counter]);
+    c2 := upcase(str2[counter]);
+  end;
+  ResStrIComp := ord(c1) - ord(c2);
+end;
+
+{!fixme!}
+//function InternalIsIntResource(aStr : pchar; out aInt : PtrUint) : boolean;
+function InternalIsIntResource(aStr : pchar; var aInt : PtrUint) : boolean;
+var i : integer;
+    s : shortstring;
+    code : word;
+begin
+  InternalIsIntResource:=((PtrUInt(aStr) shr 16)=0);
+  if InternalIsIntResource then aInt:=PtrUInt(aStr)
+  else
+  begin
+    //a string like #number specifies an integer id
+    if aStr[0]='#' then
+    begin
+      i:=1;
+      while aStr[i]<>#0 do
+        inc(i);
+      if i>256 then i:=256;
+      s[0]:=chr(i-1);
+      Move(aStr[1],s[1],i-1);
+      Val(s,aInt,code);
+      InternalIsIntResource:=code=0;
+    end;
+  end;
+end;
+
+function GetResInfoPtr(const offset : longword) : PResInfoNode; inline;
+begin
+  GetResInfoPtr:=PResInfoNode(PtrUInt(ResHeader)+offset);
+end;
+
+function GetPchar(const offset : longword) : Pchar; inline;
+begin
+  GetPchar:=Pchar(PtrUInt(ResHeader)+offset);
+end;
+
+function GetPtr(const offset : longword) : Pointer; inline;
+begin
+  GetPtr:=Pointer(PtrUInt(ResHeader)+offset);
+end;
+
+procedure FixResEndian;
+var ptr : plongword;
+    blockend : plongword;
+begin
+  //all info nodes reside in a contiguos block of memory.
+  //they are all 16 bytes long and made by longwords
+  //so, simply swap each longword in the block
+  ptr:=GetPtr(sizeof(TExtHeader));
+  blockend:=GetPtr(ResHeader^.nodesize);
+  while ptr<blockend do
+  begin
+    ptr^:=SwapEndian(ptr^);
+    inc(ptr);
+  end;
+end;
+
+function GetExtResPath : pchar;
+var len, i : integer;
+    pathstr : shortstring;
+begin
+  pathstr:=paramstr(0);
+  len:=byte(pathstr[0]);
+  i:=len;
+  //writeln('exe name is ',pathstr);
+  //find position of extension
+  while (i>0) and (not (pathstr[i] in ['.',DirectorySeparator])) do
+    dec(i);
+  if (i>0) and (pathstr[i]='.') then dec(i)
+  else i:=len;
+  pathstr[0]:=Chr(i);
+  pathstr:=pathstr+FPCRES_EXT;
+  len:=byte(pathstr[0]);
+  GetExtResPath:=GetMem(len+1);
+  Move(pathstr[1],GetExtResPath[0],len);
+  GetExtResPath[len]:=#0;
+  //writeln('Resource file is ',GetExtResPath);
+end;
+
+function BinSearchStr(arr : PResInfoNode; query : pchar; left, right : integer)
+: PResInfoNode;
+var pivot, res : integer;
+    resstr : pchar;
+begin
+  BinSearchStr:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    resstr:=GetPchar(arr[pivot].nameid);
+    res:=ResStrIComp(resstr,query);
+    if res<0 then left:=pivot+1
+    else if res>0 then right:=pivot-1
+    else
+    begin
+      BinSearchStr:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchInt(arr : PResInfoNode; query : pchar; left, right : integer)
+: PResInfoNode;
+var pivot : integer;
+begin
+  BinSearchInt:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    if arr[pivot].nameid<PtrUInt(query) then left:=pivot+1
+    else if arr[pivot].nameid>PtrUInt(query) then right:=pivot-1
+    else
+    begin
+      BinSearchInt:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchRes(root : PResInfoNode; aDesc : PChar) : PResInfoNode;
+var aID : PtrUint;
+begin
+  if InternalIsIntResource(aDesc,aID) then
+    BinSearchRes:=BinSearchInt(GetResInfoPtr(root^.subptr),PChar(aID),
+      root^.ncounthandle,root^.ncounthandle+root^.idcountsize-1)
+  else
+    BinSearchRes:=BinSearchStr(GetResInfoPtr(root^.subptr),aDesc,0,
+      root^.ncounthandle-1);
+end;
+
+//Returns a pointer to a name node.
+function InternalFindResource(ResourceName, ResourceType: PChar):
+ PResInfoNode;
+begin
+  InternalFindResource:=nil;
+  if ResHeader=nil then exit;
+  InternalFindResource:=GetResInfoPtr(sizeof(TExtHeader));
+
+  InternalFindResource:=BinSearchRes(InternalFindResource,ResourceType);
+  if InternalFindResource<>nil then
+    InternalFindResource:=BinSearchRes(InternalFindResource,ResourceName);
+end;
+
+function FindSubLanguage(aPtr : PResInfoNode; aLangID : word; aMask: word) : PResInfoNode;
+var arr : PResInfoNode;
+    i : longword;
+begin
+  FindSubLanguage:=nil;
+  arr:=GetResInfoPtr(aPtr^.subptr);
+  i:=0;
+  while i<aPtr^.idcountsize do
+  begin
+    if (PtrUInt(arr[i].nameid) and aMask)=(aLangID and aMask) then
+    begin
+      FindSubLanguage:=@arr[i];
+      exit;
+    end;
+    inc(i);
+  end;
+end;
+
+{$IFDEF EXTRES_MMAP}
+procedure InitResources;
+const
+  PROT_READ  = 1;
+  PROT_WRITE = 2;
+var respath : pchar;
+    fdstat : stat;
+begin
+  respath:=GetExtResPath;
+//  writeln('respath ',respath);
+  fd:=FpOpen(respath,O_RDONLY,0);
+//  writeln('fpopen returned ',fd);
+  FreeMem(respath);
+  if fd=-1 then exit;
+  if FpFStat(fd,fdstat)<>0 then
+  begin
+//    writeln('fpfstat failed');
+    FpClose(fd);
+    exit;
+  end;
+//  writeln('fpfstat suceeded');
+  fd_size:=fdstat.st_size;
+  ResHeader:=PExtHeader(Fpmmap(nil,fd_size,PROT_READ or PROT_WRITE,
+    MAP_PRIVATE,fd,0));
+//  writeln('fpmmap returned ',PtrInt(ResHeader));
+  if PtrInt(ResHeader)=-1 then
+  begin
+    FpClose(fd);
+    exit;
+  end;
+  if (ResHeader^.magic<>FPCRES_MAGIC) or
+    (ResHeader^.version<>fpcres_version) then
+  begin
+    FpClose(fd);
+    exit;
+  end;
+//  writeln('magic ok');
+  if ResHeader^.endianess<>FPCRES_ENDIAN then
+  begin
+    ResHeader^.count:=SwapEndian(ResHeader^.count);
+    ResHeader^.nodesize:=SwapEndian(ResHeader^.nodesize);
+    ResHeader^.hdrsize:=SwapEndian(ResHeader^.hdrsize);
+    FixResEndian;
+  end;
+  reshandles:=GetMem(sizeof(Pointer)*ResHeader^.count);
+  FillByte(reshandles^,sizeof(Pointer)*ResHeader^.count,0);
+end;
+
+procedure FinalizeResources;
+begin
+  if ResHeader=nil then exit;
+  FreeMem(reshandles);
+  Fpmunmap(ResHeader,fd_size);
+  FpClose(fd);
+end;
+{$ENDIF}
+
+{$IFDEF EXTRES_GENERIC}
+procedure InitResources;
+var respath : pchar;
+    tmp : longword;
+    tmpptr : pbyte;
+label ExitErrMem, ExitErrFile, ExitNoErr;
+begin
+  respath:=GetExtResPath;
+//  writeln('respath ',respath);
+  Assign(fd,respath);
+  FreeMem(respath);
+  {$I-}
+  Reset(fd,1);
+  {$I+}
+  if IOResult<>0 then exit;
+//  writeln('file opened');
+  ResHeader:=GetMem(sizeof(TExtHeader));
+  if ResHeader=nil then goto ExitErrFile;
+  {$I-}
+  BlockRead(fd,ResHeader^,sizeof(TExtHeader),tmp);
+  {$I+}
+  if (IOResult<>0) or (tmp<>sizeof(TExtHeader)) then goto ExitErrMem;
+  if (ResHeader^.magic<>FPCRES_MAGIC) or (ResHeader^.version<>fpcres_version)
+    then goto ExitErrMem;
+//  writeln('magic ok');
+  if ResHeader^.endianess<>FPCRES_ENDIAN then
+  begin
+    ResHeader^.count:=SwapEndian(ResHeader^.count);
+    ResHeader^.nodesize:=SwapEndian(ResHeader^.nodesize);
+    ResHeader^.hdrsize:=SwapEndian(ResHeader^.hdrsize);
+  end;
+  SysReallocMem(ResHeader,ResHeader^.hdrsize);
+  if ResHeader=nil then goto ExitErrFile;
+  tmpptr:=pbyte(ResHeader);
+  inc(tmpptr,sizeof(TExtHeader));
+  {$I-}
+  BlockRead(fd,tmpptr^,ResHeader^.hdrsize-sizeof(TExtHeader),tmp);
+  {$I+}
+  if (IOResult<>0) or (tmp<>ResHeader^.hdrsize-sizeof(TExtHeader)) then goto ExitErrMem;
+  if ResHeader^.endianess<>FPCRES_ENDIAN then
+    FixResEndian;
+  reshandles:=GetMem(sizeof(TResHandle)*ResHeader^.count);
+  FillByte(reshandles^,sizeof(TResHandle)*ResHeader^.count,0);
+  goto ExitNoErr;
+
+  ExitErrMem:
+    FreeMem(ResHeader);
+    ResHeader:=nil;
+  ExitErrFile:
+    {$I-}
+    Close(fd);
+    {$I+}
+  ExitNoErr:
+end;
+
+procedure FinalizeResources;
+begin
+  if ResHeader=nil then exit;
+  FreeMem(reshandles);
+  FreeMem(ResHeader);
+  Close(fd);
+end;
+{$ENDIF}
+
+(*****************************************************************************
+                             Public Resource Functions
+*****************************************************************************)
+
+Function ExtHINSTANCE : TFPResourceHMODULE;
+begin
+  ExtHINSTANCE:=0;
+end;
+
+function ExtEnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+var ptr : PResInfoNode;
+    totn, totid, i : longword;
+    pc : pchar;
+begin
+  ExtEnumResourceTypes:=False;
+  if ResHeader=nil then exit;
+  ptr:=GetResInfoPtr(sizeof(TExtHeader));
+  totn:=ptr^.ncounthandle;
+  totid:=totn+ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ptr^.subptr);
+  ExtEnumResourceTypes:=true;
+  i:=0;
+  while i<totn do //named entries
+  begin
+    pc:=GetPChar(ptr[i].nameid);
+    if not EnumFunc(ModuleHandle,pc,lParam) then exit;
+    inc(i);
+  end;
+  while i<totid do
+  begin
+    if not EnumFunc(ModuleHandle,PChar(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+function ExtEnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+var ptr : PResInfoNode;
+    totn, totid, i : longword;
+    pc : pchar;
+begin
+  ExtEnumResourceNames:=False;
+  if ResHeader=nil then exit;
+  ptr:=GetResInfoPtr(sizeof(TExtHeader));
+
+  ptr:=BinSearchRes(ptr,ResourceType);
+  if ptr=nil then exit;
+
+  totn:=ptr^.ncounthandle;
+  totid:=totn+ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ptr^.subptr);
+  ExtEnumResourceNames:=true;
+  i:=0;
+  while i<totn do //named entries
+  begin
+    pc:=GetPChar(ptr[i].nameid);
+    if not EnumFunc(ModuleHandle,ResourceType,pc,lParam) then exit;
+    inc(i);
+  end;
+  while i<totid do
+  begin
+    if not EnumFunc(ModuleHandle,ResourceType,PChar(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+function ExtEnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+var ptr : PResInfoNode;
+    tot, i : integer;
+begin
+  ExtEnumResourceLanguages:=False;
+  ptr:=InternalFindResource(ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  tot:=ptr^.idcountsize;
+  ptr:=GetResInfoPtr(ptr^.subptr);
+  ExtEnumResourceLanguages:=true;
+  i:=0;
+  while i<tot do
+  begin
+    if not EnumFunc(ModuleHandle,ResourceType,ResourceName,PtrUInt(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+Function ExtFindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar)
+: TFPResourceHandle;
+var ptr : PResInfoNode;
+begin
+  ExtFindResource:=0;
+  ptr:=InternalFindResource(ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  //first language id
+  ptr:=GetResInfoPtr(ptr^.subptr);
+  if ptr^.ncounthandle=0 then
+  begin
+    {$IFDEF EXTRES_MMAP}
+    reshandles[usedhandles]:=ptr;
+    {$ENDIF}
+    {$IFDEF EXTRES_GENERIC}
+    reshandles[usedhandles].info:=ptr;
+    {$ENDIF}
+    inc(usedhandles);
+    ptr^.ncounthandle:=usedhandles;
+  end;
+  ExtFindResource:=ptr^.ncounthandle;
+end;
+
+Function ExtFindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType,
+  ResourceName: PChar; Language : word): TFPResourceHandle;
+const LANG_NEUTRAL = 0;
+      LANG_ENGLISH = 9;
+var nameptr,ptr : PResInfoNode;
+begin
+  ExtFindResourceEx:=0;
+  nameptr:=InternalFindResource(ResourceName,ResourceType);
+  if nameptr=nil then exit;
+
+  //try exact match
+  ptr:=FindSubLanguage(nameptr,Language,$FFFF);
+  //try primary language
+  if ptr=nil then
+    ptr:=FindSubLanguage(nameptr,Language,$3FF);
+  //try language neutral
+  if ptr=nil then
+    ptr:=FindSubLanguage(nameptr,LANG_NEUTRAL,$3FF);
+  //try english
+  if ptr=nil then
+    ptr:=FindSubLanguage(nameptr,LANG_ENGLISH,$3FF);
+  //nothing found, return the first one
+  if ptr=nil then
+    ptr:=GetResInfoPtr(nameptr^.subptr);
+
+  if ptr^.ncounthandle=0 then
+  begin
+    {$IFDEF EXTRES_MMAP}
+    reshandles[usedhandles]:=ptr;
+    {$ENDIF}
+    {$IFDEF EXTRES_GENERIC}
+    reshandles[usedhandles].info:=ptr;
+    {$ENDIF}
+    inc(usedhandles);
+    ptr^.ncounthandle:=usedhandles;
+  end;
+  ExtFindResourceEx:=ptr^.ncounthandle;
+end;
+
+{$IFDEF EXTRES_MMAP}
+Function ExtLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+begin
+  ExtLoadResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ExtLoadResource:=TFPResourceHGLOBAL(GetPtr(PResInfoNode(reshandles[ResHandle-1])^.subptr));
+end;
+
+Function ExtFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  ExtFreeResource:=(ResHeader<>nil);
+end;
+
+Function ExtSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+begin
+  ExtSizeofResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ExtSizeofResource:=PResInfoNode(reshandles[ResHandle-1])^.idcountsize;
+end;
+{$ENDIF}
+
+{$IFDEF EXTRES_GENERIC}
+(*
+Resource data memory layout:
+-2*sizeof(pointer)  Reference count
+  -sizeof(pointer)  Pointer to resource info
+                 0  Resource data
+*)
+Function ExtLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+var ptr : PPtrUInt;
+    tmp : longword;
+begin
+  ExtLoadResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+
+  if reshandles[ResHandle-1].ptr=nil then
+  begin
+    {$I-}
+    Seek(fd,reshandles[ResHandle-1].info^.subptr);
+    {$I+}
+    if IOResult<>0 then exit;
+    ptr:=GetMem(reshandles[ResHandle-1].info^.idcountsize+2*sizeof(PtrUint));
+    if ptr=nil then exit;
+    ptr^:=1; //refcount
+    inc(ptr);
+    ptr^:=PtrUInt(reshandles[ResHandle-1].info); //ptr to resource info
+    inc(ptr);
+    {$I-}
+    BlockRead(fd,ptr^,reshandles[ResHandle-1].info^.idcountsize,tmp);
+    {$I+}
+    if (IOResult<>0) or (tmp<>reshandles[ResHandle-1].info^.idcountsize) then
+    begin
+      FreeMem(ptr);
+      exit;
+    end;
+    reshandles[ResHandle-1].ptr:=ptr;
+  end
+  else
+  begin
+    ptr:=reshandles[ResHandle-1].ptr;
+    dec(ptr,2);
+    inc(ptr^,1); //increase reference count
+  end;
+  ExtLoadResource:=TFPResourceHGLOBAL(reshandles[ResHandle-1].ptr);
+end;
+
+Function ExtFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+var ptrinfo : PResInfoNode;
+    ptr : PPtrUInt;
+begin
+  ExtFreeResource:=(ResHeader<>nil);
+  if not ExtFreeResource then exit;
+  ptr:=PPtrUInt(ResData);
+  dec(ptr,2);
+  dec(ptr^); //decrease reference count
+  if ptr^=0 then
+  begin
+    inc(ptr);
+    ptrinfo:=PResInfoNode(ptr^);
+    dec(ptr);
+    FreeMem(ptr);
+    reshandles[ptrinfo^.ncounthandle-1].ptr:=nil;
+  end;
+  ExtFreeResource:=true;
+end;
+
+Function ExtSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+var ptrinfo : PResInfoNode;
+begin
+  ExtSizeofResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>usedhandles) then exit;
+  ptrinfo:=PResInfoNode(reshandles[ResHandle-1].info);
+  ExtSizeofResource:=ptrinfo^.idcountsize;
+end;
+{$ENDIF}
+
+Function ExtLockResource(ResData: TFPResourceHGLOBAL): Pointer;
+begin
+  ExtLockResource:=Nil;
+  if ResHeader=nil then exit;
+  ExtLockResource:=Pointer(ResData);
+end;
+
+Function ExtUnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  ExtUnlockResource:=(ResHeader<>nil);
+end;
+
+const
+  ExternalResourceManager : TResourceManager =
+  (
+    HINSTANCEFunc : @ExtHINSTANCE;
+    EnumResourceTypesFunc : @ExtEnumResourceTypes;
+    EnumResourceNamesFunc : @ExtEnumResourceNames;
+    EnumResourceLanguagesFunc : @ExtEnumResourceLanguages;
+    FindResourceFunc : @ExtFindResource;
+    FindResourceExFunc : @ExtFindResourceEx;
+    LoadResourceFunc : @ExtLoadResource;
+    SizeofResourceFunc : @ExtSizeofResource;
+    LockResourceFunc : @ExtLockResource;
+    UnlockResourceFunc : @ExtUnlockResource;
+    FreeResourceFunc : @ExtFreeResource;
+  );
+

+ 94 - 0
rtl/inc/fpextres.pp

@@ -0,0 +1,94 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
+
+    External resource support
+    !!!NEVER USE THIS UNIT DIRECTLY!!!
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+unit fpextres;
+
+{$inline on}
+
+interface
+
+implementation
+
+{$ifdef UNIX}
+uses
+  baseunix;
+{$endif}
+
+{$ifdef DARWIN}
+  {$include extres_multiarch.inc}
+{$else}
+  {$ifdef UNIX}
+    {$define EXTRES_MMAP}
+  {$else}
+    {$define EXTRES_GENERIC}
+  {$endif}
+  {$include extres.inc}
+{$endif}
+
+initialization
+  InitResources;
+  SetResourceManager(ExternalResourceManager);
+
+finalization
+  FinalizeResources;
+
+end.
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
+
+    External resource support
+    !!!NEVER USE THIS UNIT DIRECTLY!!!
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+unit fpextres;
+
+{$inline on}
+
+interface
+
+implementation
+
+{$ifdef UNIX}
+uses
+  baseunix;
+{$endif}
+
+{$ifdef DARWIN}
+  {$include extres_multiarch.inc}
+{$else}
+  {$ifdef UNIX}
+    {$define EXTRES_MMAP}
+  {$else}
+    {$define EXTRES_GENERIC}
+  {$endif}
+  {$include extres.inc}
+{$endif}
+
+initialization
+  InitResources;
+  SetResourceManager(ExternalResourceManager);
+
+finalization
+  FinalizeResources;
+
+end.

+ 66 - 0
rtl/inc/fpintres.pp

@@ -0,0 +1,66 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
+
+    Internal resource support
+    !!!NEVER USE THIS UNIT DIRECTLY!!!
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+unit fpintres;
+
+interface
+
+implementation
+
+{$ifdef FPC_HAS_RESOURCES}
+  {$ifdef WINDOWS}
+    {$include winres.inc}
+  {$else}
+    {$include intres.inc}
+  {$endif}
+
+  initialization
+    SetResourceManager(InternalResourceManager);
+{$endif}
+
+end.
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
+
+    Internal resource support
+    !!!NEVER USE THIS UNIT DIRECTLY!!!
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+unit fpintres;
+
+interface
+
+implementation
+
+{$ifdef FPC_HAS_RESOURCES}
+  {$ifdef WINDOWS}
+    {$include winres.inc}
+  {$else}
+    {$include intres.inc}
+  {$endif}
+
+  initialization
+    SetResourceManager(InternalResourceManager);
+{$endif}
+
+end.

+ 348 - 0
rtl/inc/intres.inc

@@ -0,0 +1,348 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
+
+    Resource support for non-PECOFF targets (ELF, Mach-O)
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+type
+  PResInfoNode = ^TResInfoNode;
+  TResInfoNode = packed record
+    nameid : PChar;             //name / integer ID / languageID
+    ncounthandle : longword;    //named sub-entries count / resource handle
+    idcountsize : longword;     //id sub-entries count / resource size
+    subptr : PResInfoNode;      //first sub-entry pointer
+  end;
+
+  TResHdr = packed record
+    rootptr     : PResInfoNode; //pointer to root node
+    count       : longword;     //number of resources in the file
+    usedhandles : longword;     //last resource handle used
+    handles     : PPtrUint;     //pointer to handles
+  end;
+  PResHdr = ^TResHdr;
+
+
+//Needed to bootstrap the compiler: FPC_HAS_RESOURCES was buggy in previous
+//versions of the compiler
+{$ifdef VER2_0}
+  {$undef FPC_HAS_RESOURCES}
+{$endif}
+{$ifdef VER2_1}
+  {$undef FPC_HAS_RESOURCES}
+{$endif}
+{$ifdef VER2_2_0}
+  {$undef FPC_HAS_RESOURCES}
+{$endif}
+
+var
+{$ifdef FPC_HAS_RESOURCES}
+  ResHeader : PResHdr; external name 'FPC_RESLOCATION';
+{$else}
+  ResHeader : PResHdr= nil;
+{$endif}
+
+(*****************************************************************************
+                             Private Helper Functions
+*****************************************************************************)
+
+//resource functions are case insensitive... copied from genstr.inc
+function ResStrIComp(Str1, Str2 : PChar): SizeInt;
+var
+  counter: SizeInt;
+  c1, c2: char;
+begin
+  counter := 0;
+  c1 := upcase(str1[counter]);
+  c2 := upcase(str2[counter]);
+  while c1 = c2 do
+  begin
+    if (c1 = #0) or (c2 = #0) then break;
+    inc(counter);
+    c1 := upcase(str1[counter]);
+    c2 := upcase(str2[counter]);
+  end;
+  ResStrIComp := ord(c1) - ord(c2);
+end;
+
+{!fixme!}
+//function InternalIsIntResource(aStr : pchar; out aInt : PtrUint) : boolean;
+function InternalIsIntResource(aStr : pchar; var aInt : PtrUint) : boolean;
+var i : integer;
+    s : shortstring;
+    code : word;
+begin
+  InternalIsIntResource:=((PtrUInt(aStr) shr 16)=0);
+  if InternalIsIntResource then aInt:=PtrUInt(aStr)
+  else
+  begin
+    //a string like #number specifies an integer id
+    if aStr[0]='#' then
+    begin
+      i:=1;
+      while aStr[i]<>#0 do
+        inc(i);
+      if i>256 then i:=256;
+      s[0]:=chr(i-1);
+      Move(aStr[1],s[1],i-1);
+      Val(s,aInt,code);
+      InternalIsIntResource:=code=0;
+    end;
+  end;
+end;
+
+function BinSearchStr(arr : PResInfoNode; query : pchar; left, right : integer)
+: PResInfoNode;
+var pivot, res : integer;
+    resstr : pchar;
+begin
+  BinSearchStr:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    resstr:=arr[pivot].nameid;
+    res:=ResStrIComp(resstr,query);
+    if res<0 then left:=pivot+1
+    else if res>0 then right:=pivot-1
+    else
+    begin
+      BinSearchStr:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchInt(arr : PResInfoNode; query : pchar; left, right : integer)
+: PResInfoNode;
+var pivot : integer;
+begin
+  BinSearchInt:=nil;
+  while left<=right do
+  begin
+    pivot:=(left+right) div 2;
+    if PtrUint(arr[pivot].nameid)<PtrUInt(query) then left:=pivot+1
+    else if PtrUint(arr[pivot].nameid)>PtrUInt(query) then right:=pivot-1
+    else
+    begin
+      BinSearchInt:=@arr[pivot];
+      exit;
+    end;
+  end;
+end;
+
+function BinSearchRes(root : PResInfoNode; aDesc : PChar) : PResInfoNode;
+var aID : PtrUint;
+begin
+  if InternalIsIntResource(aDesc,aID) then
+    BinSearchRes:=BinSearchInt(root^.subptr,PChar(aID),root^.ncounthandle,
+      root^.ncounthandle+root^.idcountsize-1)
+  else
+    BinSearchRes:=BinSearchStr(root^.subptr,aDesc,0,root^.ncounthandle-1);
+end;
+
+//Returns a pointer to a name node.
+function InternalFindResource(ResourceName, ResourceType: PChar):
+ PResInfoNode;
+begin
+  InternalFindResource:=nil;
+  if ResHeader=nil then exit;
+  InternalFindResource:=ResHeader^.rootptr;
+
+  InternalFindResource:=BinSearchRes(InternalFindResource,ResourceType);
+  if InternalFindResource<>nil then
+    InternalFindResource:=BinSearchRes(InternalFindResource,ResourceName);
+end;
+
+function FindSubLanguage(aPtr : PResInfoNode; aLangID : word; aMask: word) : PResInfoNode;
+var arr : PResInfoNode;
+    i : longword;
+begin
+  FindSubLanguage:=nil;
+  arr:=aPtr^.subptr;
+  i:=0;
+  while i<aPtr^.idcountsize do
+  begin
+    if (PtrUInt(arr[i].nameid) and aMask)=(aLangID and aMask) then
+    begin
+      FindSubLanguage:=@arr[i];
+      exit;
+    end;
+    inc(i);
+  end;
+end;
+
+(*****************************************************************************
+                             Public Resource Functions
+*****************************************************************************)
+
+Function IntHINSTANCE : TFPResourceHMODULE;
+begin
+  IntHINSTANCE:=0;
+end;
+
+Function IntEnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+var ptr : PResInfoNode;
+    tot, i : integer;
+begin
+  IntEnumResourceTypes:=False;
+  if ResHeader=nil then exit;
+  tot:=ResHeader^.rootptr^.ncounthandle+ResHeader^.rootptr^.idcountsize;
+  ptr:=ResHeader^.rootptr^.subptr;
+  IntEnumResourceTypes:=true;
+  i:=0;
+  while i<tot do
+  begin
+    if not EnumFunc(ModuleHandle,ptr[i].nameid,lParam) then exit;
+    inc(i);
+  end;
+end;
+
+Function IntEnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+var ptr : PResInfoNode;
+    tot, i : integer;
+begin
+  IntEnumResourceNames:=False;
+  if ResHeader=nil then exit;
+  ptr:=ResHeader^.rootptr;
+
+  ptr:=BinSearchRes(ptr,ResourceType);
+  if ptr=nil then exit;
+  
+  tot:=ptr^.ncounthandle+ptr^.idcountsize;
+  ptr:=ptr^.subptr;
+  IntEnumResourceNames:=true;
+  i:=0;
+  while i<tot do
+  begin
+    if not EnumFunc(ModuleHandle,ResourceType,ptr[i].nameid,lParam) then exit;
+    inc(i);
+  end;
+end;
+
+Function IntEnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+var ptr : PResInfoNode;
+    tot, i : integer;
+begin
+  IntEnumResourceLanguages:=False;
+  ptr:=InternalFindResource(ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  tot:=ptr^.idcountsize;
+  ptr:=ptr^.subptr;
+  IntEnumResourceLanguages:=true;
+  i:=0;
+  while i<tot do
+  begin
+    if not EnumFunc(ModuleHandle,ResourceType,ResourceName,PtrUInt(ptr[i].nameid),lParam) then exit;
+    inc(i);
+  end;
+end;
+
+Function IntFindResource(ModuleHandle: TFPResourceHMODULE; ResourceName,
+  ResourceType: PChar): TFPResourceHandle;
+var ptr : PResInfoNode;
+begin
+  IntFindResource:=0;
+  ptr:=InternalFindResource(ResourceName,ResourceType);
+  if ptr=nil then exit;
+
+  //first language id
+  ptr:=ptr^.subptr;
+  if ptr^.ncounthandle=0 then
+  begin
+    ResHeader^.handles[ResHeader^.usedhandles]:=PtrUint(ptr);
+    inc(ResHeader^.usedhandles);
+    ptr^.ncounthandle:=ResHeader^.usedhandles;
+  end;
+  IntFindResource:=ptr^.ncounthandle;
+end;
+
+Function IntFindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType,
+  ResourceName: PChar; Language : word): TFPResourceHandle;
+const LANG_NEUTRAL = 0;
+      LANG_ENGLISH = 9;
+var nameptr,ptr : PResInfoNode;
+begin
+  IntFindResourceEx:=0;
+  nameptr:=InternalFindResource(ResourceName,ResourceType);
+  if nameptr=nil then exit;
+
+  //try exact match
+  ptr:=FindSubLanguage(nameptr,Language,$FFFF);
+  //try primary language
+  if ptr=nil then
+    ptr:=FindSubLanguage(nameptr,Language,$3FF);
+  //try language neutral
+  if ptr=nil then
+    ptr:=FindSubLanguage(nameptr,LANG_NEUTRAL,$3FF);
+  //try english
+  if ptr=nil then
+    ptr:=FindSubLanguage(nameptr,LANG_ENGLISH,$3FF);
+  //nothing found, return the first one
+  if ptr=nil then
+    ptr:=nameptr^.subptr;
+
+  if ptr^.ncounthandle=0 then
+  begin
+    ResHeader^.handles[ResHeader^.usedhandles]:=PtrUint(ptr);
+    inc(ResHeader^.usedhandles);
+    ptr^.ncounthandle:=ResHeader^.usedhandles;
+  end;
+  IntFindResourceEx:=ptr^.ncounthandle;
+end;
+
+Function IntLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+begin
+  IntLoadResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>ResHeader^.usedhandles) then exit;
+  IntLoadResource:=TFPResourceHGLOBAL(PResInfoNode(ResHeader^.handles[ResHandle-1])^.subptr);
+end;
+
+Function IntSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+begin
+  IntSizeofResource:=0;
+  if ResHeader=nil then exit;
+  if (ResHandle<=0) or (ResHandle>ResHeader^.usedhandles) then exit;
+  IntSizeofResource:=PResInfoNode(ResHeader^.handles[ResHandle-1])^.idcountsize;
+end;
+
+Function IntLockResource(ResData: TFPResourceHGLOBAL): Pointer;
+begin
+  IntLockResource:=Nil;
+  if ResHeader=nil then exit;
+  IntLockResource:=Pointer(ResData);
+end;
+
+Function IntUnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  IntUnlockResource:=(ResHeader<>nil);
+end;
+
+Function IntFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  IntFreeResource:=(ResHeader<>nil);
+end;
+
+const
+  InternalResourceManager : TResourceManager =
+  (
+    HINSTANCEFunc : @IntHINSTANCE;
+    EnumResourceTypesFunc : @IntEnumResourceTypes;
+    EnumResourceNamesFunc : @IntEnumResourceNames;
+    EnumResourceLanguagesFunc : @IntEnumResourceLanguages;
+    FindResourceFunc : @IntFindResource;
+    FindResourceExFunc : @IntFindResourceEx;
+    LoadResourceFunc : @IntLoadResource;
+    SizeofResourceFunc : @IntSizeofResource;
+    LockResourceFunc : @IntLockResource;
+    UnlockResourceFunc : @IntUnlockResource;
+    FreeResourceFunc : @IntFreeResource;
+  );

+ 55 - 11
rtl/inc/resh.inc

@@ -1,8 +1,13 @@
   
 type
+  //Obsolete types, kept for backwards compatibility
   TResourceHandle = Cardinal;
   HMODULE = Cardinal;
   HGLOBAL = Cardinal;
+  //New types
+  TFPResourceHandle = PtrUInt;
+  TFPResourceHMODULE = PtrUInt;
+  TFPResourceHGLOBAL = PtrUInt;
 {$ifdef UNICODE}
   {roozbeh : maybe it shoud be moved after ifndef mswindows,as there is one declared in wince,base.inc}
   MAKEINTRESOURCE = pwidechar;
@@ -28,18 +33,57 @@ const
   RT_RCDATA = MAKEINTRESOURCE(10);
   RT_MESSAGETABLE = MAKEINTRESOURCE(11);
   RT_GROUP_CURSOR = MAKEINTRESOURCE(12);
-  RT_GROUP_ICON = MAKEINTRESOURCE(13);
+  RT_GROUP_ICON = MAKEINTRESOURCE(14);
   RT_VERSION = MAKEINTRESOURCE(16);
+  RT_ANICURSOR = MAKEINTRESOURCE(21);
+  RT_ANIICON = MAKEINTRESOURCE(22);
+  RT_HTML = MAKEINTRESOURCE(23);
+  RT_MANIFEST = MAKEINTRESOURCE(24);
+
 {$endif MSWINDOWS }
-    
+
+// Win32 API compatible Resource callbacks
+type
+  EnumResTypeProc = function(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; lParam : PtrInt) : LongBool; stdcall;
+  EnumResNameProc = function(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; lParam : PtrInt) : LongBool; stdcall;
+  EnumResLangProc = function(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; IDLanguage : word; lParam : PtrInt) : LongBool; stdcall;
+
+// Useful functions (macros in win32 headers)
+function Is_IntResource(aStr : pchar) : boolean; {$ifdef SYSTEMINLINE}inline;{$endif}
+function MakeLangID(primary,sub : word) : word; {$ifdef SYSTEMINLINE}inline;{$endif}
+
 // Win32 API compatible Resource functions
-Function HINSTANCE : HMODULE;
-Function FindResource(ModuleHandle: HMODULE; ResourceName, ResourceType: PChar): TResourceHandle;
-Function FindResource(ModuleHandle: HMODULE; ResourceName, ResourceType: AnsiString): TResourceHandle;
-Function LoadResource(ModuleHandle: HMODULE; ResHandle: TResourceHandle): HGLOBAL;
-Function SizeofResource(ModuleHandle: HMODULE; ResHandle: TResourceHandle): Integer;
-Function LockResource(ResData: HGLOBAL): Pointer;
-Function UnlockResource(ResData: HGLOBAL): LongBool;
-Function FreeResource(ResData: HGLOBAL): LongBool;
+Function HINSTANCE : TFPResourceHMODULE;
+Function EnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+Function EnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+Function EnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+Function FindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar): TFPResourceHandle;
+Function FindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: PChar; Language : word): TFPResourceHandle;
+Function LoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+Function SizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+Function LockResource(ResData: TFPResourceHGLOBAL): Pointer;
+Function UnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+Function FreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
+Function FindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: AnsiString): TFPResourceHandle;
+Function FindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: AnsiString; Language : word): TFPResourceHandle;
+{$endif}
+
+type
+  TResourceManager = record
+    HINSTANCEFunc : function : TFPResourceHMODULE;
+    EnumResourceTypesFunc : function (ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+    EnumResourceNamesFunc : function (ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+    EnumResourceLanguagesFunc : function (ModuleHandle : TFPResourceHMODULE; ResourceType,ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+    FindResourceFunc : function (ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar): TFPResourceHandle;
+    FindResourceExFunc : function (ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: PChar; Language : word): TFPResourceHandle;
+    LoadResourceFunc : function (ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+    SizeofResourceFunc : function (ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+    LockResourceFunc : function (ResData: TFPResourceHGLOBAL): Pointer;
+    UnlockResourceFunc : function (ResData: TFPResourceHGLOBAL): LongBool;
+    FreeResourceFunc : function (ResData: TFPResourceHGLOBAL): LongBool;
+  end;
+
+procedure GetResourceManager (var Manager : TResourceManager);
+procedure SetResourceManager (const New : TResourceManager);
 
-      

+ 167 - 10
rtl/inc/sysres.inc

@@ -1,41 +1,198 @@
-Function HINSTANCE : HMODULE;
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by Giulio Bernardi
 
+    Resource support
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    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.
+
+ **********************************************************************}
+
+(*****************************************************************************
+                             Utility functions
+*****************************************************************************)
+
+function Is_IntResource(aStr : pchar) : boolean; {$ifdef SYSTEMINLINE}inline;{$endif}
 begin
-  Result:=0;
+  Result:=((PtrUInt(aStr) shr 16)=0);
+end;
+
+function MakeLangID(primary,sub : word) : word; {$ifdef SYSTEMINLINE}inline;{$endif}
+begin
+  Result:=(primary and $3FF) or (sub shl 10);
+end;
+
+(*****************************************************************************
+                             Overloaded functions
+*****************************************************************************)
+
+{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
+Function FindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: AnsiString): TFPResourceHandle;
+
+begin
+  Result:=FindResource(ModuleHandle,PChar(ResourceName),PChar(ResourceType));
+end;
+
+Function FindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: AnsiString; Language : word): TFPResourceHandle;
+
+begin
+  Result:=FindResourceEx(ModuleHandle,PChar(ResourceType),PChar(ResourceName),Language);
 end;
+{$endif}
 
-Function FindResource(ModuleHandle: HMODULE; ResourceName, ResourceType: PChar): TResourceHandle;
+(*****************************************************************************
+                             Default resource support
+*****************************************************************************)
+{ These functions are the default ones on systems where resources aren't
+  supported }
 
+Function DefaultHINSTANCE : TFPResourceHMODULE;
 begin
   Result:=0;
 end;
 
-Function LoadResource(ModuleHandle: HMODULE; ResHandle: TResourceHandle): HGLOBAL;
+Function DefaultEnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+begin
+  Result:=False;
+end;
+
+Function DefaultEnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+begin
+  Result:=False;
+end;
+
+Function DefaultEnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+begin
+  Result:=False;
+end;
 
+Function DefaultFindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar): TFPResourceHandle;
 begin
   Result:=0;
 end;
 
-Function SizeofResource(ModuleHandle: HMODULE; ResHandle: TResourceHandle): Integer;
+Function DefaultFindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: PChar; Language : word): TFPResourceHandle;
+begin
+  Result:=0;
+end;
 
+Function DefaultLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
 begin
-  Result:=-1;
+  Result:=0;
 end;
 
-Function LockResource(ResData: HGLOBAL): Pointer;
+Function DefaultSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+begin
+  Result:=0;
+end;
 
+Function DefaultLockResource(ResData: TFPResourceHGLOBAL): Pointer;
 begin
   Result:=Nil;
 end;
 
-Function UnlockResource(ResData: HGLOBAL): LongBool;
+Function DefaultUnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  Result:=False;
+end;
 
+Function DefaultFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
 begin
   Result:=False;
 end;
 
-Function FreeResource(ResData: HGLOBAL): LongBool;
+(*****************************************************************************
+            Resource manager and accessor functions
+*****************************************************************************)
+
+var
+  resourcemanager : TResourceManager =
+  (
+    HINSTANCEFunc : @DefaultHINSTANCE;
+    EnumResourceTypesFunc : @DefaultEnumResourceTypes;
+    EnumResourceNamesFunc : @DefaultEnumResourceNames;
+    EnumResourceLanguagesFunc : @DefaultEnumResourceLanguages;
+    FindResourceFunc : @DefaultFindResource;
+    FindResourceExFunc : @DefaultFindResourceEx;
+    LoadResourceFunc : @DefaultLoadResource;
+    SizeofResourceFunc : @DefaultSizeofResource;
+    LockResourceFunc : @DefaultLockResource;
+    UnlockResourceFunc : @DefaultUnlockResource;
+    FreeResourceFunc : @DefaultFreeResource;
+  );
 
+procedure GetResourceManager (Var Manager : TResourceManager);
 begin
-  Result:=False;
+  Manager:=resourcemanager;
+end;
+
+procedure SetResourceManager (Const New : TResourceManager);
+begin
+  resourcemanager:=New;
+end;
+
+(*****************************************************************************
+                             Resources function
+*****************************************************************************)
+{ These functions will call the specified resource manager functions }
+
+Function HINSTANCE : TFPResourceHMODULE;
+begin
+  Result:=resourcemanager.HINSTANCEFunc();
+end;
+
+Function EnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+begin
+  Result:=resourcemanager.EnumResourceTypesFunc(ModuleHandle,EnumFunc,lParam);
+end;
+
+Function EnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+begin
+  Result:=resourcemanager.EnumResourceNamesFunc(ModuleHandle,ResourceType,EnumFunc,lParam);
+end;
+
+Function EnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+begin
+  Result:=resourcemanager.EnumResourceLanguagesFunc(ModuleHandle,ResourceType,ResourceName,EnumFunc,lParam);
+end;
+
+Function FindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar): TFPResourceHandle;
+begin
+  Result:=resourcemanager.FindResourceFunc(ModuleHandle,ResourceName,ResourceType);
 end;
+
+Function FindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: PChar; Language : word): TFPResourceHandle;
+begin
+  Result:=resourcemanager.FindResourceExFunc(ModuleHandle,ResourceType,ResourceName,Language);
+end;
+
+Function LoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+begin
+  Result:=resourcemanager.LoadResourceFunc(ModuleHandle,ResHandle);
+end;
+
+Function SizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+begin
+  Result:=resourcemanager.SizeofResourceFunc(ModuleHandle,ResHandle);
+end;
+
+Function LockResource(ResData: TFPResourceHGLOBAL): Pointer;
+begin
+  Result:=resourcemanager.LockResourceFunc(ResData);
+end;
+
+Function UnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  Result:=resourcemanager.UnlockResourceFunc(ResData);
+end;
+
+Function FreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  Result:=resourcemanager.FreeResourceFunc(ResData);
+end;
+

+ 2 - 12
rtl/inc/system.inc

@@ -1,7 +1,7 @@
 {
 
     This file is part of the Free Pascal Run time library.
-    Copyright (c) 1999-2000 by the Free Pascal development team
+    Copyright (c) 1999-2008 by the Free Pascal development team
 
     See the file COPYING.FPC, included in this distribution,
     For details about the copyright.
@@ -773,6 +773,7 @@ Procedure FinalizeHeap;forward;
 {$endif HAS_MEMORYMANAGER}
 {$endif FPC_HAS_FEATURE_HEAP}
 
+
 Procedure InternalExit;
 var
   current_exit : Procedure;
@@ -1272,18 +1273,7 @@ end;
                             Resources support
 *****************************************************************************}
 
-
-{$ifndef HAS_RESOURCES}
 {$i sysres.inc}
-{$endif}
-
-{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
-Function FindResource(ModuleHandle: HMODULE; ResourceName, ResourceType: AnsiString): TResourceHandle;
-
-begin
-  Result:=FindResource(ModuleHandle,PChar(ResourceName),PChar(ResourceType));
-end;
-{$endif}
 
 const
   CtrlBreakHandler: TCtrlBreakHandler = nil;

+ 65 - 1031
rtl/linux/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
+MAKEFILETARGETS=i386-linux m68k-linux powerpc-linux sparc-linux x86_64-linux arm-linux powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -270,1117 +270,151 @@ override FPCOPT+=-Ur
 endif
 OBJPASDIR=$(RTL)/objpas
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix fpintres
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix fpintres
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_LOADERS+=$(LOADERS)
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_LOADERS+=$(LOADERS)
-endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_LOADERS+=$(LOADERS)
-endif
 ifeq ($(FULL_TARGET),sparc-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_LOADERS+=$(LOADERS)
-endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_LOADERS+=$(LOADERS)
-endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_LOADERS+=$(LOADERS)
-endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_LOADERS+=$(LOADERS)
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_LOADERS+=$(LOADERS)
-endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),i386-beos)
+ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
-ifeq ($(FULL_TARGET),i386-netbsd)
+ifeq ($(FULL_TARGET),powerpc-linux)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
-ifeq ($(FULL_TARGET),i386-solaris)
+ifeq ($(FULL_TARGET),sparc-linux)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
-ifeq ($(FULL_TARGET),i386-qnx)
+ifeq ($(FULL_TARGET),x86_64-linux)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
-ifeq ($(FULL_TARGET),i386-netware)
+ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
-ifeq ($(FULL_TARGET),i386-openbsd)
+ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),i386-linux)
+override CLEAN_UNITS+=syslinux linux
 endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),m68k-linux)
+override CLEAN_UNITS+=syslinux linux
 endif
-ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),powerpc-linux)
+override CLEAN_UNITS+=syslinux linux
 endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),sparc-linux)
+override CLEAN_UNITS+=syslinux linux
 endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),x86_64-linux)
+override CLEAN_UNITS+=syslinux linux
 endif
-ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),arm-linux)
+override CLEAN_UNITS+=syslinux linux
 endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override CLEAN_UNITS+=syslinux linux
 endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+override INSTALL_FPCPACKAGE=y
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
 endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
 endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
 endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
 endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
 endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
 endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
 endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
 endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
 endif
-ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_TARGETDIR+=.
 endif
-ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_TARGETDIR+=.
 endif
-ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_TARGETDIR+=.
 endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_TARGETDIR+=.
 endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_TARGETDIR+=.
 endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
-endif
-ifeq ($(FULL_TARGET),i386-linux)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-emx)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override CLEAN_UNITS+=syslinux linux
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override CLEAN_UNITS+=syslinux linux
-endif
-override INSTALL_FPCPACKAGE=y
-ifeq ($(FULL_TARGET),i386-linux)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-emx)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
-endif
-ifeq ($(FULL_TARGET),i386-linux)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-emx)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_TARGETDIR+=.
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
-endif
-ifeq ($(FULL_TARGET),i386-linux)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-emx)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override COMPILER_TARGETDIR+=.
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
 override COMPILER_TARGETDIR+=.
 endif
 override SHARED_LIBUNITS=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes fgl variants sysconst rtlconsts 

+ 2 - 1
rtl/linux/Makefile.fpc

@@ -16,7 +16,8 @@ units=$(SYSTEMUNIT) $(SYSINIT_UNITS) \
       charset ucomplex getopts \
       errors sockets gpm ipc serial terminfo dl dynlibs \
       video mouse keyboard variants types dateutils sysconst fmtbcd \
-      cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix
+      cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix \
+      fpintres
 
 rsts=math varutils typinfo variants sysconst rtlconsts stdconvs
 

+ 0 - 11
rtl/linux/system.pp

@@ -19,10 +19,6 @@
 { If you use an aout system, set the conditional AOUT}
 { $Define AOUT}
 
-{$ifdef CPUI386}
-{$DEFINE ELFRES32}
-{$endif}
-
 Unit System;
 
 {*****************************************************************************}
@@ -57,13 +53,6 @@ var
   sysenter_supported: LongInt = 0;
 {$endif}
 
-{ Include ELF resources }
-
-{$ifdef ELFRES32}
-{$define HAS_RESOURCES}
-{$i elfres32.inc}
-{$endif}
-
 const calculated_cmdline:Pchar=nil;
 
 {$if defined(CPUARM) or defined(CPUM68K)}

+ 1 - 1
rtl/macos/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 1 - 1
rtl/morphos/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 1 - 1
rtl/nds/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 54 - 54
rtl/netbsd/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -270,163 +270,163 @@ else
 CPU_UNITS=
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings syscall baseunix $(LINUXUNIT) unix rtlconsts initc dos crt objects printer matrix sysutils types fgl classes typinfo math varutils fmtbcd charset ucomplex getopts heaptrc lineinfo lnfodwrf errors sockets terminfo video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) fpintres
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt0 cprt0

+ 2 - 1
rtl/netbsd/Makefile.fpc

@@ -16,7 +16,8 @@ units=$(SYSTEMUNIT) objpas macpas strings syscall baseunix \
       sysutils types fgl classes typinfo math varutils fmtbcd \
       charset ucomplex getopts heaptrc lineinfo lnfodwrf \
       errors sockets terminfo \
-      video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS)
+      video mouse keyboard  serial variants types sysctl sysconst fpmkunit $(CPU_UNITS) \
+      fpintres
       # ipc
 
 rsts=math varutils typinfo variants classes sysconst fpmkunit

+ 1 - 1
rtl/netware/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 1 - 1
rtl/netwlibc/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 2 - 1
rtl/openbsd/Makefile.fpc

@@ -16,7 +16,8 @@ units=$(SYSTEMUNIT) objpas macpas strings syscall baseunix \
       sysutils fgl classes fmtbcd typinfo math varutils \
        charset ucomplex getopts heaptrc lineinfo lnfodwrf \
       errors sockets gpm ipc terminfo \
-      video mouse keyboard  serial variants types systhrds sysctl sysconst
+      video mouse keyboard  serial variants types systhrds sysctl sysconst \
+      fpintres
 units_netbsd_i386=mmx cpu
 rsts=math varutils typinfo variants classes sysconst
 

+ 1 - 1
rtl/os2/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 1 - 1
rtl/palmos/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 54 - 54
rtl/solaris/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -261,163 +261,163 @@ ifndef USELIBGGI
 USELIBGGI=NO
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas heaptrc lineinfo lnfodwrf baseunix unixutil termio unix initc cmem crt printer sysutils typinfo math fgl classes matrix varutils charset ucomplex getopts errors sockets terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst strutils fmtbcd rtlconsts cthreads dos objects cwstring fpintres
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst rtlconst

+ 1 - 1
rtl/solaris/Makefile.fpc

@@ -21,7 +21,7 @@ units=$(SYSTEMUNIT) unixtype ctypes strings objpas macpas \
       keyboard variants types dateutils sysconst \
       strutils fmtbcd rtlconsts cthreads \
       dos objects \
-      cwstring
+      cwstring fpintres
 
 
 rsts=math varutils typinfo classes variants dateutils sysconst rtlconst

+ 1 - 1
rtl/symbian/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded

+ 1 - 1
rtl/win/sysos.inc

@@ -205,7 +205,7 @@ threadvar
    { module functions }
    function GetModuleFileName(l1:longint;p:pointer;l2:longint):longint;
      {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'GetModuleFileName' + ApiSuffix;
-   function GetModuleHandle(p : pointer) : longint;
+   function GetModuleHandle(p : pointer) : PtrUInt;
      {$ifdef wince}cdecl{$else}stdcall{$endif};external KernelDLL name 'GetModuleHandle' + ApiSuffix;
 
    { file functions }

+ 57 - 22
rtl/win/winres.inc

@@ -1,48 +1,83 @@
+function SysEnumResourceTypes(hModule : TFPResourceHMODULE; lpEnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool; stdcall; external 'kernel32' name 'EnumResourceTypesA';
+function SysEnumResourceNames(hModule : TFPResourceHMODULE; lpszType : PChar; lpEnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool; stdcall; external 'kernel32' name 'EnumResourceNamesA';
+function SysEnumResourceLanguages(hModule : TFPResourceHMODULE; lpType : PChar; lpName : PChar; lpEnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool; stdcall; external 'kernel32' name 'EnumResourceLanguagesA';
+function SysFindResource(hModule:TFPResourceHMODULE; lpName:Pchar; lpType:Pchar):TFPResourceHandle; stdcall; external 'kernel32' name 'FindResourceA';
+function SysFindResourceEx(hModule:TFPResourceHMODULE; lpType:Pchar; lpName:Pchar; Language : WORD):TFPResourceHandle; stdcall; external 'kernel32' name 'FindResourceExA';
+function SysLoadResource(hModule:TFPResourceHMODULE; hResInfo:TFPResourceHandle):TFPResourceHGLOBAL; stdcall; external 'kernel32' name 'LoadResource';
+function SysSizeofResource(hModule:TFPResourceHMODULE; hResInfo:TFPResourceHandle):DWORD; stdcall; external 'kernel32' name 'SizeofResource';
+function SysLockResource(hResData:TFPResourceHGLOBAL):Pointer; stdcall; external 'kernel32' name 'LockResource';
+function SysFreeResource(hResData:TFPResourceHGLOBAL):Longbool; stdcall; external 'kernel32' name 'FreeResource';
 
-function SysFindResource(hModule:HMODULE; lpName:Pchar; lpType:Pchar):TResourceHandle; stdcall; external 'kernel32' name 'FindResourceA';
-function SysLoadResource(hModule:HMODULE; hResInfo:TResourceHandle):HGLOBAL; stdcall; external 'kernel32' name 'LoadResource';
-function SysSizeofResource(hModule:HMODULE; hResInfo:TResourceHandle):DWORD; stdcall; external 'kernel32' name 'SizeofResource';
-function SysLockResource(hResData:HGLOBAL):Pointer; stdcall; external 'kernel32' name 'LockResource';
-function SysFreeResource(hResData:HGLOBAL):Longbool; stdcall; external 'kernel32' name 'FreeResource';
-
-Function HINSTANCE : HMODULE;
+var
+  SysInstance : PtrUInt;external name {$ifdef win64} 'SysInstance' {$else} '_FPC_SysInstance' {$endif} ;
 
+Function IntHINSTANCE : TFPResourceHMODULE;
 begin
-  Result:=sysinstance;
+  IntHINSTANCE:=sysinstance;
 end;
 
-Function FindResource(ModuleHandle: HMODULE; ResourceName, ResourceType: PChar): TResourceHandle;
-
+Function IntEnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
 begin
-  Result:=SysFindResource(ModuleHandle,ResourceName,ResourceType);
+  IntEnumResourceTypes:=SysEnumResourceTypes(ModuleHandle,EnumFunc,lParam);
 end;
 
-Function LoadResource(ModuleHandle: HMODULE; ResHandle: TResourceHandle): HGLOBAL;
-
+Function IntEnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
 begin
-  Result:=SysLoadresource(ModuleHandle,Reshandle);
+  IntEnumResourceNames:=SysEnumResourceNames(ModuleHandle,ResourceType,EnumFunc,lParam);
 end;
 
-Function SizeofResource(ModuleHandle: HMODULE; ResHandle: TResourceHandle): Integer;
+Function IntEnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+begin
+  IntEnumResourceLanguages:=SysEnumResourceLanguages(ModuleHandle,ResourceType,ResourceName,EnumFunc,lParam);
+end;
 
+Function IntFindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar): TFPResourceHandle;
 begin
-  Result:=SysSizeofResource(ModuleHandle,Reshandle);
+  IntFindResource:=SysFindResource(ModuleHandle,ResourceName,ResourceType);
 end;
 
-Function LockResource(ResData: HGLOBAL): Pointer;
+Function IntFindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: PChar; Language : word): TFPResourceHandle;
+begin
+  IntFindResourceEx:=SysFindResourceEx(ModuleHandle,ResourceType,ResourceName,Language);
+end;
 
+Function IntLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
 begin
-  Result:=SysLockResource(ResData);
+  IntLoadResource:=SysLoadresource(ModuleHandle,Reshandle);
 end;
 
-Function UnlockResource(ResData: HGLOBAL): LongBool;
+Function IntSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+begin
+  IntSizeofResource:=SysSizeofResource(ModuleHandle,Reshandle);
+end;
 
+Function IntLockResource(ResData: TFPResourceHGLOBAL): Pointer;
 begin
-  Result:=FreeResource(ResData);
+  IntLockResource:=SysLockResource(ResData);
 end;
 
-Function FreeResource(ResData: HGLOBAL): LongBool;
+Function IntUnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  IntUnlockResource:=SysFreeResource(ResData);
+end;
 
+Function IntFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
 begin
-  Result:=SysFreeResource(ResData);
+  IntFreeResource:=SysFreeResource(ResData);
 end;
+
+const
+  InternalResourceManager : TResourceManager =
+  (
+    HINSTANCEFunc : @IntHINSTANCE;
+    EnumResourceTypesFunc : @IntEnumResourceTypes;
+    EnumResourceNamesFunc : @IntEnumResourceNames;
+    EnumResourceLanguagesFunc : @IntEnumResourceLanguages;
+    FindResourceFunc : @IntFindResource;
+    FindResourceExFunc : @IntFindResourceEx;
+    LoadResourceFunc : @IntLoadResource;
+    SizeofResourceFunc : @IntSizeofResource;
+    LockResourceFunc : @IntLockResource;
+    UnlockResourceFunc : @IntUnlockResource;
+    FreeResourceFunc : @IntFreeResource;
+  );

+ 54 - 54
rtl/win32/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/12/21]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -419,163 +419,163 @@ ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_UNITS+=system objpas macpas buildrtl lineinfo
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem
+override TARGET_IMPLICITUNITS+=sysinitpas sysinitcyg sysinitgprof ctypes strings heaptrc matrix windows winsock winsock2 initc cmem dynlibs signals dos crt objects messages rtlconsts sysconst sysutils math types strutils dateutils varutils variants typinfo fgl classes convutils stdconvs cpu mmx charset ucomplex getopts winevent sockets printer video mouse keyboard fmtbcd winsysut sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=$(LOADERS)

+ 1 - 1
rtl/win32/Makefile.fpc

@@ -18,7 +18,7 @@ implicitunits=sysinitpas sysinitcyg sysinitgprof \
       convutils stdconvs cpu mmx charset ucomplex getopts \
       winevent sockets printer \
       video mouse keyboard fmtbcd \
-      winsysut sharemem
+      winsysut sharemem fpintres
 
 # shared=$(DLLS)
 

+ 1 - 1
rtl/win32/buildrtl.pp

@@ -13,7 +13,7 @@ unit buildrtl;
       convutils, stdconvs, cpu, mmx, charset, ucomplex, getopts,
       winevent, sockets, printer,
       video, mouse, keyboard, fmtbcd,
-      winsysut, sharemem;
+      winsysut, sharemem, fpintres;
 
   implementation
 

+ 2 - 7
rtl/win32/system.pp

@@ -116,11 +116,6 @@ var
   EntryInformation : TEntryInformation;
   SysInstance : Longint;public name '_FPC_SysInstance';
 
-{$ifdef CPUI386}
-{$define HAS_RESOURCES}
-{$i winres.inc}
-{$endif}
-
 { used by wstrings.inc because wstrings.inc is included before sysos.inc
   this is put here (FK) }
 
@@ -1179,7 +1174,7 @@ type
      DataDirectory : array[1..$80] of byte;
   end;
 begin
-  result:=tpeheader((pointer(HInstance)+(tdosheader(pointer(HInstance)^).e_lfanew))^).SizeOfStackReserve;
+  result:=tpeheader((pointer(SysInstance)+(tdosheader(pointer(SysInstance)^).e_lfanew))^).SizeOfStackReserve;
 end;
 
 {
@@ -1201,7 +1196,7 @@ begin
   if not IsLibrary then
     SysInstance:=getmodulehandle(GetCommandFile);
 
-  MainInstance:=HInstance;
+  MainInstance:=SysInstance;
 
   { pass dummy value }
   StackLength := CheckInitialStkLen($1000000);

+ 54 - 54
rtl/win64/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/12/21]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -415,163 +415,163 @@ ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_UNITS+=system objpas macpas buildrtl lineinfo
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem
+override TARGET_IMPLICITUNITS+=ctypes strings heaptrc matrix dos crt objects messages windows winsock winsock2 cmem dynlibs rtlconsts sysconst sysutils math types strutils convutils dateutils varutils variants typinfo fgl classes getopts stdconvs sockets printer charset ucomplex fmtbcd winevent video mouse keyboard sharemem fpintres
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=$(LOADERS)

+ 1 - 1
rtl/win64/Makefile.fpc

@@ -17,7 +17,7 @@ implicitunits=ctypes strings \
       varutils variants typinfo fgl classes getopts \
       stdconvs sockets printer charset ucomplex fmtbcd \
       winevent video mouse keyboard \
-      sharemem
+      sharemem fpintres
 #      fpcmemdll
 #     winsysut signals
 #     cpu mmx

+ 1 - 1
rtl/win64/buildrtl.pp

@@ -12,7 +12,7 @@ unit buildrtl;
       convutils, stdconvs, charset, ucomplex, getopts,
       winevent, sockets, printer,
       video, mouse, keyboard, fmtbcd,
-      sharemem;
+      sharemem, fpintres;
 
   implementation
 

+ 5 - 8
rtl/win64/system.pp

@@ -91,7 +91,7 @@ var
 { Win32 Info }
   startupinfo : tstartupinfo;
   hprevinst,
-  MainInstance,
+  MainInstance : qword;
   cmdshow     : longint;
   DLLreason,DLLparam:longint;
 type
@@ -107,10 +107,7 @@ const
 implementation
 
 var
-  SysInstance : Longint;public;
-
-{$define HAS_RESOURCES}
-{$i winres.inc}
+  SysInstance : qword;public;
 
 { used by wstrings.inc because wstrings.inc is included before sysos.inc
   this is put here (FK) }
@@ -514,7 +511,7 @@ begin
 end;
 
 
-procedure _FPC_DLLMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLMainCRTStartup';
+procedure _FPC_DLLMainCRTStartup(_hinstance : qword;_dllreason,_dllparam:longint);stdcall;public name '_DLLMainCRTStartup';
 begin
   IsConsole:=true;
   sysinstance:=_hinstance;
@@ -524,7 +521,7 @@ begin
 end;
 
 
-procedure _FPC_DLLWinMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLWinMainCRTStartup';
+procedure _FPC_DLLWinMainCRTStartup(_hinstance : qword;_dllreason,_dllparam:longint);stdcall;public name '_DLLWinMainCRTStartup';
 begin
   IsConsole:=false;
   sysinstance:=_hinstance;
@@ -1159,7 +1156,7 @@ begin
   hprevinst:=0;
   if not IsLibrary then
     SysInstance:=getmodulehandle(GetCommandFile);
-  MainInstance:=HInstance;
+  MainInstance:=SysInstance;
   cmdshow:=startupinfo.wshowwindow;
   { Setup heap }
   InitHeap;

+ 54 - 54
rtl/wince/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/12/21]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/14]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -260,163 +260,163 @@ GRAPHDIR=$(INC)/graph
 include $(WININC)/makefile.inc
 WINDOWS_SOURCE_FILES=$(addprefix $(WININC)/,$(addsuffix .inc,$(WINDOWS_FILES)))
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx
+override TARGET_UNITS+=$(SYSTEMUNIT) ctypes objpas macpas strings lineinfo heaptrc windows messages dynlibs dos objects rtlconsts sysconst sysutils typinfo types fgl classes strutils convutils math dateutils varutils variants fmtbcd matrix ucomplex charset getopts winsock winsock2 sockets cmem sharemem gx fpintres
 endif
 override INSTALL_FPCPACKAGE=y
 ifeq ($(FULL_TARGET),i386-linux)

+ 1 - 1
rtl/wince/Makefile.fpc

@@ -17,7 +17,7 @@ units=$(SYSTEMUNIT) ctypes objpas macpas strings \
       matrix ucomplex \
       charset getopts winsock winsock2 sockets \
       cmem sharemem \
-      gx
+      gx fpintres
 #    initc  signals \
 #    crt graph \
 #    wincrt winmouse winevent  printer \

+ 1 - 4
rtl/wince/system.pp

@@ -202,10 +202,7 @@ function argv: ppchar;
 implementation
 
 var
-  SysInstance : Longint;
-
-{$define HAS_RESOURCES}
-{$i winres.inc}
+  SysInstance : Longint;public name '_FPC_SysInstance';
 
 function MessageBox(w1:longint;l1,l2:PWideChar;w2:longint):longint;
    cdecl; external 'coredll' name 'MessageBoxW';

+ 92 - 53
rtl/wince/winres.inc

@@ -1,53 +1,92 @@
-
-function SysFindResource(hModule:HMODULE; lpName: PWideChar; lpType: PWideChar):TResourceHandle; cdecl; external 'coredll' name 'FindResourceW';
-function SysLoadResource(hModule:HMODULE; hResInfo: TResourceHandle):HGLOBAL; cdecl; external 'coredll' name 'LoadResource';
-function SysSizeofResource(hModule:HMODULE; hResInfo:TResourceHandle):DWORD; cdecl; external 'coredll' name 'SizeofResource';
-
-Function HINSTANCE: HMODULE;
-begin
-  Result:=sysinstance;
-end;
-
-Function FindResource(ModuleHandle: HMODULE; ResourceName, ResourceType: PChar): TResourceHandle;
-var
-  ws1, ws2: PWideChar;
-begin
-  if cardinal(ResourceName) shr 16 <> 0 then
-    ws1:=PCharToPWideChar(ResourceName)
-  else
-    ws1:=pointer(ResourceName);
-  if cardinal(ResourceType) shr 16 <> 0 then
-    ws2:=PCharToPWideChar(ResourceType)
-  else
-    ws2:=pointer(ResourceType);
-  Result:=SysFindResource(ModuleHandle, ws1, ws2);
-  if cardinal(ResourceType) shr 16 <> 0 then
-    FreeMem(ws2);
-  if cardinal(ResourceName) shr 16 <> 0 then
-    FreeMem(ws1);
-end;
-
-Function LoadResource(ModuleHandle: HMODULE; ResHandle: TResourceHandle): HGLOBAL;
-begin
-  Result:=SysLoadresource(ModuleHandle,Reshandle);
-end;
-
-Function SizeofResource(ModuleHandle: HMODULE; ResHandle: TResourceHandle): Integer;
-begin
-  Result:=SysSizeofResource(ModuleHandle,Reshandle);
-end;
-
-Function LockResource(ResData: HGLOBAL): Pointer;
-begin
-  Result:=pointer(ResData);
-end;
-
-Function UnlockResource(ResData: HGLOBAL): LongBool;
-begin
-  UnlockResource := True;
-end;
-
-Function FreeResource(ResData: HGLOBAL): LongBool;
-begin
-  FreeResource := True;
-end;
+
+function SysFindResource(hModule:TFPResourceHMODULE; lpName: PWideChar; lpType: PWideChar):TFPResourceHandle; cdecl; external 'coredll' name 'FindResourceW';
+function SysLoadResource(hModule:TFPResourceHMODULE; hResInfo: TFPResourceHandle):TFPResourceHGLOBAL; cdecl; external 'coredll' name 'LoadResource';
+function SysSizeofResource(hModule:TFPResourceHMODULE; hResInfo:TFPResourceHandle):DWORD; cdecl; external 'coredll' name 'SizeofResource';
+
+var
+  SysInstance : PtrUInt;external name '_FPC_SysInstance' ;
+
+Function IntHINSTANCE: TFPResourceHMODULE;
+begin
+  IntHINSTANCE:=sysinstance;
+end;
+
+Function IntEnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
+begin
+  IntEnumResourceTypes:=False;
+end;
+
+Function IntEnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
+begin
+  IntEnumResourceNames:=False;
+end;
+
+Function IntEnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
+begin
+  IntEnumResourceLanguages:=False;
+end;
+
+Function IntFindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar): TFPResourceHandle;
+var
+  ws1, ws2: PWideChar;
+begin
+  if PtrUInt(ResourceName) shr 16 <> 0 then
+    ws1:=PCharToPWideChar(ResourceName)
+  else
+    ws1:=pointer(ResourceName);
+  if PtrUInt(ResourceType) shr 16 <> 0 then
+    ws2:=PCharToPWideChar(ResourceType)
+  else
+    ws2:=pointer(ResourceType);
+  IntFindResource:=SysFindResource(ModuleHandle, ws1, ws2);
+  if PtrUInt(ResourceType) shr 16 <> 0 then
+    FreeMem(ws2);
+  if PtrUInt(ResourceName) shr 16 <> 0 then
+    FreeMem(ws1);
+end;
+
+Function IntFindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: PChar; Language : word): TFPResourceHandle;
+begin
+  IntFindResourceEx:=FindResource(ModuleHandle,ResourceName,ResourceType);
+end;
+
+Function IntLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
+begin
+  IntLoadResource:=SysLoadresource(ModuleHandle,Reshandle);
+end;
+
+Function IntSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
+begin
+  IntSizeofResource:=SysSizeofResource(ModuleHandle,Reshandle);
+end;
+
+Function IntLockResource(ResData: TFPResourceHGLOBAL): Pointer;
+begin
+  IntLockResource:=pointer(ResData);
+end;
+
+Function IntUnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  IntUnlockResource:= True;
+end;
+
+Function IntFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
+begin
+  IntFreeResource:= True;
+end;
+
+const
+  InternalResourceManager : TResourceManager =
+  (
+    HINSTANCEFunc : @IntHINSTANCE;
+    EnumResourceTypesFunc : @IntEnumResourceTypes;
+    EnumResourceNamesFunc : @IntEnumResourceNames;
+    EnumResourceLanguagesFunc : @IntEnumResourceLanguages;
+    FindResourceFunc : @IntFindResource;
+    FindResourceExFunc : @IntFindResourceEx;
+    LoadResourceFunc : @IntLoadResource;
+    SizeofResourceFunc : @IntSizeofResource;
+    LockResourceFunc : @IntLockResource;
+    UnlockResourceFunc : @IntUnlockResource;
+    FreeResourceFunc : @IntFreeResource;
+  );