Răsfoiți Sursa

Merged from recent trunk.

git-svn-id: branches/laksen/armiw@29369 -
Jeppe Johansen 10 ani în urmă
părinte
comite
7390acc426
100 a modificat fișierele cu 5386 adăugiri și 2571 ștergeri
  1. 13 3
      .gitattributes
  2. 6 1
      compiler/aggas.pas
  3. 1 2
      compiler/arm/aasmcpu.pas
  4. 6 1
      compiler/globals.pas
  5. 8 0
      compiler/globtype.pas
  6. 36 20
      compiler/htypechk.pas
  7. 42 2
      compiler/i8086/n8086inl.pas
  8. 38 6
      compiler/jvm/dbgjasm.pas
  9. 1 1
      compiler/mips/cpugas.pas
  10. 92 1
      compiler/mips/ncpuadd.pas
  11. 2 2
      compiler/msg/errord.msg
  12. 2 2
      compiler/msg/errordu.msg
  13. 45 7
      compiler/msg/errore.msg
  14. 2 2
      compiler/msg/errorpt.msg
  15. 2 2
      compiler/msg/errorptu.msg
  16. 8 2
      compiler/msgidx.inc
  17. 268 258
      compiler/msgtxt.inc
  18. 1 1
      compiler/ncal.pas
  19. 6 5
      compiler/ncgcal.pas
  20. 5 2
      compiler/nflw.pas
  21. 8 3
      compiler/ngenutil.pas
  22. 1 0
      compiler/ninl.pas
  23. 14 8
      compiler/optdfa.pas
  24. 40 18
      compiler/options.pas
  25. 4 7
      compiler/optloop.pas
  26. 4 1
      compiler/pdecobj.pas
  27. 12 3
      compiler/pdecsub.pas
  28. 7 5
      compiler/pinline.pas
  29. 1 1
      compiler/powerpc/agppcvasm.pas
  30. 1 1
      compiler/ppcgen/agppcgas.pas
  31. 6 1
      compiler/psub.pas
  32. 0 3
      compiler/raatt.pas
  33. 101 2
      compiler/symdef.pas
  34. 2 2
      compiler/systems/i_linux.pas
  35. 1 1
      compiler/systems/t_sunos.pas
  36. 1 1
      compiler/utils/samplecfg
  37. 1 1
      compiler/x86/aasmcpu.pas
  38. 13 1
      ide/fp.pas
  39. 1 1
      ide/fpviews.pas
  40. 117 10
      installer/install.dat
  41. 1 1
      installer/install.pas
  42. 8 4
      packages/Makefile
  43. 3 2
      packages/Makefile.fpc
  44. 1 1
      packages/amunits/src/coreunits/intuition.pas
  45. 1 1
      packages/arosunits/src/workbench.pas
  46. 3 3
      packages/fcl-db/src/sqldb/sqldb.pp
  47. 0 16
      packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp
  48. 81 18
      packages/fcl-process/src/process.pp
  49. 10 3
      packages/fpmkunit/Makefile
  50. 1 1
      packages/fpmkunit/Makefile.fpc
  51. 254 123
      packages/fpmkunit/src/fpmkunit.pp
  52. 66 37
      packages/fppkg/src/pkgcommands.pp
  53. 26 7
      packages/fppkg/src/pkgfpmake.pp
  54. 9 1
      packages/fv/src/amismsg.inc
  55. 6 0
      packages/fv/src/app.pas
  56. 2 1
      packages/fv/src/drivers.pas
  57. 3 3
      packages/gtk2/examples/gtk_demo/drawingarea.inc
  58. 1 1
      packages/gtk2/examples/helloworld/helloworld.pas
  59. 3 3
      packages/gtk2/examples/scribble_simple/scribble_simple.pas
  60. 1025 85
      packages/libndsfpc/examples/graphics/Effects/windows/Makefile
  61. 2 2
      packages/libndsfpc/examples/graphics/Effects/windows/Makefile.fpc
  62. 1027 87
      packages/libndsfpc/examples/graphics/Ext_Palettes/backgrounds/Makefile
  63. 2 2
      packages/libndsfpc/examples/graphics/Ext_Palettes/backgrounds/Makefile.fpc
  64. 1 1
      packages/morphunits/src/intuition.pas
  65. 161 2
      packages/rtl-console/src/amicommon/keyboard.pp
  66. 0 8
      packages/rtl-console/src/amicommon/mouse.pp
  67. 180 44
      packages/rtl-console/src/amicommon/video.pp
  68. 0 606
      packages/rtl-console/src/aros/video.pp
  69. 0 650
      packages/rtl-console/src/morphos/video.pp
  70. 50 23
      packages/rtl-objpas/src/inc/variants.pp
  71. 1 1
      packages/zlib/fpmake.pp
  72. 161 130
      rtl/amicommon/dos.pp
  73. 182 32
      rtl/amicommon/sysutils.pp
  74. 64 5
      rtl/android/Makefile
  75. 3 2
      rtl/android/Makefile.fpc
  76. 43 6
      rtl/android/jvm/Makefile
  77. 10 2
      rtl/android/jvm/Makefile.fpc
  78. 24 4
      rtl/darwin/Makefile
  79. 2 2
      rtl/darwin/Makefile.fpc
  80. 345 79
      rtl/gba/Makefile
  81. 1 1
      rtl/gba/Makefile.fpc
  82. 0 4
      rtl/i8086/i8086.inc
  83. 82 0
      rtl/inc/dynarr.inc
  84. 8 0
      rtl/inc/dynarrh.inc
  85. 16 0
      rtl/inc/rtti.inc
  86. 18 0
      rtl/inc/rttih.inc
  87. 8 0
      rtl/inc/systemh.inc
  88. 3 1
      rtl/m68k/m68k.inc
  89. 345 79
      rtl/nds/Makefile
  90. 1 1
      rtl/nds/Makefile.fpc
  91. 5 1
      rtl/objpas/sysutils/fina.inc
  92. 7 2
      rtl/objpas/unicodedata.pas
  93. 101 80
      rtl/solaris/Makefile
  94. 1 1
      rtl/solaris/Makefile.fpc
  95. 31 9
      rtl/unix/cwstring.pp
  96. 1 1
      rtl/unix/unixcp.pp
  97. 2 2
      rtl/win/wininc/unifun.inc
  98. 1 0
      rtl/wince/wininc/coredll.inc
  99. 18 0
      tests/test/tgeneric97.pp
  100. 56 0
      tests/test/thlp47.pp

+ 13 - 3
.gitattributes

@@ -6597,10 +6597,9 @@ packages/rtl-console/Makefile.fpc.fpcmake svneol=native#text/plain
 packages/rtl-console/fpmake.pp svneol=native#text/plain
 packages/rtl-console/src/amicommon/keyboard.pp svneol=native#text/plain
 packages/rtl-console/src/amicommon/mouse.pp svneol=native#text/plain
+packages/rtl-console/src/amicommon/video.pp svneol=native#text/plain
 packages/rtl-console/src/amicommon/videodata.inc svneol=native#text/plain
 packages/rtl-console/src/amiga/crt.pp svneol=native#text/plain
-packages/rtl-console/src/amiga/video.pp svneol=native#text/plain
-packages/rtl-console/src/aros/video.pp svneol=native#text/plain
 packages/rtl-console/src/emx/crt.pp svneol=native#text/plain
 packages/rtl-console/src/go32v2/crt.pp svneol=native#text/plain
 packages/rtl-console/src/go32v2/keyboard.pp svneol=native#text/plain
@@ -6616,7 +6615,6 @@ packages/rtl-console/src/inc/mouse.inc svneol=native#text/plain
 packages/rtl-console/src/inc/mouseh.inc svneol=native#text/plain
 packages/rtl-console/src/inc/video.inc svneol=native#text/plain
 packages/rtl-console/src/inc/videoh.inc svneol=native#text/plain
-packages/rtl-console/src/morphos/video.pp svneol=native#text/plain
 packages/rtl-console/src/msdos/crt.pp svneol=native#text/plain
 packages/rtl-console/src/msdos/keyboard.pp svneol=native#text/plain
 packages/rtl-console/src/netware/crt.pp svneol=native#text/plain
@@ -8379,6 +8377,7 @@ rtl/inc/readme -text
 rtl/inc/real2str.inc svneol=native#text/plain
 rtl/inc/resh.inc svneol=native#text/plain
 rtl/inc/rtti.inc svneol=native#text/plain
+rtl/inc/rttih.inc svneol=native#text/plain
 rtl/inc/sfpu128.pp svneol=native#text/pascal
 rtl/inc/sfpux80.pp svneol=native#text/pascal
 rtl/inc/softfpu.pp svneol=native#text/plain
@@ -11700,6 +11699,7 @@ tests/test/tgeneric93.pp svneol=native#text/pascal
 tests/test/tgeneric94.pp svneol=native#text/pascal
 tests/test/tgeneric95.pp svneol=native#text/pascal
 tests/test/tgeneric96.pp svneol=native#text/pascal
+tests/test/tgeneric97.pp svneol=native#text/pascal
 tests/test/tgoto.pp svneol=native#text/plain
 tests/test/theap.pp svneol=native#text/plain
 tests/test/theapthread.pp svneol=native#text/plain
@@ -11748,6 +11748,7 @@ tests/test/thlp43.pp svneol=native#text/pascal
 tests/test/thlp44.pp svneol=native#text/pascal
 tests/test/thlp45.pp svneol=native#text/pascal
 tests/test/thlp46.pp svneol=native#text/pascal
+tests/test/thlp47.pp svneol=native#text/pascal
 tests/test/thlp5.pp svneol=native#text/pascal
 tests/test/thlp6.pp svneol=native#text/pascal
 tests/test/thlp7.pp svneol=native#text/pascal
@@ -11801,6 +11802,7 @@ tests/test/tisoread.pp svneol=native#text/pascal
 tests/test/tisorec1.pp svneol=native#text/pascal
 tests/test/tisorec2.pp svneol=native#text/pascal
 tests/test/tisorec3.pp svneol=native#text/pascal
+tests/test/tisorec4.pp svneol=native#text/pascal
 tests/test/tlea1.pp svneol=native#text/plain
 tests/test/tlea2.pp svneol=native#text/plain
 tests/test/tlib1a.pp svneol=native#text/plain
@@ -12594,6 +12596,7 @@ tests/test/units/sysutils/twstrcmp.pp svneol=native#text/plain
 tests/test/units/ucomplex/tcsqr1.pp svneol=native#text/pascal
 tests/test/units/variants/tcustomvariant.pp svneol=native#text/plain
 tests/test/units/variants/tvararrayofintf.pp svneol=native#text/plain
+tests/test/units/variants/tw26370.pp svneol=native#text/plain
 tests/test/units/variants/tw27044.pp svneol=native#text/plain
 tests/test/uobjc24.pp svneol=native#text/plain
 tests/test/uobjc26.pp svneol=native#text/plain
@@ -14101,6 +14104,8 @@ tests/webtbs/tw25869.pp svneol=native#text/plain
 tests/webtbs/tw2588.pp svneol=native#text/plain
 tests/webtbs/tw2589.pp svneol=native#text/plain
 tests/webtbs/tw25895.pp svneol=native#text/pascal
+tests/webtbs/tw25916a.pp svneol=native#text/pascal
+tests/webtbs/tw25916b.pp svneol=native#text/pascal
 tests/webtbs/tw25929.pp svneol=native#text/pascal
 tests/webtbs/tw25930.pp svneol=native#text/plain
 tests/webtbs/tw25931.pp -text svneol=native#text/plain
@@ -14126,9 +14131,11 @@ tests/webtbs/tw2627.pp svneol=native#text/plain
 tests/webtbs/tw26271.pp svneol=native#text/pascal
 tests/webtbs/tw26288.pp svneol=native#text/pascal
 tests/webtbs/tw2631.pp svneol=native#text/plain
+tests/webtbs/tw26403.pp svneol=native#text/pascal
 tests/webtbs/tw26408.pp svneol=native#text/pascal
 tests/webtbs/tw2643.pp svneol=native#text/plain
 tests/webtbs/tw2645.pp svneol=native#text/plain
+tests/webtbs/tw26467.pp svneol=native#text/pascal
 tests/webtbs/tw2647.pp svneol=native#text/plain
 tests/webtbs/tw26482.pp svneol=native#text/pascal
 tests/webtbs/tw2649.pp svneol=native#text/plain
@@ -14163,7 +14170,10 @@ tests/webtbs/tw2706.pp svneol=native#text/plain
 tests/webtbs/tw2707.pp svneol=native#text/plain
 tests/webtbs/tw2708.pp svneol=native#text/plain
 tests/webtbs/tw2710.pp svneol=native#text/plain
+tests/webtbs/tw27120.pp svneol=native#text/pascal
 tests/webtbs/tw2713.pp svneol=native#text/plain
+tests/webtbs/tw27153.pp svneol=native#text/pascal
+tests/webtbs/tw27185.pp svneol=native#text/pascal
 tests/webtbs/tw2721.pp svneol=native#text/plain
 tests/webtbs/tw2723.pp svneol=native#text/plain
 tests/webtbs/tw2725.pp svneol=native#text/plain

+ 6 - 1
compiler/aggas.pas

@@ -1448,7 +1448,12 @@ implementation
              begin
                WriteDirectiveName(tai_directive(hp).directive);
                if tai_directive(hp).name <>'' then
-                 AsmWrite(tai_directive(hp).name);
+                 begin
+                   if replaceforbidden then
+                     AsmWrite(ReplaceForbiddenAsmSymbolChars(tai_directive(hp).name))
+                   else
+                     AsmWrite(tai_directive(hp).name);
+                 end;
                AsmLn;
              end;
 

+ 1 - 2
compiler/arm/aasmcpu.pas

@@ -2198,8 +2198,7 @@ implementation
                   ot:=OT_MODEFLAGS;
                 end;
               else
-                begin writeln(typ);
-                internalerror(200402261); end;
+                internalerror(2004022623);
             end;
           end;
       end;

+ 6 - 1
compiler/globals.pas

@@ -834,8 +834,13 @@ implementation
            Replace(s,'$FPCTARGET',target_os_string)
          else
            Replace(s,'$FPCTARGET',target_full_string);
-         Replace(s,'$SUBARCH',lower(cputypestr[init_settings.cputype]));
+         Replace(s,'$FPCSUBARCH',lower(cputypestr[init_settings.cputype]));
          Replace(s,'$FPCABI',lower(abiinfo[target_info.abi].name));
+{$ifdef i8086}
+         Replace(s,'$FPCMEMORYMODEL',lower(x86memorymodelstr[init_settings.x86memorymodel]));
+{$else i8086}
+         Replace(s,'$FPCMEMORYMODEL','flat');
+{$endif i8086}
 {$ifdef mswindows}
          ReplaceSpecialFolder('$LOCAL_APPDATA',CSIDL_LOCAL_APPDATA);
          ReplaceSpecialFolder('$APPDATA',CSIDL_APPDATA);

+ 8 - 0
compiler/globtype.pas

@@ -705,6 +705,14 @@ interface
 
     type
       tx86memorymodel = (mm_tiny,mm_small,mm_medium,mm_compact,mm_large,mm_huge);
+    const
+      x86memorymodelstr : array[tx86memorymodel] of string[7]=(
+        'TINY',
+        'SMALL',
+        'MEDIUM',
+        'COMPACT',
+        'LARGE',
+        'HUGE');
 
   { hide Sysutils.ExecuteProcess in units using this one after SysUtils}
   const

+ 36 - 20
compiler/htypechk.pas

@@ -26,7 +26,7 @@ unit htypechk;
 interface
 
     uses
-      cclasses,tokens,cpuinfo,
+      cclasses,cmsgs,tokens,cpuinfo,
       node,globtype,
       symconst,symtype,symdef,symsym,symbase;
 
@@ -178,6 +178,8 @@ interface
       arrays, records and objects are checked recursively }
     function is_valid_for_default(def:tdef):boolean;
 
+    procedure UninitializedVariableMessage(pos : tfileposinfo;warning,local,managed : boolean;name : TMsgStr);
+
 implementation
 
     uses
@@ -1092,6 +1094,23 @@ implementation
       end;
 
 
+    procedure UninitializedVariableMessage(pos : tfileposinfo;warning,local,managed : boolean;name : TMsgStr);
+      const
+        msg : array[false..true,false..true,false..true] of dword = (
+            (
+              (sym_h_uninitialized_variable,sym_h_uninitialized_managed_variable),
+              (sym_h_uninitialized_local_variable,sym_h_uninitialized_managed_local_variable)
+            ),
+            (
+              (sym_w_uninitialized_variable,sym_w_uninitialized_managed_variable),
+              (sym_w_uninitialized_local_variable,sym_w_uninitialized_managed_local_variable)
+            )
+          );
+      begin
+        CGMessagePos1(pos,msg[warning,local,managed],name);
+      end;
+
+
     procedure set_varstate(p:tnode;newstate:tvarstate;varstateflags:tvarstateflags);
       const
         vstrans: array[tvarstate,tvarstate] of tvarstate = (
@@ -1197,32 +1216,29 @@ implementation
                                  if (vo_is_funcret in hsym.varoptions) then
                                    begin
                                      if (vsf_use_hints in varstateflags) then
-                                       CGMessagePos(p.fileinfo,sym_h_function_result_uninitialized)
-                                     else
-                                       CGMessagePos(p.fileinfo,sym_w_function_result_uninitialized)
-                                   end
-                                 else
-                                   begin
-                                     if tloadnode(p).symtable.symtabletype=localsymtable then
                                        begin
-                                         { on the JVM, an uninitialized var-parameter
-                                           is just as fatal as a nil pointer dereference }
-                                         if (vsf_use_hints in varstateflags) and
-                                            not(target_info.system in systems_jvm) then
-                                           CGMessagePos1(p.fileinfo,sym_h_uninitialized_local_variable,hsym.realname)
+                                         if is_managed_type(hsym.vardef) then
+                                           CGMessagePos(p.fileinfo,sym_h_managed_function_result_uninitialized)
                                          else
-                                           CGMessagePos1(p.fileinfo,sym_w_uninitialized_local_variable,hsym.realname);
+                                           CGMessagePos(p.fileinfo,sym_h_function_result_uninitialized);
                                        end
                                      else
                                        begin
-                                         { on the JVM, an uninitialized var-parameter
-                                           is just as fatal as a nil pointer dereference }
-                                         if (vsf_use_hints in varstateflags) and
-                                            not(target_info.system in systems_jvm) then
-                                           CGMessagePos1(p.fileinfo,sym_h_uninitialized_variable,hsym.realname)
+                                         if is_managed_type(hsym.vardef) then
+                                           CGMessagePos(p.fileinfo,sym_w_managed_function_result_uninitialized)
                                          else
-                                           CGMessagePos1(p.fileinfo,sym_w_uninitialized_variable,hsym.realname);
+                                          CGMessagePos(p.fileinfo,sym_w_function_result_uninitialized);
                                        end;
+                                   end
+                                 else
+                                   begin
+                                     UninitializedVariableMessage(p.fileinfo,
+                                       { on the JVM, an uninitialized var-parameter
+                                         is just as fatal as a nil pointer dereference }
+                                       not((vsf_use_hints in varstateflags) and not(target_info.system in systems_jvm)),
+                                       tloadnode(p).symtable.symtabletype=localsymtable,
+                                       is_managed_type(tloadnode(p).resultdef),
+                                       hsym.realname);
                                    end;
                                end;
                            end

+ 42 - 2
compiler/i8086/n8086inl.pas

@@ -37,6 +37,7 @@ interface
          function first_seg: tnode; override;
          procedure second_seg; override;
          procedure second_get_frame;override;
+         function first_IncDec: tnode;override;
          procedure second_incdec;override;
        end;
 
@@ -52,9 +53,9 @@ implementation
     defutil,
     aasmbase,aasmtai,aasmdata,aasmcpu,
     symtype,symdef,symcpu,
-    cgbase,pass_2,
+    cgbase,pass_1,pass_2,
     cpuinfo,cpubase,paramgr,
-    nbas,ncon,ncal,ncnv,nld,ncgutil,
+    nbas,nadd,ncon,ncal,ncnv,nld,ncgutil,
     tgobj,
     cga,cgutils,cgx86,cgobj,hlcgobj,
     htypechk,procinfo;
@@ -138,6 +139,45 @@ implementation
            inherited second_get_frame;
        end;
 
+     function ti8086inlinenode.first_IncDec: tnode;
+       var
+         procname:string;
+         elesize: Tconstexprint;
+         hp: tnode;
+       begin
+         if is_hugepointer(tcallparanode(left).left.resultdef) then
+           begin
+             case inlinenumber of
+               in_inc_x:
+                 procname:='fpc_hugeptr_inc_longint';
+               in_dec_x:
+                 procname:='fpc_hugeptr_dec_longint';
+               else
+                 internalerror(2014121001);
+             end;
+             if cs_hugeptr_arithmetic_normalization in current_settings.localswitches then
+               procname:=procname+'_normalized';
+
+             if is_void(tpointerdef(tcallparanode(left).left.resultdef).pointeddef) then
+               elesize:=1
+             else
+               elesize:=tpointerdef(tcallparanode(left).left.resultdef).pointeddef.size;
+
+             hp := cordconstnode.create(elesize,s32inttype,false);
+             { extra parameter? }
+             if assigned(tcallparanode(left).right) then
+               hp:=caddnode.create(muln,hp,tcallparanode(tcallparanode(left).right).left.getcopy);
+
+             result:=ccallnode.createintern(procname,
+                       ccallparanode.create(hp,
+                       ccallparanode.create(tcallparanode(left).left.getcopy,nil)));
+             typecheckpass(result);
+             firstpass(result);
+           end
+         else
+           result:=inherited;
+       end;
+
      procedure ti8086inlinenode.second_incdec;
        const
          addsubop:array[in_inc_x..in_dec_x] of TOpCG=(OP_ADD,OP_SUB);

+ 38 - 6
compiler/jvm/dbgjasm.pas

@@ -38,9 +38,10 @@ interface
       TDebugInfoJasmin=class(TDebugInfo)
       protected
         fcurrprocstart,
+        fcurrprocafterstart,
         fcurrprocend: tasmsymbol;
 
-        procedure appendsym_localsym(list: TAsmList; sym: tabstractnormalvarsym);
+        procedure appendsym_localsym(list: TAsmList; sym: tabstractnormalvarsym; startlab: tasmsymbol);
 
         procedure appendsym_paravar(list:TAsmList;sym:tparavarsym);override;
         procedure appendsym_localvar(list:TAsmList;sym:tlocalvarsym);override;
@@ -65,7 +66,7 @@ implementation
                               TDebugInfoJasmin
 ****************************************************************************}
 
-  procedure TDebugInfoJasmin.appendsym_localsym(list: TAsmList; sym: tabstractnormalvarsym);
+  procedure TDebugInfoJasmin.appendsym_localsym(list: TAsmList; sym: tabstractnormalvarsym; startlab: tasmsymbol);
     var
       jvar: tai_jvar;
       proc: tprocdef;
@@ -75,20 +76,20 @@ implementation
       if not(sym.localloc.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
         exit;
       proc:=tprocdef(sym.owner.defowner);
-      jvar:=tai_jvar.create(sym.localloc.reference.offset,jvmmangledbasename(sym,true),fcurrprocstart,fcurrprocend);
+      jvar:=tai_jvar.create(sym.localloc.reference.offset,jvmmangledbasename(sym,true),startlab,fcurrprocend);
       tcpuprocdef(proc).exprasmlist.InsertAfter(jvar,proc.procstarttai);
     end;
 
 
   procedure TDebugInfoJasmin.appendsym_paravar(list: TAsmList; sym: tparavarsym);
     begin
-      appendsym_localsym(list,sym);
+      appendsym_localsym(list,sym,fcurrprocstart);
     end;
 
 
   procedure TDebugInfoJasmin.appendsym_localvar(list: TAsmList; sym: tlocalvarsym);
     begin
-      appendsym_localsym(list,sym);
+      appendsym_localsym(list,sym,fcurrprocafterstart);
     end;
 
 
@@ -100,7 +101,11 @@ implementation
   procedure TDebugInfoJasmin.appendprocdef(list: TAsmList; def: tprocdef);
     var
       procstartlabel,
-      procendlabel    : tasmlabel;
+      procendlabel,
+      afterprocstartlabel : tasmlabel;
+      hp,
+      afterproccodestart  : tai;
+      instrcount          : longint;
     begin
       { insert debug information for local variables and parameters, but only
         for routines implemented in the Pascal code }
@@ -113,6 +118,33 @@ implementation
       tcpuprocdef(def).exprasmlist.insertbefore(tai_label.create(procendlabel),def.procendtai);
 
       fcurrprocstart:=procstartlabel;
+      { set the start label for local variables after the first instruction,
+        because javac's code completion support assumes that all info at
+        bytecode position 0 is for parameters }
+      instrcount:=0;
+      afterproccodestart:=def.procstarttai;
+      while assigned(afterproccodestart.next) do
+        begin
+          afterproccodestart:=tai(afterproccodestart.next);
+          if (afterproccodestart.typ=ait_instruction) then
+            break;
+        end;
+      { must be followed by at least one more instruction }
+      hp:=tai(afterproccodestart.next);
+      while assigned(hp) do
+        begin
+          if hp.typ=ait_instruction then
+            break;
+          hp:=tai(hp.next);
+        end;
+      if assigned(hp) then
+        begin
+          current_asmdata.getlabel(afterprocstartlabel,alt_dbgtype);
+          tcpuprocdef(def).exprasmlist.insertafter(tai_label.create(afterprocstartlabel),afterproccodestart);
+          fcurrprocafterstart:=afterprocstartlabel;
+        end
+      else
+        fcurrprocafterstart:=procstartlabel;
       fcurrprocend:=procendlabel;
 
       write_symtable_parasyms(list,def.paras);

+ 1 - 1
compiler/mips/cpugas.pas

@@ -225,7 +225,7 @@ unit cpugas;
             not (ai.condition in [C_EQ,C_NE,C_GTZ,C_GEZ,C_LTZ,C_LEZ,C_COP1TRUE,C_COP1FALSE])) {or (op=A_JAL)}
           or (op=A_REM) or (op=A_REMU)
           { DIV and DIVU are normally macros, but use $zero as first arg to generate a CPU instruction. }
-          or ((op=A_DIV) or (op=A_DIVU) and
+          or (((op=A_DIV) or (op=A_DIVU)) and
             ((ai.ops<>3) or (ai.oper[0]^.typ<>top_reg) or (ai.oper[0]^.reg<>NR_R0)))
           or (op=A_MULO) or (op=A_MULOU)
           { A_LI is only a macro if the immediate is not in thez 16-bit range }

+ 92 - 1
compiler/mips/ncpuadd.pas

@@ -37,26 +37,30 @@ type
     procedure cmp64_lt(left_reg, right_reg: TRegister64;unsigned:boolean);
     procedure cmp64_le(left_reg, right_reg: TRegister64;unsigned:boolean);
     procedure second_generic_cmp32(unsigned: boolean);
+    procedure second_mul64bit;
   protected
     procedure second_addfloat; override;
     procedure second_cmpfloat; override;
     procedure second_cmpboolean; override;
     procedure second_cmpsmallset; override;
+    procedure second_add64bit; override;
     procedure second_cmp64bit; override;
     procedure second_cmpordinal; override;
     procedure second_addordinal; override;
   public
     function use_generic_mul32to64: boolean; override;
+    function use_generic_mul64bit: boolean; override;
   end;
 
 implementation
 
 uses
-  systems,
+  systems, globtype, globals,
   cutils, verbose,
   paramgr,
   aasmtai, aasmcpu, aasmdata,
   defutil,
+  cpuinfo,
   {cgbase,} cgcpu, cgutils,
   cpupara,
   procinfo,
@@ -90,6 +94,15 @@ begin
 end;
 
 
+procedure tmipsaddnode.second_add64bit;
+begin
+  if (nodetype=muln) then
+    second_mul64bit
+  else
+    inherited second_add64bit;
+end;
+
+
 const
   cmpops: array[boolean] of TOpCmp = (OC_LT,OC_B);
 
@@ -326,12 +339,90 @@ begin
     inherited second_addordinal;
 end;
 
+procedure tmipsaddnode.second_mul64bit;
+var
+  list: TAsmList;
+  hreg1,hreg2,tmpreg: TRegister;
+begin
+  list:=current_asmdata.CurrAsmList;
+  pass_left_right;
+  location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
+  hlcg.location_force_reg(list,left.location,left.resultdef,left.resultdef,true);
+  { calculate 32-bit terms lo(right)*hi(left) and hi(left)*lo(right) }
+  hreg1:=NR_NO;
+  hreg2:=NR_NO;
+  tmpreg:=NR_NO;
+  if (right.location.loc=LOC_CONSTANT) then
+    begin
+      { Omit zero terms, if any }
+      if hi(right.location.value64)<>0 then
+        begin
+          hreg2:=cg.getintregister(list,OS_INT);
+          tmpreg:=cg.getintregister(list,OS_INT);
+          cg.a_load_const_reg(list,OS_INT,longint(hi(right.location.value64)),tmpreg);
+          list.concat(taicpu.op_reg_reg_reg(A_MUL,hreg2,tmpreg,left.location.register64.reglo));
+        end;
+      tmpreg:=NR_NO;
+      if lo(right.location.value64)<>0 then
+        begin
+          hreg1:=cg.getintregister(list,OS_INT);
+          tmpreg:=cg.getintregister(list,OS_INT);
+          cg.a_load_const_reg(list,OS_INT,longint(lo(right.location.value64)),tmpreg);
+          list.concat(taicpu.op_reg_reg_reg(A_MUL,hreg1,tmpreg,left.location.register64.reghi));
+        end;
+    end
+  else
+    begin
+      hlcg.location_force_reg(list,right.location,right.resultdef,right.resultdef,true);
+      tmpreg:=right.location.register64.reglo;
+      hreg1:=cg.getintregister(list,OS_INT);
+      hreg2:=cg.getintregister(list,OS_INT);
+      list.concat(taicpu.op_reg_reg_reg(A_MUL,hreg1,right.location.register64.reglo,left.location.register64.reghi));
+      list.concat(taicpu.op_reg_reg_reg(A_MUL,hreg2,right.location.register64.reghi,left.location.register64.reglo));
+    end;
+
+  { At this point, tmpreg is either lo(right) or NR_NO if lo(left)*lo(right) is zero }
+  if (tmpreg=NR_NO) then
+    begin
+      if (hreg2<>NR_NO) and (hreg1<>NR_NO) then
+        begin
+          location.register64.reghi:=cg.getintregister(list,OS_INT);
+          list.concat(taicpu.op_reg_reg_reg(A_ADDU,location.register64.reghi,hreg1,hreg2));
+        end
+      else if (hreg2<>NR_NO) then
+        location.register64.reghi:=hreg2
+      else if (hreg1<>NR_NO) then
+        location.register64.reghi:=hreg1
+      else
+        InternalError(2014122701);
+      location.register64.reglo:=NR_R0;
+    end
+  else
+    begin
+      list.concat(taicpu.op_reg_reg(A_MULTU,left.location.register64.reglo,tmpreg));
+      location.register64.reghi:=cg.getintregister(list,OS_INT);
+      location.register64.reglo:=cg.getintregister(list,OS_INT);
+      current_asmdata.CurrAsmList.Concat(taicpu.op_reg(A_MFLO,location.register64.reglo));
+      current_asmdata.CurrAsmList.Concat(taicpu.op_reg(A_MFHI,location.register64.reghi));
+      if (hreg2<>NR_NO) then
+        list.concat(taicpu.op_reg_reg_reg(A_ADDU,location.register64.reghi,location.register64.reghi,hreg2));
+      if (hreg1<>NR_NO) then
+        list.concat(taicpu.op_reg_reg_reg(A_ADDU,location.register64.reghi,location.register64.reghi,hreg1));
+    end;
+end;
 
 function tmipsaddnode.use_generic_mul32to64: boolean;
 begin
   result:=false;
 end;
 
+function tmipsaddnode.use_generic_mul64bit: boolean;
+begin
+  result:=(cs_check_overflow in current_settings.localswitches) or
+    (not (CPUMIPS_HAS_ISA32R2 in cpu_capabilities[current_settings.cputype]));
+end;
+
+
 begin
   caddnode := tmipsaddnode;
 end.

+ 2 - 2
compiler/msg/errord.msg

@@ -3768,7 +3768,7 @@ A*2Wb_Erzeuge statt einer Bibliothek ein Bundle (Darwin)
 A*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
 A*2WBxxxx_Setze die Imagebasis auf xxxx (Windows)
 3*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
-4*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
+4*2WC_Spezifiziere "console type application" (Windows)
 A*2WC_Spezifiziere "console type application" (Windows)
 P*2WC_Spezifiziere "console type application" (Classic Mac OS)
 3*2WD_Benutze DEFFILE um Funktionen der DLL oder EXE zu exportieren (Windows)
@@ -3781,7 +3781,7 @@ P*2We_Benutze externe Resourcen (Darwin)
 p*2We_Benutze externe Resourcen (Darwin)
 3*2WF_Spezifiziere "full-screen type application" (EMX, OS/2)
 3*2WG_Spezifiziere "graphic type application" (EMX, OS/2, Windows)
-4*2WG_Spezifiziere "graphic type application" (EMX, OS/2, Windows)
+4*2WG_Spezifiziere "graphic type application" (Windows)
 A*2WG_Spezifiziere "graphic type application" (Windows)
 P*2WG_Spezifiziere "graphic type application" (Classic Mac OS)
 3*2Wi_Benutze interne Resourcen (Darwin)

+ 2 - 2
compiler/msg/errordu.msg

@@ -3768,7 +3768,7 @@ A*2Wb_Erzeuge statt einer Bibliothek ein Bundle (Darwin)
 A*2WB_Erzeuge ein relozierbares Image (Windows, Symbian)
 A*2WBxxxx_Setze die Imagebasis auf xxxx (Windows)
 3*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
-4*2WC_Spezifiziere "console type application" (EMX, OS/2, Windows)
+4*2WC_Spezifiziere "console type application" (Windows)
 A*2WC_Spezifiziere "console type application" (Windows)
 P*2WC_Spezifiziere "console type application" (Classic Mac OS)
 3*2WD_Benutze DEFFILE um Funktionen der DLL oder EXE zu exportieren (Windows)
@@ -3781,7 +3781,7 @@ P*2We_Benutze externe Resourcen (Darwin)
 p*2We_Benutze externe Resourcen (Darwin)
 3*2WF_Spezifiziere "full-screen type application" (EMX, OS/2)
 3*2WG_Spezifiziere "graphic type application" (EMX, OS/2, Windows)
-4*2WG_Spezifiziere "graphic type application" (EMX, OS/2, Windows)
+4*2WG_Spezifiziere "graphic type application" (Windows)
 A*2WG_Spezifiziere "graphic type application" (Windows)
 P*2WG_Spezifiziere "graphic type application" (Classic Mac OS)
 3*2Wi_Benutze interne Resourcen (Darwin)

+ 45 - 7
compiler/msg/errore.msg

@@ -873,7 +873,7 @@ parser_e_threadvars_only_sg=03147_E_Threadvars can be only static or global
 parser_f_direct_assembler_not_allowed=03148_F_Direct assembler not supported for binary output format
 % You cannot use direct assembler when using a binary writer. Choose an
 % other output format or use another assembler reader.
-parser_w_no_objpas_use_mode=03149_W_Don't load OBJPAS unit manually, use \{\$mode objfpc\} or \{\$mode delphi\} instead
+parser_w_no_objpas_use_mode=03149_W_Don't load OBJPAS unit manually, use {$mode objfpc} or {$mode delphi} instead
 % You are trying to load the \file{ObjPas} unit manually from a \var{uses} clause.
 % This is not a good idea. Use the \var{\{\$MODE OBJFPC\}} or
 % \var{\{\$mode delphi\}} directives which load the unit automatically.
@@ -2237,6 +2237,42 @@ sym_d_adding_helper_for=05087_D_Adding helper for $1
 % A helper for the mentioned type is added to the current scope
 sym_e_param_list=05088_E_Found declaration: $1
 % This message shows all overloaded declarations in case of an error.
+sym_w_uninitialized_managed_local_variable=05089_W_Local variable "$1" of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that a variable will
+% be used (i.e. it appears in the right-hand side of an expression) when it
+% was not initialized first (i.e. appeared in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_w_uninitialized_managed_variable=05090_W_Variable "$1" of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that a variable will
+% be used (i.e. it appears in the right-hand side of an expression) when it
+% was not initialized first (i.e. appeared in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_h_uninitialized_managed_local_variable=05091_H_Local variable "$1" of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that a variable will
+% be used (i.e. it appears in the right-hand side of an expression) when it
+% was not initialized first (i.e. it did not appear in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_h_uninitialized_managed_variable=05092_H_Variable "$1" of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that a variable will
+% be used (i.e. it appears in the right-hand side of an expression) when it
+% was not initialized first (i.e. t did not appear in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_w_managed_function_result_uninitialized=05093_W_function result variable of a managed type does not seem to initialized
+% This message is displayed if the compiler thinks that the function result
+% variable will be used (i.e. it appears in the right-hand side of an expression)
+% before it is initialized (i.e. before it appeared in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
+sym_h_managed_function_result_uninitialized=05094_H_Function result variable of a managed type does not seem to be initialized
+% This message is displayed if the compiler thinks that the function result
+% variable will be used (i.e. it appears in the right-hand side of an expression)
+% before it is initialized (i.e. it appears in the left-hand side of an
+% assignment). Since the variable is managed, i. e. implicitly initialized by the compiler, this might be intended behaviour and
+% does not necessarily mean that the code is wrong.
 % \end{description}
 #
 # Codegenerator
@@ -3100,10 +3136,10 @@ unit_u_indirect_crc_changed=10062_U_Indirect interface (objects/classes) CRC cha
 % indirect CRC calculated for the unit (this is the CRC of all classes/objects/interfaces/$\ldots$
 % in the interfaces of units directly or indirectly used by this unit in the interface) has been changed after the
 % implementation has been parsed.
-% \end{description}
 unit_u_ppu_invalid_memory_model=10063_U_PPU is compiled for another i8086 memory model
 % This unit file was compiled for a different i8086 memory model and
 % cannot be read.
+% \end{description}
 # EndOfTeX
 
 #
@@ -3146,10 +3182,10 @@ option_target_is_already_set=11011_W_Target is already set to: $1
 option_no_shared_lib_under_dos=11012_W_Shared libs not supported on DOS platform, reverting to static
 % If you specify \var{-CD} for the \dos platform, this message is displayed.
 % The compiler supports only static libraries under \dos.
-option_too_many_ifdef=11013_F_In options file $1 at line $2 too many \var{\#IF(N)DEFs} encountered
+option_too_many_ifdef=11013_F_In options file $1 at line $2 too many #IF(N)DEFs encountered
 % The \var{\#IF(N)DEF} statements in the options file are not balanced with
 % the \var{\#ENDIF} statements.
-option_too_many_endif=11014_F_In options file $1 at line $2 unexpected \var{\#ENDIFs} encountered
+option_too_many_endif=11014_F_In options file $1 at line $2 unexpected #ENDIFs encountered
 % The \var{\#IF(N)DEF} statements in the options file are not balanced with
 % the \var{\#ENDIF} statements.
 option_too_less_endif=11015_F_Open conditional at the end of the options file
@@ -3218,7 +3254,7 @@ option_confict_asm_debug=11041_W_Assembler output selected "$1" cannot generate
 option_ppc386_deprecated=11042_W_Use of ppc386.cfg is deprecated, please use fpc.cfg instead
 % Using ppc386.cfg is still supported for historical reasons, however, for a multiplatform
 % system the naming makes no sense anymore. Please continue to use fpc.cfg instead.
-option_else_without_if=11043_F_In options file $1 at line $2 \var{\#ELSE} directive without \var{\#IF(N)DEF} found
+option_else_without_if=11043_F_In options file $1 at line $2 #ELSE directive without #IF(N)DEF found
 % An \var{\#ELSE} statement was found in the options file without a matching \var{\#IF(N)DEF} statement.
 option_unsupported_target=11044_F_Option "$1" is not, or not yet, supported on the current target platform
 % Not all options are supported or implemented for all target platforms. This message informs you that a chosen
@@ -3493,6 +3529,8 @@ P*2CN_Generate nil-pointer checks (AIX-only)
 **2Cp<x>_Select instruction set; see fpc -i or fpc -ic for possible values
 **2CP<x>=<y>_ packing settings
 **3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 and 8
+**3CPPACKENUM=<y>_ <y> enum packing: 0, 1, 2 and 4 or DEFAULT or NORMAL
+**3CPPACKRECORD=<y>_ <y> record packing: 0 or DEFAULT or NORMAL, 1, 2, 4, 8, 16 and 32
 **2Cr_Range checking
 **2CR_Verify object method call validity
 **2Cs<n>_Set stack checking size to <n>
@@ -3741,7 +3779,7 @@ A*2Wb_Create a bundle instead of a library (Darwin)
 A*2WB_Create a relocatable image (Windows, Symbian)
 A*2WBxxxx_Set image base to xxxx (Windows, Symbian)
 3*2WC_Specify console type application (EMX, OS/2, Windows)
-4*2WC_Specify console type application (EMX, OS/2, Windows)
+4*2WC_Specify console type application (Windows)
 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)
@@ -3754,7 +3792,7 @@ 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)
-4*2WG_Specify graphic type application (EMX, OS/2, Windows)
+4*2WG_Specify graphic type application (Windows)
 A*2WG_Specify graphic type application (Windows)
 P*2WG_Specify graphic type application (Classic Mac OS)
 3*2Wi_Use internal resources (Darwin)

+ 2 - 2
compiler/msg/errorpt.msg

@@ -3384,7 +3384,7 @@ A*2Wb_Cria um encarte ao inv
 A*2WB_Cria uma imagem reloc vel (Windows, Symbian)
 A*2WBxxxx_Define base da imagem para xxxx (Windows, Symbian)
 3*2WC_Especifica aplica‡Æo do tipo console (EMX, OS/2, Windows)
-4*2WC_Especifica aplica‡Æo do tipo console (EMX, OS/2, Windows)
+4*2WC_Especifica aplica‡Æo do tipo console (Windows)
 A*2WC_Especifica aplica‡Æo do tipo console (Windows)
 P*2WC_Especifica aplica‡Æo do tipo console (Classic Mac OS)
 3*2WD_Usa DEFFILE para exportar fun‡äes de DLL ou EXE (Windows)
@@ -3397,7 +3397,7 @@ P*2We_Usa recursos externos (Darwin)
 p*2We_Usa recursos externos (Darwin)
 3*2WF_Especifica aplica‡Æo do tipo tela-cheia (EMX, OS/2)
 3*2WG_Especifica aplica‡Æo do tipo gr fica (EMX, OS/2, Windows)
-4*2WG_Especifica aplica‡Æo do tipo gr fica (EMX, OS/2, Windows)
+4*2WG_Especifica aplica‡Æo do tipo gr fica (Windows)
 A*2WG_Especifica aplica‡Æo do tipo gr fica (Windows)
 P*2WG_Especifica aplica‡Æo do tipo gr fica (Classic Mac OS)
 3*2Wi_Usa recursos internos (Darwin)

+ 2 - 2
compiler/msg/errorptu.msg

@@ -3384,7 +3384,7 @@ A*2Wb_Cria um encarte ao invés de uma biblioteca (Darwin)
 A*2WB_Cria uma imagem relocável (Windows, Symbian)
 A*2WBxxxx_Define base da imagem para xxxx (Windows, Symbian)
 3*2WC_Especifica aplicação do tipo console (EMX, OS/2, Windows)
-4*2WC_Especifica aplicação do tipo console (EMX, OS/2, Windows)
+4*2WC_Especifica aplicação do tipo console (Windows)
 A*2WC_Especifica aplicação do tipo console (Windows)
 P*2WC_Especifica aplicação do tipo console (Classic Mac OS)
 3*2WD_Usa DEFFILE para exportar funções de DLL ou EXE (Windows)
@@ -3397,7 +3397,7 @@ P*2We_Usa recursos externos (Darwin)
 p*2We_Usa recursos externos (Darwin)
 3*2WF_Especifica aplicação do tipo tela-cheia (EMX, OS/2)
 3*2WG_Especifica aplicação do tipo gráfica (EMX, OS/2, Windows)
-4*2WG_Especifica aplicação do tipo gráfica (EMX, OS/2, Windows)
+4*2WG_Especifica aplicação do tipo gráfica (Windows)
 A*2WG_Especifica aplicação do tipo gráfica (Windows)
 P*2WG_Especifica aplicação do tipo gráfica (Classic Mac OS)
 3*2Wi_Usa recursos internos (Darwin)

+ 8 - 2
compiler/msgidx.inc

@@ -628,6 +628,12 @@ const
   sym_e_no_matching_inherited_parameterless_constructor=05086;
   sym_d_adding_helper_for=05087;
   sym_e_param_list=05088;
+  sym_w_uninitialized_managed_local_variable=05089;
+  sym_w_uninitialized_managed_variable=05090;
+  sym_h_uninitialized_managed_local_variable=05091;
+  sym_h_uninitialized_managed_variable=05092;
+  sym_w_managed_function_result_uninitialized=05093;
+  sym_h_managed_function_result_uninitialized=05094;
   cg_e_parasize_too_big=06009;
   cg_e_file_must_call_by_reference=06012;
   cg_e_cant_use_far_pointer_there=06013;
@@ -994,9 +1000,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 73924;
+  MsgTxtSize = 74490;
 
   MsgIdxMax : array[1..20] of longint=(
-    26,99,339,123,89,57,126,27,202,64,
+    26,99,339,123,95,57,126,27,202,64,
     58,20,1,1,1,1,1,1,1,1
   );

Fișier diff suprimat deoarece este prea mare
+ 268 - 258
compiler/msgtxt.inc


+ 1 - 1
compiler/ncal.pas

@@ -2906,7 +2906,7 @@ implementation
                   for i:=1 to procdefinition.maxparacount-paralength do
                     begin
                       if paraidx<0 then
-                        internalerror(200402261);
+                        internalerror(200402265);
                       if not assigned(tparavarsym(procdefinition.paras[paraidx]).defaultconstsym) then
                         begin
                           CGMessage1(parser_e_wrong_parameter_size,'<Procedure Variable>');

+ 6 - 5
compiler/ncgcal.pas

@@ -325,12 +325,13 @@ implementation
                      paramanager.push_addr_param(parasym.varspez,parasym.vardef,
                          aktcallnode.procdefinition.proccalloption));
 
-                 { objects or advanced records could be located in registers if they are the result of a type case, see e.g. webtbs\tw26075.pp }
-                 if not(left.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
-                   hlcg.location_force_mem(current_asmdata.CurrAsmList,left.location,left.resultdef);
-
                  if pushaddr then
-                   push_addr_para
+                   begin
+                     { objects or advanced records could be located in registers if they are the result of a type case, see e.g. webtbs\tw26075.pp }
+                     if not(left.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
+                       hlcg.location_force_mem(current_asmdata.CurrAsmList,left.location,left.resultdef);
+                     push_addr_para
+                   end
                  else
                    push_value_para;
                end

+ 5 - 2
compiler/nflw.pas

@@ -1394,7 +1394,7 @@ implementation
            not(is_typeparam(left.resultdef)) then
              inserttypeconv(left,pasbool8type);
 
-         result:=internalsimplify(true);
+         result:=internalsimplify(not(nf_internal in flags));
       end;
 
 
@@ -1524,8 +1524,11 @@ implementation
          set_varstate(left,vs_written,[]);
 
          { loop unrolling }
-         if cs_opt_loopunroll in current_settings.optimizerswitches then
+         if (cs_opt_loopunroll in current_settings.optimizerswitches) and
+           { statements must be error free }
+           not(nf_error in t2.flags) then
            begin
+             typecheckpass(t2);
              res:=t2.simplify(false);
              if assigned(res) then
                t2:=res;

+ 8 - 3
compiler/ngenutil.pas

@@ -605,9 +605,14 @@ implementation
       StructList: TFPList absolute arg;
     begin
       if (tdef(p).typ in [objectdef,recorddef]) and
-         not (df_generic in tdef(p).defoptions) and
-         ([oo_has_class_constructor,oo_has_class_destructor] * tabstractrecorddef(p).objectoptions <> []) then
-        StructList.Add(p);
+         not (df_generic in tdef(p).defoptions) then
+        begin
+          { first add the class... }
+          if ([oo_has_class_constructor,oo_has_class_destructor] * tabstractrecorddef(p).objectoptions <> []) then
+            StructList.Add(p);
+          { ... and then also add all subclasses }
+          tabstractrecorddef(p).symtable.deflist.foreachcall(@AddToStructInits,arg);
+        end;
     end;
 
 

+ 1 - 0
compiler/ninl.pas

@@ -4117,6 +4117,7 @@ implementation
 {$endif}
          result:=cifnode.create(cnotnode.create(tcallparanode(left).left),
             ccallnode.createintern('fpc_assert',paras),nil);
+         include(result.flags,nf_internal);
          tcallparanode(left).left:=nil;
          tcallparanode(left).right:=nil;
        end;

+ 14 - 8
compiler/optdfa.pas

@@ -59,7 +59,7 @@ unit optdfa;
       symconst,symdef,symsym,
       defutil,
       procinfo,
-      nutils,
+      nutils,htypechk,
       nbas,nflw,ncon,ninl,ncal,nset,nld,nadd,
       optbase;
 
@@ -700,7 +700,10 @@ unit optdfa;
                     begin
                       { issue only a hint for var, when encountering the node passed as out, we need only to stop searching }
                       if tcallparanode(n).parasym.varspez=vs_var then
-                        MessagePos1(hpt.fileinfo,sym_h_uninitialized_local_variable,tloadnode(hpt).symtableentry.RealName);
+                        UninitializedVariableMessage(hpt.fileinfo,false,
+                          tloadnode(hpt).symtable.symtabletype=localsymtable,
+                          is_managed_type(tloadnode(hpt).resultdef),
+                          tloadnode(hpt).symtableentry.RealName);
                       AddFilepos(hpt.fileinfo);
                       result:=fen_norecurse_true;
                     end
@@ -778,7 +781,10 @@ unit optdfa;
                     begin
                       if (vo_is_funcret in varsym.varoptions) and not(WarnedForLocation(n.fileinfo)) then
                         begin
-                          MessagePos(n.fileinfo,sym_w_function_result_uninitialized);
+                          if is_managed_type(varsym.vardef) then
+                            MessagePos(n.fileinfo,sym_w_managed_function_result_uninitialized)
+                          else
+                            MessagePos(n.fileinfo,sym_w_function_result_uninitialized);
                           AddFilepos(n.fileinfo);
                           result:=fen_norecurse_true;
                         end
@@ -787,10 +793,7 @@ unit optdfa;
                           { typed consts are initialized, further, warn only once per location }
                           if not (vo_is_typed_const in varsym.varoptions) and not(WarnedForLocation(n.fileinfo)) then
                             begin
-                              if varsym.typ=paravarsym then
-                                MessagePos1(n.fileinfo,sym_w_uninitialized_variable,varsym.realname)
-                              else
-                                MessagePos1(n.fileinfo,sym_w_uninitialized_local_variable,varsym.realname);
+                              UninitializedVariableMessage(n.fileinfo,true,varsym.typ=localvarsym,is_managed_type(varsym.vardef),varsym.realname);
                               AddFilepos(n.fileinfo);
                               result:=fen_norecurse_true;
                             end;
@@ -905,7 +908,10 @@ unit optdfa;
                   { don't warn about constructors }
                   not(current_procinfo.procdef.proctypeoption in [potype_class_constructor,potype_constructor]) then
                   begin
-                    MessagePos(node.fileinfo,sym_w_function_result_uninitialized);
+                    if is_managed_type(current_procinfo.procdef.returndef) then
+                      MessagePos(node.fileinfo,sym_w_managed_function_result_uninitialized)
+                    else
+                      MessagePos(node.fileinfo,sym_w_function_result_uninitialized);
 
                     Setlength(SearchNodeInfo.warnedfilelocs,length(SearchNodeInfo.warnedfilelocs)+1);
                     SearchNodeInfo.warnedfilelocs[high(SearchNodeInfo.warnedfilelocs)]:=node.fileinfo;

+ 40 - 18
compiler/options.pas

@@ -1198,24 +1198,46 @@ begin
                     'P':
                       begin
                         delete(more,1,1);
-                        if upper(copy(more,1,pos('=',more)-1))='PACKSET' then
-                          begin
-                            delete(more,1,pos('=',more));
-                            if (more='0') or (more='DEFAULT') or (more='NORMAL') then
-                              init_settings.setalloc:=0
-                            else if  more='1' then
-                              init_settings.setalloc:=1
-                            else if more='2' then
-                              init_settings.setalloc:=2
-                            else if more='4' then
-                              init_settings.setalloc:=4
-                            else if more='8' then
-                              init_settings.setalloc:=8
-                            else
-                              IllegalPara(opt);
-                          end
-                        else
-                          IllegalPara(opt);
+                        case upper(copy(more,1,pos('=',more)-1)) of
+                          'PACKSET':
+                            begin
+                              delete(more,1,pos('=',more));
+                              case more of
+                                '0','DEFAULT','NORMAL':
+                                  init_settings.setalloc:=0;
+                                '1','2','4','8':
+                                  init_settings.setalloc:=StrToInt(more);
+                                else
+                                  IllegalPara(opt);
+                              end
+                            end;
+                          'PACKENUM':
+                            begin
+                              delete(more,1,pos('=',more));
+                              case more of
+                                '0','DEFAULT','NORMAL':
+                                  init_settings.packenum:=4;
+                                '1','2','4':
+                                  init_settings.packenum:=StrToInt(more);
+                                else
+                                  IllegalPara(opt);
+                              end;
+                            end;
+                          'PACKRECORD':
+                            begin
+                              delete(more,1,pos('=',more));
+                              case more of
+                                '0','DEFAULT','NORMAL':
+                                  init_settings.packrecords:=default_settings.packrecords;
+                                '1','2','4','8','16','32':
+                                  init_settings.packrecords:=StrToInt(more);
+                                else
+                                  IllegalPara(opt);
+                              end;
+                            end
+                          else
+                            IllegalPara(opt);
+                        end;
                       end;
                     'r' :
                       If UnsetBool(More, j, opt, false) then

+ 4 - 7
compiler/optloop.pas

@@ -81,10 +81,7 @@ unit optloop;
 
     function replaceloadnodes(var n: tnode; arg: pointer): foreachnoderesult;
       begin
-        if ((n.nodetype=loadn) and (preplaceinfo(arg)^.node.nodetype=loadn) and
-          (tloadnode(n).symtableentry=tloadnode(preplaceinfo(arg)^.node).symtableentry)) or
-          ((n.nodetype=temprefn) and (preplaceinfo(arg)^.node.nodetype=temprefn) and
-          (ttemprefnode(n).tempinfo=ttemprefnode(preplaceinfo(arg)^.node).tempinfo)) then
+        if n.isequal(preplaceinfo(arg)^.node) then
           begin
             if n.flags*[nf_modify,nf_write,nf_address_taken]<>[] then
               internalerror(2012090402);
@@ -135,12 +132,12 @@ unit optloop;
                 unrollblock:=internalstatements(unrollstatement);
 
                 { can we get rid completly of the for ? }
-                getridoffor:=(unrolls=counts) and not(usesbreakcontinue);
+                getridoffor:=(unrolls=counts) and not(usesbreakcontinue) and
+                  { TP/Macpas allows assignments to the for-variables, so we cannot get rid of the for }
+                  ([m_tp7,m_mac]*current_settings.modeswitches=[]);
 
                 if getridoffor then
                   begin
-                    if not(tfornode(node).left.nodetype in [temprefn,loadn]) then
-                      internalerror(2012090301);
                     replaceinfo.node:=tfornode(node).left;
                     replaceinfo.value:=tordconstnode(tfornode(node).right).value;
                   end;

+ 4 - 1
compiler/pdecobj.pas

@@ -1216,7 +1216,10 @@ implementation
                           begin
                             if is_interface(current_structdef) or
                                is_objc_protocol_or_category(current_structdef) or
-                               is_objectpascal_helper(current_structdef) or
+                               (
+                                 is_objectpascal_helper(current_structdef) and
+                                 not class_fields
+                               ) or
                                (is_javainterface(current_structdef) and
                                 not(class_fields and final_fields)) then
                               Message(parser_e_no_vars_in_interfaces);

+ 12 - 3
compiler/pdecsub.pas

@@ -548,6 +548,8 @@ implementation
         orgsp,sp : TIDString;
         srsym : tsym;
         checkstack : psymtablestackitem;
+        oldfilepos,
+        classstartfilepos,
         procstartfilepos : tfileposinfo;
         i,
         index : longint;
@@ -822,9 +824,16 @@ implementation
            try_to_consume(_POINT) then
          begin
            repeat
+             classstartfilepos:=procstartfilepos;
              searchagain:=false;
+
+             { throw the error at the right location }
+             oldfilepos:=current_filepos;
+             current_filepos:=procstartfilepos;
              if not assigned(astruct) and not assigned(srsym) then
                srsym:=search_object_name(sp,true);
+             current_filepos:=oldfilepos;
+
              { consume proc name }
              procstartfilepos:=current_tokenpos;
              consume_proc_name;
@@ -837,7 +846,7 @@ implementation
                   if (potype in [potype_class_constructor,potype_class_destructor]) then
                     sp:=lower(sp)
                   else
-                  if (potype=potype_operator)and(optoken=NOTOKEN) then
+                  if (potype=potype_operator) and (optoken=NOTOKEN) then
                     parse_operator_name;
                 srsym:=tsym(astruct.symtable.Find(sp));
                 if assigned(srsym) then
@@ -865,13 +874,13 @@ implementation
                  end
                 else
                  begin
-                   Message(parser_e_methode_id_expected);
+                   MessagePos(procstartfilepos,parser_e_methode_id_expected);
                    { recover by making it a normal procedure instead of method }
                    astruct:=nil;
                  end;
               end
              else
-              Message(parser_e_class_id_expected);
+              MessagePos(classstartfilepos,parser_e_class_id_expected);
            until not searchagain;
          end
         else

+ 7 - 5
compiler/pinline.pas

@@ -376,11 +376,13 @@ implementation
                                    end;
                                  if found then
                                    begin
-                                     { setup variant selector }
-                                     addstatement(newstatement,cassignmentnode.create(
-                                         csubscriptnode.create(variantselectsymbol,
-                                           cderefnode.create(ctemprefnode.create(temp))),
-                                         p2));
+                                     { if no tag-field is given, do not create an assignment statement for it }
+                                     if assigned(variantselectsymbol) then
+                                       { setup variant selector }
+                                       addstatement(newstatement,cassignmentnode.create(
+                                           csubscriptnode.create(variantselectsymbol,
+                                             cderefnode.create(ctemprefnode.create(temp))),
+                                           p2));
                                    end
                                  else
                                    Message(parser_e_illegal_expression);

+ 1 - 1
compiler/powerpc/agppcvasm.pas

@@ -165,7 +165,7 @@ unit agppcvasm;
         top_ref :
           begin
             if o.ref^.refaddr<>addr_full then
-              internalerror(200402262);
+              internalerror(200402264);
             hs:=o.ref^.symbol.name;
             if o.ref^.offset>0 then
               hs:=hs+'+'+tostr(o.ref^.offset)

+ 1 - 1
compiler/ppcgen/agppcgas.pas

@@ -203,7 +203,7 @@ unit agppcgas;
         top_ref :
           begin
             if o.ref^.refaddr<>addr_full then
-              internalerror(200402262);
+              internalerror(200402267);
             hs:=o.ref^.symbol.name;
             if target_asm.dollarsign<>'$' then
               hs:=ReplaceForbiddenAsmSymbolChars(hs);

+ 6 - 1
compiler/psub.pas

@@ -1334,7 +1334,12 @@ implementation
               { iterate through life info of the first node }
               for i:=0 to dfabuilder.nodemap.count-1 do
                 begin
-                  if DFASetIn(GetUserCode.optinfo^.life,i) then
+                  if DFASetIn(GetUserCode.optinfo^.life,i) and
+                    { do not warn about parameters passed by var }
+                    not((tnode(dfabuilder.nodemap[i]).nodetype=loadn) and (tloadnode(dfabuilder.nodemap[i]).symtableentry.typ=paravarsym) and
+                        (tparavarsym(tloadnode(dfabuilder.nodemap[i]).symtableentry).varspez=vs_var) and
+                        { function result is passed by var but it must be initialized }
+                        not(vo_is_funcret in tparavarsym(tloadnode(dfabuilder.nodemap[i]).symtableentry).varoptions)) then
                     CheckAndWarn(GetUserCode,tnode(dfabuilder.nodemap[i]));
                 end;
           end;

+ 0 - 3
compiler/raatt.pas

@@ -112,10 +112,7 @@ unit raatt;
          procedure handledollar;virtual;
          procedure HandleTargetDirective;virtual;
        end;
-       tcattreader = class of tattreader;
 
-    var
-      cattreader : tcattreader;
 
   implementation
 

+ 101 - 2
compiler/symdef.pas

@@ -243,6 +243,9 @@ interface
        tprocdef = class;
 
        tabstractrecorddef= class(tstoreddef)
+       private
+          rttistring     : string;
+       public
           objname,
           objrealname    : PShortString;
           { for C++ classes: name of the library this class is imported from }
@@ -2113,7 +2116,7 @@ implementation
                sym:=tsym(genericparas[i]);
                if sym.typ<>symconst.typesym then
                  internalerror(2014050904);
-               if sym.owner.defowner=self then
+               if sym.owner.defowner<>self then
                  exit(true);
              end;
            result:=false;
@@ -3766,8 +3769,104 @@ implementation
       end;
 
     function tabstractrecorddef.RttiName: string;
+
+        function generate_full_paramname(maxlength:longint):string;
+          const
+            commacount : array[boolean] of longint = (0,1);
+          var
+            fullparas,
+            paramname : ansistring;
+            module : tmodule;
+            sym : ttypesym;
+            i : longint;
+          begin
+            { we want at least enough space for an ellipsis }
+            if maxlength<3 then
+              internalerror(2014121203);
+            fullparas:='';
+            for i:=0 to genericparas.count-1 do
+              begin
+                sym:=ttypesym(genericparas[i]);
+                module:=find_module_from_symtable(sym.owner);
+                if not assigned(module) then
+                  internalerror(2014121202);
+                paramname:=module.realmodulename^;
+                if sym.typedef.typ in [objectdef,recorddef] then
+                  paramname:=paramname+'.'+tabstractrecorddef(sym.typedef).rttiname
+                else
+                  paramname:=paramname+'.'+sym.typedef.typename;
+                if length(fullparas)+commacount[i>0]+length(paramname)>maxlength then
+                  begin
+                    if i>0 then
+                      fullparas:=fullparas+',...'
+                    else
+                      fullparas:=fullparas+'...';
+                    break;
+                  end;
+                { could we fit an ellipsis after this parameter if it should be too long? }
+                if (maxlength-(length(fullparas)+commacount[i>0]+length(paramname))<4) and (i<genericparas.count-1) then
+                  begin
+                    { then omit already this parameter }
+                    if i>0 then
+                      fullparas:=fullparas+',...'
+                    else
+                      fullparas:=fullparas+'...';
+                    break;
+                  end;
+                if i>0 then
+                  fullparas:=fullparas+',';
+                fullparas:=fullparas+paramname;
+              end;
+            result:=fullparas;
+          end;
+
+      var
+        nongeneric,
+        basename : string;
+        i,
+        remlength,
+        paramcount,
+        crcidx : longint;
       begin
-        Result:=OwnerHierarchyName+objrealname^;
+        if rttistring='' then
+          begin
+            if is_specialization then
+              begin
+                rttistring:=OwnerHierarchyName;
+                { there should be two $ characters, one before the CRC and one before the count }
+                crcidx:=-1;
+                for i:=length(objrealname^) downto 1 do
+                  if objrealname^[i]='$' then
+                    begin
+                      crcidx:=i;
+                      break;
+                    end;
+                if crcidx<0 then
+                  internalerror(2014121201);
+                basename:=copy(objrealname^,1,crcidx-1);
+                split_generic_name(basename,nongeneric,paramcount);
+                rttistring:=rttistring+nongeneric+'<';
+                remlength:=255-length(rttistring)-1;
+                if remlength<4 then
+                  rttistring:=rttistring+'>'
+                else
+                  rttistring:=rttistring+generate_full_paramname(remlength)+'>';
+              end
+            else
+              if is_generic then
+                begin
+                  rttistring:=OwnerHierarchyName;
+                  split_generic_name(objrealname^,nongeneric,paramcount);
+                  rttistring:=rttistring+nongeneric+'<';
+                  { we don't want any ',' if there is only one parameter }
+                  for i:=0 to paramcount-0 do
+                    rttistring:=rttistring+',';
+                  rttistring:=rttistring+'>';
+                end
+              else
+                rttistring:=OwnerHierarchyName+objrealname^;
+          end;
+        result:=rttistring;
       end;
 
     function tabstractrecorddef.search_enumerator_get: tprocdef;

+ 2 - 2
compiler/systems/i_linux.pas

@@ -817,7 +817,7 @@ unit i_linux;
             name         : 'Linux for MIPSEB';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
-                            tf_requires_proper_alignment,
+                            tf_requires_proper_alignment,tf_pic_uses_got,tf_safecall_exceptions,
                             tf_smartlink_sections,tf_smartlink_library,tf_has_winlike_resources];
             cpu          : cpu_mipseb;
             unit_env     : 'LINUXUNITS';
@@ -882,7 +882,7 @@ unit i_linux;
             name         : 'Linux for MIPSEL';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
-                            tf_requires_proper_alignment,
+                            tf_requires_proper_alignment,tf_pic_uses_got,tf_safecall_exceptions,
                             tf_smartlink_sections,tf_smartlink_library,tf_has_winlike_resources];
             cpu          : cpu_mipsel;
             unit_env     : 'LINUXUNITS';

+ 1 - 1
compiler/systems/t_sunos.pas

@@ -143,7 +143,7 @@ procedure TLinkersolaris.SetDefaultInfo;
 }
 {$ifdef x86_64}
 const
-  gld = 'gld -m elf_x86_64 ';
+  gld = 'gld -m elf_x86_64_sol2 ';
   solaris_ld = '/usr/bin/ld -64 ';
 {$endif}
 {$ifdef i386}

+ 1 - 1
compiler/utils/samplecfg

@@ -99,4 +99,4 @@ ${FPCMKCFGBIN} -p -3 $compilerconfigdir -o $fppkgfile
 
 # Write default
 echo Writing sample configuration file to $defaultfile
-${FPCMKCFGBIN} -p -4 -d "GlobalPrefix=$FPCGLOBALPREFIX" -o $defaultfile
+${FPCMKCFGBIN} -p -4 -d "GlobalPrefix=$FPCGLOBALPREFIX" -d "FpcBin=$FPCBIN" -o $defaultfile

+ 1 - 1
compiler/x86/aasmcpu.pas

@@ -1239,7 +1239,7 @@ implementation
                     assembler }
                 end;
               else
-                internalerror(200402261);
+                internalerror(200402266);
             end;
           end;
       end;

+ 13 - 1
ide/fp.pas

@@ -328,7 +328,15 @@ procedure InitCompilerSwitches;
     default_settings.localswitches:=[cs_typed_const_writable];
   end;
 
-
+{$IFDEF HASAMIGA}
+procedure SetAmigaWindowTitle;
+begin
+  { window title first, then screen title, shown when the window is active }
+  Video.SetWindowTitle(
+     'Free Pascal IDE',
+     'Free Pascal IDE '+VersionStr+' ['+{$i %date%}+'] - Compiler '+Full_Version_String);
+end;
+{$ENDIF}
 {The square bullet needs an MS-DOS code page. On Unix it is for sure the code
  page is not available before video is initialized. (And only in certain
  circumstances after that, so, use a plain ascii character as bullet on Unix.)}
@@ -424,6 +432,10 @@ BEGIN
     from command line PM }
   ParseUserScreen;
 
+{$IFDEF HASAMIGA}
+  SetAmigaWindowTitle;
+{$ENDIF}
+
   { Update IDE }
   IDEApp.Update;
   IDEApp.UpdateMode;

+ 1 - 1
ide/fpviews.pas

@@ -4241,7 +4241,7 @@ begin
   HelpCtx:=hcAbout;
   GetExtent(R); R.Grow(-3,-2);
   R2.Copy(R); R2.B.Y:=R2.A.Y+1;
-  Insert(New(PStaticText, Init(R2, ^C'FreePascal IDE for '+source_info.name)));
+  Insert(New(PStaticText, Init(R2, ^C'Free Pascal IDE for '+source_info.name)));
   R2.Move(0,1);
   Insert(New(PStaticText, Init(R2, ^C'Target CPU: '+target_cpu_string)));
   R2.Move(0,1);

+ 117 - 10
installer/install.dat

@@ -3,7 +3,7 @@
 #
 # Install file for Go32v2/Win32/OS2/EMX
 #
-# Warning: no package should contain more than 16 files
+# Warning: no package should contain more than 60 files
 
 title=Free Pascal Compiler 2.7.1
 version=2.7.1
@@ -34,7 +34,8 @@ package=aslddos.zip,GNU ~L~inker and GNU Assembler for Go32v2 (required)
 # Dos 3
 package=idedos.zip,~I~DE with integrated debugger/compiler (BETA)
 # Dos 4
-package=utilsdos.zip[utildos.zip],~E~xtra Utilities
+#package=utilsdos.zip[utildos.zip],~E~xtra Utilities
+package=utils-dxegendos.zip[dxegdos.zip],Generation of D~X~E modules loadable at runtime
 # Dos 5
 package=makedos.zip,GNU ~U~tilities (needed for Makefile usage)
 # Dos 6
@@ -109,6 +110,30 @@ package=urtl-extrados.zip[urtledos.zip],RTL-additional units not needed for boot
 package=urtl-objpasdos.zip[urtlodos.zip],RTL-Object Pascal units (e.g. Delphi compatibility)
 # Dos 41
 package=urtl-unicodedos.zip[urtludos.zip],RTL-miscellaneous Unicode support units
+# Dos 42
+package=utils-fpcmkcfgdos.zip[fcmkdos.zip],Creation of Free Pascal configuration files
+# Dos 43
+package=utils-fpcmdos.zip[fpcmdos.zip],Generate Makefiles out of Makefile.fpc files
+# Dos 44
+package=utils-fpdocdos.zip[fpdocdos.zip],Free Pascal documentation generation utility
+# Dos 45
+package=utils-fppkgdos.zip[fppkgdos.zip],Free Pascal package repository utility
+# Dos 46
+package=utils-fprcpdos.zip[fprcpdos.zip],Free Pascal Resource Compiler Preprocessor
+# Dos 47
+package=utils-h2pasdos.zip[h2pasdos.zip],Create Pascal interface units from C headers
+# Dos 48
+package=utils-pas2fpmdos.zip[p2fmdos.zip],Generate fpmake.pp for Pascal source
+# Dos 49
+package=utils-pas2jnidos.zip[p2jndos.zip],Generate JNI bridge for Pascal code
+# Dos 50
+package=utils-pas2utdos.zip[p2utdos.zip],Pascal source to FPC Unit test generator
+# Dos 51
+package=utils-rmwaitdos.zip[rmwdos.zip],Remove (delete) file(s) with optional retries
+# Dos 52
+package=utils-lexyaccdos.zip[tplydos.zip],Compiler generator for TP and compatibles
+# Dos 53
+package=units-ptcdos.zip[uptcdos.zip],Free portable framebuffer library
 
 #
 # Win32 packages
@@ -137,7 +162,7 @@ package=gdb.i386-win32.zip,GNU ~D~ebugger for Win32
 # Win32 7
 package=units-fv.i386-win32.zip,Free ~V~ision (FV)
 # Win32 8
-package=units-fpgtk.i386-win32.zip,fpGTK units
+package=units-fpgtk.i386-win32.zip,Lightweight OOP wrapper over GTK1
 # Win32 9
 package=units-sqlite.i386-win32.zip,SQLite interface units
 # Win32 10
@@ -271,7 +296,8 @@ package=asldos2.zip,GNU ~L~inker and GNU assembler for OS/2 (required)
 # OS/2 3
 package=ideos2.zip,~I~DE with integrated compiler (BETA - no debugger)
 # OS/2 4
-package=utilsos2.zip[utilos2.zip],~E~xtra Utilities
+#package=utilsos2.zip[utilos2.zip],~E~xtra Utilities
+package=utils-fpcmos2.zip[fpcmos2.zip],Generate Makefiles out of Makefile.fpc files
 # OS/2 5
 package=makeos2.zip,GNU ~U~tilities (needed for Makefile usage)
 # OS/2 6
@@ -283,6 +309,7 @@ package=uos2unitsos2.zip[uos2os2.zip],Units interfacing libraries delivered with
 #package=uclkdllos2.zip[uclkos2.zip],CLKDLL interface unit (eCS 1.1+)
 # OS/2 9
 #package=ulvmos2.zip,LVM interface unit (OS/2 v4.5 / eCS)
+package=utils-h2pasos2.zip[h2pasos2.zip],Create Pascal interface units from C headers
 # OS/2 10
 package=upasjpegos2.zip[upjpos2.zip],Pas~J~PEG units
 # OS/2 11
@@ -311,6 +338,28 @@ package=uhermesos2.zip[uhermos2.zip],Port of Hermes graphics library
 package=ufppkgos2.zip[ufppkos2.zip],Units for FPPkg packaging support
 # OS/2 23
 package=uopensslos2.zip[uosslos2.zip],OpenSSL interface units
+# OS/2 24
+package=utils-fpcmkcfgos2.zip[fcmkos2.zip],Creation of Free Pascal configuration files
+# OS/2 25
+package=utils-fpdocos2.zip[fpdocos2.zip],Free Pascal documentation generation utility
+# OS/2 26
+package=utils-fpmcos2.zip[fpmcos2.zip],Free Pascal Message Compiler
+# OS/2 27
+package=utils-fppkgos2.zip[fppkgos2.zip],Free Pascal package repository utility
+# OS/2 28
+package=utils-fprcpos2.zip[fprcpos2.zip],Free Pascal Resource Compiler Preprocessor
+# OS/2 29
+package=utils-fpcresos2.zip[fpresos2.zip],Free Pascal Resource Converter
+# OS/2 30
+package=utils-pas2fpmos2.zip[p2fmos2.zip],Generate fpmake.pp for Pascal source
+# OS/2 31
+package=utils-pas2jnios2.zip[p2jnos2.zip],Generate JNI bridge for Pascal code
+# OS/2 32
+package=utils-pas2utos2.zip[p2utos2.zip],Pascal source to FPC Unit test generator
+# OS/2 33
+package=utils-rmwaitos2.zip[rmwos2.zip],Remove (delete) file(s) with optional retries
+# OS/2 34
+package=utils-lexyaccos2.zip[tplyos2.zip],Compiler generator for TP and compatibles
 
 #
 # OS/2 packages 2nd part
@@ -334,11 +383,11 @@ package=uunzipos2.zip[uzipos2.zip],Unzip units
 # OS/2-2 8
 #package=ummtkos2.zip,MMOS/2 interface units
 # OS/2-2 9
-package=ux11os2.zip,X11 interface units
+package=ux11os2.zip,X Window (X11) interface units
 # OS/2-2 10
 package=ugtk1os2.zip,GTK1 interface units
 # OS/2-2 11
-package=ufpgtkos2.zip[ufpgtos2.zip],fpGTK units
+package=ufpgtkos2.zip[ufpgtos2.zip],Lightweight OOP wrapper over GTK1
 # OS/2-2 12
 package=uimlibos2.zip[uimlbos2.zip],ImLib interface units
 # OS/2-2 13
@@ -405,7 +454,8 @@ package=asldemx.zip,GNU ~L~inker and GNU assembler for EMX (required)
 # EMX 3
 package=ideemx.zip,~I~DE with integrated compiler (BETA - no debugger)
 # EMX 4
-package=utilsemx.zip[utilemx.zip],~E~xtra Utilities
+#package=utilsemx.zip[utilemx.zip],~E~xtra Utilities
+package=utils-fpcmemx.zip[fpcmemx.zip],Generate Makefiles out of Makefile.fpc files
 # EMX 5
 package=makeemx.zip,GNU ~U~tilities (needed for Makefile usage)
 # EMX 6
@@ -445,6 +495,30 @@ package=uhermesemx.zip[uhermemx.zip],Port of Hermes graphics library
 package=ufppkgemx.zip[ufppkemx.zip],Units for FPPkg packaging support
 # EMX 23
 package=uopensslemx.zip[uosslemx.zip],OpenSSL interface units
+# EMX 24
+package=utils-fpcmkcfgemx.zip[fcmkemx.zip],Creation of Free Pascal configuration files
+# EMX 25
+package=utils-fpdocemx.zip[fpdocemx.zip],Free Pascal documentation generation utility.
+# EMX 26
+package=utils-fpmcemx.zip[fpmcemx.zip],Free Pascal Message Compiler.
+# EMX 27
+package=utils-fppkgemx.zip[fppkgemx.zip],Free Pascal package repository utility.
+# EMX 28
+package=utils-fprcpemx.zip[fprcpemx.zip],Free Pascal Resource Compiler Preprocessor
+# EMX 29
+package=utils-fpcresemx.zip[fpresemx.zip],Free Pascal Resource Converter
+# EMX 30
+package=utils-h2pasemx.zip[h2pasemx.zip],Create Pascal interface units from C headers
+# EMX 31
+package=utils-pas2fpmemx.zip[p2fmemx.zip],Generate fpmake.pp for Pascal source
+# EMX 32
+package=utils-pas2jniemx.zip[p2jnemx.zip],Generate JNI bridge for Pascal code
+# EMX 33
+package=utils-pas2utemx.zip[p2utemx.zip],Pascal source to FPC Unit test generator
+# EMX 34
+package=utils-rmwaitemx.zip[rmwemx.zip],Remove (delete) file(s) with optional retries
+# EMX 35
+package=utils-lexyaccemx.zip[tplyemx.zip],Compiler generator for TP and compatibles
 
 #
 # EMX packages 2nd part
@@ -468,11 +542,11 @@ package=uunzipemx.zip[uzipemx.zip],Unzip units
 # EMX-2 8
 #package=ummtkemx.zip,MMOS/2 interface units
 # EMX-2 9
-package=ux11emx.zip,X11 interface units
+package=ux11emx.zip,X Window (X11) interface units
 # EMX-2 10
 package=ugtk1emx.zip,GTK1 interface units
 # EMX-2 11
-package=ufpgtkemx.zip,fpGTK units
+package=units-fpgtkemx.zip[ufpgtemx.zip],Lightweight OOP wrapper over GTK1
 # EMX-2 12
 package=uimlibemx.zip[uimlbemx.zip],ImLib interface units
 # EMX-2 13
@@ -576,6 +650,34 @@ package=units-graph.source.zip[ugrphsrc.zip],Unit Graph sources
 package=units-hermes.source.zip[uhermsrc.zip],Port of Hermes graphics library
 # Source 18
 package=units-fppkg.source.zip[ufppksrc.zip],Units for FPPkg packaging support
+# Source 19
+package=utils-dxegen.source.zip[dxegsrc.zip],Generation of D~X~E modules loadable at runtime
+# Source 20
+package=utils-fpcmkcfg.source.zip[fcmksrc.zip],Creation of Free Pascal configuration files
+# Source 21
+package=utils-fpcm.source.zip[fpcmsrc.zip],Generate Makefiles out of Makefile.fpc files
+# Source 22
+package=utils-fpdoc.source.zip[fpdocsrc.zip],Free Pascal documentation generation utility
+# Source 23
+package=utils-fpmc.source.zip[fpmcsrc.zip],Free Pascal Message Compiler
+# Source 24
+package=utils-fppkg.source.zip[fppkgsrc.zip],Free Pascal package repository utility
+# Source 25
+package=utils-fprcp.source.zip[fprcpsrc.zip],Free Pascal Resource Compiler Preprocessor
+# Source 26
+package=utils-fpcres.source.zip[fpressrc.zip],Free Pascal Resource Converter
+# Source 27
+package=utils-h2pas.source.zip[h2passrc.zip],Create Pascal interface units from C headers
+# Source 28
+package=utils-pas2fpm.source.zip[p2fmsrc.zip],Generate fpmake.pp for Pascal source
+# Source 29
+package=utils-pas2jni.source.zip[p2jnsrc.zip],Generate JNI bridge for Pascal code
+# Source 30
+package=utils-pas2ut.source.zip[p2utsrc.zip],Pascal source to FPC Unit test generator
+# Source 31
+package=utils-rmwait.source.zip[rmwsrc.zip],Remove (delete) file(s) with optional retries
+# Source 32
+package=utils-lexyacc.source.zip[tplysrc.zip],Compiler generator for TP and compatibles
 
 #
 # Source packages 2nd part
@@ -603,6 +705,7 @@ package=units-os2units.source.zip[uos2src.zip],Units interfacing libraries deliv
 #package=units-clkdll.source.zip[uclksrc.zip],CLKDLL interface unit (eCS 1.1+)
 # Source-2 10
 #package=units-lvm.source.zip[ulvmsrc.zip],OS/2 LVM interface unit sources
+package=units-gtk1.source.zip[ugtk1src.zip],Header to the GTK widgetset (v1)
 # Source-2 11
 package=units-pasjpeg.source.zip[upjpsrc.zip],PasJPEG units sources
 # Source-2 12
@@ -612,7 +715,7 @@ package=units-libpng.source.zip[ulpngsrc.zip],LibPNG interface units sources
 # Source-2 14
 package=units-imlib.source.zip[uimlbsrc.zip],ImLib interface units sources
 # Source-2 15
-package=units-fpgtk.source.zip[ufpgtsrc.zip],fpGTK units sources
+package=units-fpgtk.source.zip[ufpgtsrc.zip],Lightweight OOP wrapper over GTK1 sources
 # Source-2 16
 package=units-sqlite.source.zip[usqltsrc.zip],SQLite interface units sources
 # Source-2 17
@@ -635,6 +738,10 @@ package=units-fcl-res.source.zip[ufclesrc.zip],Free Component Library (FCL)-reso
 package=units-bzip2.source.zip[ubz2src.zip],Units for bzip2 decompression
 # Source-2 26
 package=fcl-js.source.zip[ufcjssrc.zip],Free Component Library (FCL)-Javascript support
+# Source-2 27
+package=units-ptc.source.zip[uptcsrc.zip],Free portable framebuffer library
+# Source-2 28
+package=units-x11.source.zip[ux11src.zip],X Window (X11) interface units
 
 
 #

+ 1 - 1
installer/install.pas

@@ -98,7 +98,7 @@ program install;
 
 
      maxpacks=20;
-     maxpackages=45;
+     maxpackages=60;
      maxdefcfgs=1024;
 
      HTMLIndexExt = '.htx';

+ 8 - 4
packages/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-08-17 rev 28432]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
@@ -1157,6 +1157,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1639,10 +1642,11 @@ ifndef BUILDFULLNATIVE
 FPMAKE_OPT+=-sp
 endif
 .NOTPARALLEL:
+fpmkunit_bootstrap:
+	$(MAKE) -C fpmkunit bootstrap
 fpmkunit_clean_bootstrap:
 	$(MAKE) -C fpmkunit clean_bootstrap
-fpmake$(SRCEXEEXT): fpmake.pp $(SUB_FPMAKE_SRCS) fpmake_add.inc fpmake_proc.inc
-	$(MAKE) -C fpmkunit bootstrap
+fpmake$(SRCEXEEXT): fpmake.pp fpmkunit_bootstrap $(SUB_FPMAKE_SRCS) fpmake_add.inc fpmake_proc.inc
 	$(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT)
 all:	fpmake$(SRCEXEEXT)
 	$(LOCALFPMAKE) compile $(FPMAKE_OPT)

+ 3 - 2
packages/Makefile.fpc

@@ -63,10 +63,11 @@ FPMAKE_OPT+=-sp
 endif
 .NOTPARALLEL:
 
+fpmkunit_bootstrap:
+	$(MAKE) -C fpmkunit bootstrap
 fpmkunit_clean_bootstrap:
 	$(MAKE) -C fpmkunit clean_bootstrap
-fpmake$(SRCEXEEXT): fpmake.pp $(SUB_FPMAKE_SRCS) fpmake_add.inc fpmake_proc.inc
-	$(MAKE) -C fpmkunit bootstrap
+fpmake$(SRCEXEEXT): fpmake.pp fpmkunit_bootstrap $(SUB_FPMAKE_SRCS) fpmake_add.inc fpmake_proc.inc
 	$(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT)
 all:	fpmake$(SRCEXEEXT)
 	$(LOCALFPMAKE) compile $(FPMAKE_OPT)

+ 1 - 1
packages/amunits/src/coreunits/intuition.pas

@@ -4091,7 +4091,7 @@ PROCEDURE DrawBorder(rp : pRastPort location 'a0';const border : pBorder locatio
 PROCEDURE DrawImage(rp : pRastPort location 'a0'; image : pImage location 'a1'; leftOffset : LONGINT location 'd0'; topOffset : LONGINT location 'd1'); syscall _IntuitionBase 114;
 PROCEDURE DrawImageState(rp : pRastPort location 'a0'; image : pImage location 'a1'; leftOffset : LONGINT location 'd0'; topOffset : LONGINT location 'd1'; state : ULONG location 'd2';const drawInfo : pDrawInfo location 'a2'); syscall _IntuitionBase 618;
 FUNCTION EasyRequestArgs(window : pWindow location 'a0';const easyStruct : pEasyStruct location 'a1'; idcmpPtr : pULONG location 'a2';const args : POINTER location 'a3') : LONGINT; syscall _IntuitionBase 588;
-PROCEDURE EndRefresh(window : pWindow location 'a0'; complete : LONGINT location 'd0'); syscall _IntuitionBase 366;
+PROCEDURE EndRefresh(window : pWindow location 'a0'; complete : LONGBOOL location 'd0'); syscall _IntuitionBase 366;
 PROCEDURE EndRequest(requester : pRequester location 'a0'; window : pWindow location 'a1'); syscall _IntuitionBase 120;
 PROCEDURE EraseImage(rp : pRastPort location 'a0'; image : pImage location 'a1'; leftOffset : LONGINT location 'd0'; topOffset : LONGINT location 'd1'); syscall _IntuitionBase 630;
 FUNCTION FreeClass(classPtr : pIClass location 'a0') : LongBool; syscall _IntuitionBase 714;

+ 1 - 1
packages/arosunits/src/workbench.pas

@@ -106,7 +106,7 @@ type
     do_Magic: Word;              // A magic number at the start of the file.
     do_Version: Word;            // A version number, so we can change it.
     do_Gadget: TGadget;          // A copy of in core gadget.
-    do_type: Word;
+    do_type: Byte;
     do_DefaultTool: STRPTR;
     do_Tooltypes: PPChar;
     do_CurrentX: LongInt;

+ 3 - 3
packages/fcl-db/src/sqldb/sqldb.pp

@@ -1752,10 +1752,9 @@ begin
   // empty
 end;
 
-function TSQLConnection.StartImplicitTransaction(trans: TSQLHandle;
-  aParams: string): boolean;
+function TSQLConnection.StartImplicitTransaction(trans: TSQLHandle; aParams: string): boolean;
 begin
-  // Do nothing
+  Result:=False;
 end;
 
 function TSQLConnection.GetSchemaInfoSQL( SchemaType : TSchemaType; SchemaObjectName, SchemaPattern : string) : string;
@@ -2119,6 +2118,7 @@ begin
   FreeAndNil(FInsertSQL);
   FreeAndNil(FDeleteSQL);
   FreeAndNil(FUpdateSQL);
+  FreeAndNil(FRefreshSQL);
   FServerIndexDefs.Free;
   inherited Destroy;
 end;

+ 0 - 16
packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp

@@ -38,9 +38,6 @@ const
 type
   PDateTime = ^TDateTime;
   
-  TSqliteOption = (sloTransactions,sloDesignTransactions);
-  TSqliteOptions = set of TSqliteOption;
- 
   TStringArray = Array of string;
   PStringArray = ^TStringArray;
  
@@ -52,8 +49,6 @@ type
   TSQLite3Connection = class(TSQLConnection)
   private
     fhandle: psqlite3;
-    foptions: TSQLiteOptions;
-    procedure setoptions(const avalue: tsqliteoptions);
   protected
     procedure DoInternalConnect; override;
     procedure DoInternalDisconnect; override;
@@ -100,8 +95,6 @@ type
     // Warning: CollationName has to be a UTF-8 string
     procedure CreateCollation(const CollationName: string; eTextRep: integer; Arg: Pointer=nil; Compare: xCompare=nil);
     procedure LoadExtension(LibraryFile: string);
-  published
-    property Options: TSqliteOptions read FOptions write SetOptions;
   end;
 
   { TSQLite3ConnectionDef }
@@ -1055,15 +1048,6 @@ begin
   end;
 end;
 
-procedure TSQLite3Connection.setoptions(const avalue: tsqliteoptions);
-begin
- if avalue <> foptions then 
-   begin
-   checkdisconnected;
-   foptions:= avalue;
-   end;
-end;
-
 
 { TSQLite3ConnectionDef }
 

+ 81 - 18
packages/fcl-process/src/process.pp

@@ -180,6 +180,7 @@ function RunCommandInDir(const curdir,cmdline:string;var outputstring:string):bo
 function RunCommand(const exename:string;const commands:array of string;var outputstring:string):boolean;
 function RunCommand(const cmdline:string;var outputstring:string):boolean; deprecated;
 
+
 implementation
 
 {$i process.inc}
@@ -472,33 +473,88 @@ Const
   READ_BYTES = 65536; // not too small to avoid fragmentation when reading large files.
 
 // helperfunction that does the bulk of the work.
-function internalRuncommand(p:TProcess;var outputstring:string;var exitstatus:integer):integer;
+// We need to also collect stderr output in order to avoid
+// lock out if the stderr pipe is full.
+function internalRuncommand(p:TProcess;var outputstring:string;
+                            var stderrstring:string; var exitstatus:integer):integer;
 var
-    numbytes,bytesread : integer;
+    numbytes,bytesread,available : integer;
+    outputlength, stderrlength : integer;
+    stderrnumbytes,stderrbytesread : integer;
 begin
   result:=-1;
   try
     try
     p.Options :=  [poUsePipes];
     bytesread:=0;
+    outputlength:=0;
+    stderrbytesread:=0;
+    stderrlength:=0;
     p.Execute;
     while p.Running do
       begin
-        Setlength(outputstring,BytesRead + READ_BYTES);
-        NumBytes := p.Output.Read(outputstring[1+bytesread], READ_BYTES);
-        if NumBytes > 0 then
-          Inc(BytesRead, NumBytes)
+        // Only call ReadFromStream if Data from corresponding stream
+        // is already available, otherwise, on  linux, the read call
+        // is blocking, and thus it is not possible to be sure to handle
+        // big data amounts bboth on output and stderr pipes. PM.
+        available:=P.Output.NumBytesAvailable;
+        if  available > 0 then
+          begin
+            if (BytesRead + available > outputlength) then
+              begin
+                outputlength:=BytesRead + READ_BYTES;
+                Setlength(outputstring,outputlength);
+              end;
+            NumBytes := p.Output.Read(outputstring[1+bytesread], available);
+            if NumBytes > 0 then
+              Inc(BytesRead, NumBytes);
+          end
+        // The check for assigned(P.stderr) is mainly here so that
+        // if we use poStderrToOutput in p.Options, we do not access invalid memory.
+        else if assigned(P.stderr) and (P.StdErr.NumBytesAvailable > 0) then
+          begin
+            available:=P.StdErr.NumBytesAvailable;
+            if (StderrBytesRead + available > stderrlength) then
+              begin
+                stderrlength:=StderrBytesRead + READ_BYTES;
+                Setlength(stderrstring,stderrlength);
+              end;
+            StderrNumBytes := p.StdErr.Read(stderrstring[1+StderrBytesRead], available);
+            if StderrNumBytes > 0 then
+              Inc(StderrBytesRead, StderrNumBytes);
+          end
         else
           Sleep(100);
       end;
-    repeat
-      Setlength(outputstring,BytesRead + READ_BYTES);
-      NumBytes := p.Output.Read(outputstring[1+bytesread], READ_BYTES);
-      if NumBytes > 0 then
-        Inc(BytesRead, NumBytes);
-    until NumBytes <= 0;
+    // Get left output after end of execution
+    available:=P.Output.NumBytesAvailable;
+    while available > 0 do
+      begin
+        if (BytesRead + available > outputlength) then
+          begin
+            outputlength:=BytesRead + READ_BYTES;
+            Setlength(outputstring,outputlength);
+          end;
+        NumBytes := p.Output.Read(outputstring[1+bytesread], available);
+        if NumBytes > 0 then
+          Inc(BytesRead, NumBytes);
+        available:=P.Output.NumBytesAvailable;
+      end;
     setlength(outputstring,BytesRead);
-    exitstatus:=p.exitstatus;	
+    while assigned(P.stderr) and (P.Stderr.NumBytesAvailable > 0) do
+      begin
+        available:=P.Stderr.NumBytesAvailable;
+        if (StderrBytesRead + available > stderrlength) then
+          begin
+            stderrlength:=StderrBytesRead + READ_BYTES;
+            Setlength(stderrstring,stderrlength);
+          end;
+        StderrNumBytes := p.StdErr.Read(stderrstring[1+StderrBytesRead], available);
+        if StderrNumBytes > 0 then
+          Inc(StderrBytesRead, StderrNumBytes);
+      end;
+    setlength(stderrstring,StderrBytesRead);
+    exitstatus:=p.exitstatus;
     result:=0; // we came to here, document that.
     except
       on e : Exception do
@@ -512,10 +568,13 @@ begin
     end;
 end;
 
+{ Functions without StderrString }
+
 function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;var outputstring:string;var exitstatus:integer):integer;
 Var
     p : TProcess;
     i : integer;
+    ErrorString : String;
 begin
   p:=TProcess.create(nil);
   p.Executable:=exename;
@@ -524,19 +583,20 @@ begin
   if high(commands)>=0 then
    for i:=low(commands) to high(commands) do
      p.Parameters.add(commands[i]);
-  result:=internalruncommand(p,outputstring,exitstatus);
+  result:=internalruncommand(p,outputstring,errorstring,exitstatus);
 end;
 
 function RunCommandInDir(const curdir,cmdline:string;var outputstring:string):boolean; deprecated;
 Var
     p : TProcess;
     exitstatus : integer;
+    ErrorString : String;
 begin
   p:=TProcess.create(nil);
   p.setcommandline(cmdline);
   if curdir<>'' then
     p.CurrentDirectory:=curdir;
-  result:=internalruncommand(p,outputstring,exitstatus)=0;
+  result:=internalruncommand(p,outputstring,errorstring,exitstatus)=0;
   if exitstatus<>0 then result:=false;
 end;
 
@@ -545,6 +605,7 @@ Var
     p : TProcess;
     i,
     exitstatus : integer;
+    ErrorString : String;
 begin
   p:=TProcess.create(nil);
   p.Executable:=exename;
@@ -553,7 +614,7 @@ begin
   if high(commands)>=0 then
    for i:=low(commands) to high(commands) do
      p.Parameters.add(commands[i]);
-  result:=internalruncommand(p,outputstring,exitstatus)=0;
+  result:=internalruncommand(p,outputstring,errorstring,exitstatus)=0;
   if exitstatus<>0 then result:=false;
 end;
 
@@ -561,10 +622,11 @@ function RunCommand(const cmdline:string;var outputstring:string):boolean; depre
 Var
     p : TProcess;
     exitstatus : integer;
+    ErrorString : String;
 begin
   p:=TProcess.create(nil);
   p.setcommandline(cmdline);
-  result:=internalruncommand(p,outputstring,exitstatus)=0;
+  result:=internalruncommand(p,outputstring,errorstring,exitstatus)=0;
   if exitstatus<>0 then result:=false;
 end;
 
@@ -573,13 +635,14 @@ Var
     p : TProcess;
     i,
     exitstatus : integer;
+    ErrorString : String;
 begin
   p:=TProcess.create(nil);
   p.Executable:=exename;
   if high(commands)>=0 then
    for i:=low(commands) to high(commands) do
      p.Parameters.add(commands[i]);
-  result:=internalruncommand(p,outputstring,exitstatus)=0;
+  result:=internalruncommand(p,outputstring,errorstring,exitstatus)=0;
   if exitstatus<>0 then result:=false;
 end;
 

+ 10 - 3
packages/fpmkunit/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-08-17 rev 28432]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
@@ -1386,6 +1386,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_LIBTAR=1
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_LIBTAR=1
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -2257,7 +2264,7 @@ endif
 $(TARGET_UNITDIRBS):
 	$(MKDIRTREE) $(TARGET_UNITDIRBS)
 bootstrap:	$(TARGET_UNITDIRBS)
-	$(FPCFPMAKE) src/fpmkunit.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(UNITDIR_FPMAKE_RTL)) -FU$(TARGET_UNITDIRBS) $(UNIT_ZIPPER) $(UNIT_PROCESS) $(UNIT_LIBTAR) $(OPT)
+	$(FPCFPMAKE) src/fpmkunit.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(UNITDIR_FPMAKE_RTL)) -FU$(TARGET_UNITDIRBS) $(UNIT_ZIPPER) $(FPCMAKEOPT) $(UNIT_PROCESS) $(UNIT_LIBTAR) $(OPT)
 clean_bootstrap:
 	-$(DELTREE) units_bs
 fpmake: fpmake.pp

+ 1 - 1
packages/fpmkunit/Makefile.fpc

@@ -70,7 +70,7 @@ $(TARGET_UNITDIRBS):
 	$(MKDIRTREE) $(TARGET_UNITDIRBS)
 # We want to have all units inside the single packages/fpmkunit/units/$target directory
 bootstrap:	$(TARGET_UNITDIRBS)
-        $(FPCFPMAKE) src/fpmkunit.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(UNITDIR_FPMAKE_RTL)) -FU$(TARGET_UNITDIRBS) $(UNIT_ZIPPER) $(UNIT_PROCESS) $(UNIT_LIBTAR) $(OPT)
+        $(FPCFPMAKE) src/fpmkunit.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(UNITDIR_FPMAKE_RTL)) -FU$(TARGET_UNITDIRBS) $(UNIT_ZIPPER) $(FPCMAKEOPT) $(UNIT_PROCESS) $(UNIT_LIBTAR) $(OPT)
 # Old	$(FPCFPMAKE) src/fpmkunit.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) -FU$(TARGET_UNITDIRBS) $(UNIT_ZIPPER) $(UNIT_PROCESS) $(UNIT_LIBTAR) $(OPT)
 clean_bootstrap:
 	-$(DELTREE) units_bs

+ 254 - 123
packages/fpmkunit/src/fpmkunit.pp

@@ -48,6 +48,7 @@ Interface
 
 {$IFDEF GO32V2}
  {$DEFINE NO_UNIT_PROCESS}
+ {$DEFINE NO_THREADING}
 {$ENDIF GO32V2}
 
 {$IFDEF NETBSD}
@@ -81,6 +82,9 @@ uses
 {$ifdef UNIX}
   cthreads,
 {$endif UNIX}
+{$ifdef WINDOWS}
+  windows,
+{$endif WINDOWS}
 {$endif NO_THREADING}
   SysUtils, Classes
 {$ifdef HAS_UNIT_PROCESS}
@@ -418,6 +422,37 @@ Type
     Property ConditionalStrings[Index : Integer] : TConditionalDestString Read GetConditionalString Write SetConditionalString; default;
   end;
 
+  { TNotifyEventCollection }
+
+  TNotifyEventAction = (neaBeforeCompile, neaAfterCompile, neaBeforeInstall, neaAfterInstall,
+                        neaBeforeClean, neaAfterClean, neaBeforeArchive, neaAfterArchive,
+                        neaBeforeManifest, neaAfterManifest, neaBeforePkgList, neaAfterPkgList,
+                        neaBeforeCreateBuildEngine, neaAfterCreateBuildengine);
+
+  TNotifyEventActionSet = set of TNotifyEventAction;
+
+  TNotifyEventItem = class(TCollectionItem)
+  private
+    FOnAction: TNotifyEventAction;
+    FOnEvent: TNotifyEvent;
+    FOnProcEvent: TNotifyProcEvent;
+  public
+    property OnAction: TNotifyEventAction read FOnAction write FOnAction;
+    property OnEvent: TNotifyEvent read FOnEvent write FOnEvent;
+    property OnProcEvent: TNotifyProcEvent read FOnProcEvent write FOnProcEvent;
+    procedure CallEvent(Sender: TObject);
+  end;
+
+  TNotifyEventCollection = class(TCollection)
+  private
+    FSupportedActionSet: TNotifyEventActionSet;
+  public
+    constructor create(ASupportedActionSet: TNotifyEventActionSet);
+    procedure AppendEvent(AnAction: TNotifyEventAction; AnEvent: TNotifyEvent);
+    procedure AppendProcEvent(AnACtion: TNotifyEventAction; AnProcEvent: TNotifyProcEvent);
+    procedure CallEvents(AnAction: TNotifyEventAction; Sender: TObject);
+  end;
+
   { TDictionary }
 
   TReplaceFunction = Function (Const AName,Args : String) : String of Object;
@@ -433,7 +468,7 @@ Type
     Procedure RemoveItem(const AName : String);
     Function GetValue(AName : String) : String;
     Function GetValue(const AName,Args : String) : String; virtual;
-    Function ReplaceStrings(Const ASource : String) : String; virtual;
+    Function ReplaceStrings(Const ASource : String; Const MaxDepth: Integer = 10) : String; virtual;
     Function Substitute(Const Source : String; Macros : Array of string) : String; virtual;
   end;
 
@@ -477,10 +512,14 @@ Type
   private
     FOptions: TStrings;
     FTargets: TTargets;
+    FIncludePath: TConditionalStrings;
+    FSourcePath: TConditionalStrings;
   public
     constructor Create(ACollection: TCollection); override;
     destructor Destroy; override;
     property Options: TStrings read FOptions;
+    Property IncludePath : TConditionalStrings Read FIncludePath;
+    Property SourcePath : TConditionalStrings Read FSourcePath;
     property Targets: TTargets read FTargets;
   end;
 
@@ -967,6 +1006,7 @@ Type
     Property Target : String Read FTarget Write SetTarget;
     Property OS : TOS Read FOS Write SetOS;
     Property CPU : TCPU Read FCPU Write SetCPU;
+    Property CompilerVersion : String read FCompilerVersion;
     Property ExplicitOSNone: Boolean read FExplicitOSNone Write FExplicitOSNone;
     Property BuildString : String read GetBuildString;
     Property BuildOS : TOS read GetBuildOS;
@@ -1048,18 +1088,7 @@ Type
     FExternalPackages : TPackages;
     // Events
     FOnLog: TLogEvent;
-    FAfterArchive: TNotifyEvent;
-    FAfterClean: TNotifyEvent;
-    FAfterCompile: TNotifyEvent;
-    FAfterInstall: TNotifyEvent;
-    FAfterManifest: TNotifyEvent;
-    FAfterPkgList: TNotifyEvent;
-    FBeforeArchive: TNotifyEvent;
-    FBeforeClean: TNotifyEvent;
-    FBeforeCompile: TNotifyEvent;
-    FBeforeInstall: TNotifyEvent;
-    FBeforeManifest: TNotifyEvent;
-    FBeforePkgList: TNotifyEvent;
+    FNotifyEventCollection: TNotifyEventCollection;
     FOnCopyFile: TCopyFileProc;
     FOnFinishCopy: TNotifyEvent;
 
@@ -1154,13 +1183,12 @@ Type
     Function ReadyToCompile(APackage:TPackage) : Boolean;
     Procedure Install(APackage : TPackage; AnArchiveFiles: boolean);
     Procedure Archive(APackage : TPackage);
-    Procedure Manifest(APackage : TPackage);
     Procedure PkgList(PkgList: TStrings; APackage : TPackage);
     Procedure Clean(APackage : TPackage; AllTargets: boolean);
     Procedure Clean(APackage : TPackage; ACPU:TCPU; AOS : TOS);
     Procedure CompileDependencies(APackage : TPackage);
-    function CheckDependencies(APackage : TPackage): TCheckDependencyResult;
-    Function  CheckExternalPackage(Const APackageName : String):TPackage;
+    function CheckDependencies(APackage : TPackage; ErrorOnFailure: boolean): TCheckDependencyResult;
+    Function  CheckExternalPackage(Const APackageName : String; ErrorOnFailure: boolean):TPackage;
     procedure CreateOutputDir(APackage: TPackage);
     // Packages commands
     Procedure Compile(Packages : TPackages);
@@ -1179,18 +1207,7 @@ Type
     Property ExternalPackages: TPackages Read FExternalPackages;
     Property StartDir: String Read FStartDir;
     // Events
-    Property BeforeCompile : TNotifyEvent Read FBeforeCompile Write FBeforeCompile;
-    Property AfterCompile : TNotifyEvent Read FAfterCompile Write FAfterCompile;
-    Property BeforeInstall : TNotifyEvent Read FBeforeInstall Write FBeforeInstall;
-    Property AfterInstall : TNotifyEvent Read FAfterInstall Write FAfterInstall;
-    Property BeforeClean : TNotifyEvent Read FBeforeClean Write FBeforeClean;
-    Property AfterClean : TNotifyEvent Read FAfterClean Write FAfterClean;
-    Property BeforeArchive : TNotifyEvent Read FBeforeArchive Write FBeforeArchive;
-    Property AfterArchive : TNotifyEvent Read FAfterArchive Write FAfterArchive;
-    Property BeforeManifest : TNotifyEvent Read FBeforeManifest Write FBeforeManifest;
-    Property AfterManifest : TNotifyEvent Read FAfterManifest Write FAfterManifest;
-    Property BeforePkgList : TNotifyEvent Read FBeforePkgList Write FBeforePkgList;
-    Property AfterPkgList : TNotifyEvent Read FAfterPkgList Write FAfterPkgList;
+    Property NotifyEventCollection: TNotifyEventCollection read FNotifyEventCollection;
     Property OnLog : TLogEvent Read FOnLog Write FOnlog;
   end;
 
@@ -1206,6 +1223,7 @@ Type
     FFPMakeOptionsString: string;
     FPackageVariantSettings: TStrings;
     FPackageVariants: TFPList;
+    FNotifyEventCollection: TNotifyEventCollection;
   Protected
     Procedure Log(Level : TVerboseLevel; Const Msg : String);
     Procedure CreatePackages; virtual;
@@ -1236,6 +1254,7 @@ Type
     Property Packages : TPackages Read GetPackages;
     Property RunMode : TRunMode Read FRunMode;
     Property ListMode : Boolean Read FListMode;
+    Property NotifyEventCollection : TNotifyEventCollection read FNotifyEventCollection;
   end;
 
   { TFPCInstaller }
@@ -1528,6 +1547,7 @@ ResourceString
   SErrCouldNotCompile   = 'Could not compile target %s from package %s';
   SErrUnsupportedBuildmode = 'Package does not support this buildmode';
   SErrPackVarNotExist   = 'There is no package variant with the name "%s"';
+  SErrEventNotSupported = 'Unsupported event type';
 
   SWarnCircularTargetDependency = 'Warning: Circular dependency detected when compiling target %s with target %s';
   SWarnCircularPackageDependency = 'Warning: Circular dependency detected when compiling package %s with package %s';
@@ -1718,7 +1738,7 @@ var
     //ifdef the MsgNum so it contains the correct message numbers for each compiler version.
     MsgNum : array [TMessages] of integer = (3104, 9015);
 
-    n: longint;
+    n,available: longint;
     BuffPos: longint;
     sLine: string;
     ch: char;
@@ -1726,14 +1746,24 @@ var
     ipos: integer;
     snum: string;
   begin
-    // make sure we have room
-    ConsoleOutput.SetSize(BytesRead + READ_BYTES);
 
     // try reading it
     if ReadFromStdErr then
-      n := P.Stderr.Read((ConsoleOutput.Memory + BytesRead)^, READ_BYTES)
+      begin
+        available:=P.Stderr.NumBytesAvailable;
+        // make sure we have room
+        if (bytesRead + Available > ConsoleOutput.Size) then
+          ConsoleOutput.SetSize(BytesRead + Available);
+        n := P.Stderr.Read((ConsoleOutput.Memory + BytesRead)^, available);
+      end
     else
-      n := P.Output.Read((ConsoleOutput.Memory + BytesRead)^, READ_BYTES);
+      begin
+        available:=P.Output.NumBytesAvailable;
+        // make sure we have room
+        if (bytesRead + Available > ConsoleOutput.Size) then
+          ConsoleOutput.SetSize(BytesRead + Available);
+        n := P.Output.Read((ConsoleOutput.Memory + BytesRead)^, available);
+      end;
     if n > 0 then
     begin
       Inc(BytesRead, n);
@@ -1846,7 +1876,7 @@ begin
         SearchResult := FindNext(searchRec);
       end;
   finally
-    FindClose(searchRec);
+    sysutils.FindClose(searchRec);
   end;
 end;
 
@@ -2366,7 +2396,7 @@ procedure SearchFiles(const AFileName: string; Recursive: boolean; var List: TSt
             List.Add(SearchDir + Info.Name);
       until FindNext(Info)<>0;
     end;
-    FindClose(Info);
+    sysutils.FindClose(Info);
   end;
 
 var
@@ -2555,7 +2585,7 @@ function GetDefaultLibGCCDir(CPU : TCPU;OS: TOS; var ErrorMessage: string): stri
       GccExecutable: string;
   begin
     result := '';
-    GccExecutable := ExeSearch(AddProgramExtension('gcc', OS),GetEnvironmentVariable('PATH'));
+    GccExecutable := ExeSearch(AddProgramExtension('gcc', OS),Sysutils.GetEnvironmentVariable('PATH'));
     if FileExists(GccExecutable) then
       begin
 {$ifdef HAS_UNIT_PROCESS}
@@ -2600,12 +2630,16 @@ begin
   inherited Create(ACollection);
   FTargets := TTargets.Create(TTarget);
   FOptions := TStringList.Create;
+  FIncludePath:=TConditionalStrings.Create(TConditionalString);
+  FSourcePath:=TConditionalStrings.Create(TConditionalString);
 end;
 
 destructor TPackageVariant.Destroy;
 begin
   FOptions.Free;
   FTargets.Free;
+  FIncludePath.Free;
+  FSourcePath.Free;
   inherited Destroy;
 end;
 
@@ -3557,11 +3591,11 @@ Procedure TPackage.ListPackage(PkgList : TStrings);
 Var
   S : String;
 begin
-  if OSes = AllOSes then
-    Exit;
-  if ({(OSes = AllOSes) or }(Defaults.OS = osNone) or
-                                (Defaults.OS in OSes)) and
-     ((Defaults.CPU in CPUs) or (Defaults.CPU = cpuNone)) then
+{  if OSes = AllOSes then
+    Exit;}
+  if ((OSes = AllOSes) or (Defaults.OS in OSes)) and
+         ((CPUs = AllCPUs) or (Defaults.CPU in CPUs)) or
+                       (Defaults.OS = osNone) and (Defaults.CPU = cpuNone) then
     begin
       if Defaults.OS = osNone then
         PkgList.Add (Format ('# Source %d', [Succ (PkgList.Count div 2)]))
@@ -3607,9 +3641,11 @@ begin
       PackageVariants.ActivePackageVariantName:= Installer.FPackageVariantSettings.Values[PackageVariants.Name]
     else
       PackageVariants.ActivePackageVariantName:= PackageVariants.DefaultPackageVariantName;
+    IncludePath.AddList(PackageVariants.ActivePackageVariant.IncludePath);
+    SourcePath.AddList(PackageVariants.ActivePackageVariant.SourcePath);
     Dictionary.AddVariable(PackageVariants.Name,PackageVariants.ActivePackageVariantName);
-    SetUnitsOutputDir(FUnitsOutputDir+'$('+PackageVariants.name+')');
-    SetPackageUnitInstallDir(FPackageUnitInstallDir+'$('+PackageVariants.Name+')');
+    SetUnitsOutputDir(IncludeTrailingPathDelimiter(FUnitsOutputDir)+'$('+PackageVariants.name+')');
+    SetPackageUnitInstallDir(IncludeTrailingPathDelimiter(FPackageUnitInstallDir)+'$('+PackageVariants.Name+')');
     // Do not add targets f the package is inherited
     if PackageVariants.MasterPackage=Self then
       for j := 0 to PackageVariants.ActivePackageVariant.Targets.count -1 do
@@ -3879,9 +3915,9 @@ begin
   If (FDocInstallDir<>'') then
     Result:=FDocInstallDir
   else if (Defaults.BuildOS=freebsd) or (Defaults.BuildOS=dragonfly) then
-    result := Prefix+PathDelim+'share'+PathDelim+'doc'+PathDelim+'$(PackageName)'
+    Result:=Prefix+'share'+PathDelim+'doc'+PathDelim+'fpc-$(CompilerVersion)'+PathDelim+'$(PackageName)'
   else If UnixPaths then
-    Result:=Prefix+'share'+PathDelim+'doc'+PathDelim+'fpc-$(PackageName)-$(PACKAGEVERSION)'
+    Result:=Prefix+'share'+PathDelim+'doc'+PathDelim+'fpc-$(CompilerVersion)'+PathDelim+'$(PackageName)'
   else
     Result:=BaseInstallDir+'docs'+PathDelim+'$(PackageName)';
 end;
@@ -3892,9 +3928,9 @@ begin
   If (FExamplesInstallDir<>'') then
     Result:=FExamplesInstallDir
   else if (Defaults.BuildOS=freebsd) or (Defaults.BuildOS=dragonfly) then
-    result := Prefix+PathDelim+'share'+PathDelim+'examples'+PathDelim+'$(PackageName)'
+    Result:=Prefix+'share'+PathDelim+'examples'+PathDelim+'fpc-$(CompilerVersion)'+PathDelim+'$(PackageName)'+PathDelim+'examples'
   else If UnixPaths then
-    Result:=Prefix+'share'+PathDelim+'doc'+PathDelim+'fpc-$(PackageName)-$(PACKAGEVERSION)'+PathDelim+'examples'
+    Result:=Prefix+'share'+PathDelim+'doc'+PathDelim+'fpc-$(CompilerVersion)'+PathDelim+'$(PackageName)'+PathDelim+'examples'
   else
     Result:=BaseInstallDir+'examples'+PathDelim+'$(PackageName)';
 end;
@@ -4133,7 +4169,7 @@ begin
   If (FN='') then
     begin
     // Environment variable.
-    FN:=GetEnvironmentVariable('FPMAKECFG');
+    FN:=SysUtils.GetEnvironmentVariable('FPMAKECFG');
     If (FN<>'') then
       If not FileExists(FN) then
         FN:='';
@@ -4349,7 +4385,7 @@ begin
         BD:='/usr/lib/fpc/'+FCompilerVersion;
     end;
 {$else unix}
-  BD:=FixPath(GetEnvironmentVariable('FPCDIR'), False);
+  BD:=FixPath(SysUtils.GetEnvironmentVariable('FPCDIR'), False);
   if BD='' then
     begin
       BD:=ExtractFilePath(FCompiler)+'..';
@@ -4384,6 +4420,11 @@ begin
   GlobalDictionary.AddVariable('Target',Defaults.Target);
   GlobalDictionary.AddVariable('BuildString',Defaults.BuildString);
   GlobalDictionary.AddVariable('Prefix',Defaults.Prefix);
+  GlobalDictionary.AddVariable('CompilerVersion',Defaults.CompilerVersion);
+  FNotifyEventCollection := TNotifyEventCollection.create([neaBeforeCompile, neaAfterCompile, neaBeforeClean, neaAfterClean,
+                                                           neaBeforeInstall, neaAfterInstall, neaBeforeArchive, neaAfterArchive,
+                                                           neaBeforeManifest, neaAfterManifest, neaBeforePkgList, neaAfterPkgList,
+                                                           neaBeforeCreateBuildEngine, neaAfterCreateBuildengine]);
   CreatePackages;
 end;
 
@@ -4402,6 +4443,7 @@ begin
       TPackageVariants(FPackageVariants.Items[i]).Free;
     end;
   FreeAndNil(FPackageVariants);
+  FreeAndNil(FNotifyEventCollection);
   inherited destroy;
 end;
 
@@ -4433,11 +4475,13 @@ end;
 
 procedure TCustomInstaller.CreateBuildEngine;
 begin
+  NotifyEventCollection.CallEvents(neaBeforeCreateBuildEngine, Self);
   FBuildEngine:=TBuildEngine.Create(Self);
 //  FBuildEngine.Defaults:=Defaults;
   FBuildEngine.ListMode:=FListMode;
   FBuildEngine.Verbose := (FLogLevels = AllMessages);
   FBuildEngine.OnLog:[email protected];
+  NotifyEventCollection.CallEvents(neaAfterCreateBuildengine, Self);
 end;
 
 
@@ -4759,25 +4803,33 @@ end;
 
 procedure TCustomInstaller.Compile(Force: Boolean);
 begin
+  FNotifyEventCollection.CallEvents(neaBeforeCompile, Self);
   FBuildEngine.ForceCompile:=Force;
   FBuildEngine.Compile(Packages);
+  FNotifyEventCollection.CallEvents(neaAfterCompile, Self);
 end;
 
 
 procedure TCustomInstaller.Clean(AllTargets: boolean);
 begin
+  NotifyEventCollection.CallEvents(neaBeforeClean, Self);
   BuildEngine.Clean(Packages, AllTargets);
+  NotifyEventCollection.CallEvents(neaAfterClean, Self);
 end;
 
 
 procedure TCustomInstaller.Install;
 begin
+  NotifyEventCollection.CallEvents(neaBeforeInstall, self);
   BuildEngine.Install(Packages);
+  NotifyEventCollection.CallEvents(neaAfterInstall, self);
 end;
 
 procedure TCustomInstaller.ZipInstall;
 begin
+  NotifyEventCollection.CallEvents(neaBeforeInstall, self);
   BuildEngine.ZipInstall(Packages);
+  NotifyEventCollection.CallEvents(neaAfterInstall, self);
 end;
 
 
@@ -4785,19 +4837,25 @@ procedure TCustomInstaller.Archive;
 begin
   // Force generation of manifest.xml, this is required for the repository
   BuildEngine.Manifest(Packages);
+  NotifyEventCollection.CallEvents(neaBeforeArchive, self);
   BuildEngine.Archive(Packages);
+  NotifyEventCollection.CallEvents(neaAfterArchive, self);
 end;
 
 
 procedure TCustomInstaller.Manifest;
 begin
+  NotifyEventCollection.CallEvents(neaBeforeManifest, self);
   BuildEngine.Manifest(Packages);
+  NotifyEventCollection.CallEvents(neaAfterManifest, self);
 end;
 
 
 procedure TCustomInstaller.PkgList;
 begin
+  NotifyEventCollection.CallEvents(neaBeforePkgList, self);
   BuildEngine.PkgList(Packages);
+  NotifyEventCollection.CallEvents(neaAfterPkgList, self);
 end;
 
 
@@ -4879,7 +4937,9 @@ begin
   // With --start-dir=/path/to/sources.
   FStartDir:=includeTrailingPathDelimiter(GetCurrentDir);
   FExternalPackages:=TPackages.Create(TPackage);
-
+  FNotifyEventCollection := TNotifyEventCollection.create([neaAfterCompile, neaBeforeCompile, neaAfterInstall, neaBeforeInstall,
+                                                           neaAfterClean, neaBeforeClean, neaAfterArchive, neaBeforeArchive,
+                                                           neaAfterManifest, neaBeforeManifest, neaAfterPkgList, neaBeforePkgList]);
 {$ifndef NO_THREADING}
   InitCriticalSection(FGeneralCriticalSection);
 {$endif NO_THREADING}
@@ -4889,6 +4949,7 @@ end;
 destructor TBuildEngine.Destroy;
 begin
   FreeAndNil(FExternalPackages);
+  FreeAndNil(FNotifyEventCollection);
 
 {$ifndef NO_THREADING}
   DoneCriticalsection(FGeneralCriticalSection);
@@ -5119,7 +5180,7 @@ procedure TBuildEngine.SysDeleteFile(Const AFileName : String);
 begin
   if not FileExists(AFileName) then
     Log(vldebug,SDbgFileDoesNotExist,[AFileName])
-  else If Not DeleteFile(AFileName) then
+  else If Not SysUtils.DeleteFile(AFileName) then
     Error(SErrDeletingFile,[AFileName])
   else
     Log(vlInfo,SInfoDeletedFile,[AFileName]);
@@ -5141,13 +5202,43 @@ end;
 procedure TBuildEngine.SysDeleteTree(Const ADirectoryName: String);
 
   function IntRemoveTree(const ADirectoryName: String) : boolean;
+{$ifdef MSWINDOWS}
+  { pulling in shellapi with all it dependent units and packages makes things too
+    complicated so just add the constants here }
+  const
+    FO_DELETE                = $0003;
+    FOF_SILENT               = $0004;
+    FOF_NOCONFIRMATION       = $0010;
+{$endif MSWINDOWS}
   var
+    i: integer;
+{$ifdef MSWINDOWS}
+    SHFileOpStruct: TSHFileOpStruct;
+    DirBuf: array[0..MAX_PATH+1] of TCHAR;
+{$else MSWINDOWS}
     searchRec: TSearchRec;
     SearchResult: longint;
     s: string;
-    i: integer;
+{$endif MSWINDOWS}
+
   begin
     result := true;
+{$ifdef MSWINDOWS}
+    try
+      FillChar(SHFileOpStruct, Sizeof(SHFileOpStruct), 0);
+      FillChar(DirBuf, Sizeof(DirBuf), 0);
+      StrPCopy(DirBuf, ADirectoryName);
+      with SHFileOpStruct do
+      begin
+        pFrom := @DirBuf;
+        wFunc := FO_DELETE;
+        fFlags := FOF_NOCONFIRMATION or FOF_SILENT;
+      end;
+      Result := SHFileOperation(SHFileOpStruct) = 0;
+    except
+      Result := False;
+    end;
+{$else MSWINDOWS}
     SearchResult := FindFirst(IncludeTrailingPathDelimiter(ADirectoryName)+AllFilesMask, faAnyFile+faSymLink, searchRec);
     try
       while SearchResult=0 do
@@ -5176,6 +5267,8 @@ procedure TBuildEngine.SysDeleteTree(Const ADirectoryName: String);
     // bug 21868
     i := 2;
     result := RemoveDir(ADirectoryName);
+{$endif WINDOWS}
+
     while not result and (i>0) do
       begin
         log(vlWarning, SWarnRetryRemDirectory, [ADirectoryName]);
@@ -5459,7 +5552,7 @@ begin
 
           Cmd:=C.Command;
           If (ExtractFilePath(Cmd)='') then
-            Cmd:=ExeSearch(Cmd,GetEnvironmentvariable('PATH'));
+            Cmd:=ExeSearch(Cmd,SysUtils.GetEnvironmentvariable('PATH'));
 
           If (SourceFile<>'') and (DestFile<>'')  then
             begin
@@ -5732,7 +5825,7 @@ procedure TBuildEngine.ResolvePackagePaths(APackage:TPackage);
       begin
         PackageBaseDir:=IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(ABasePath)+ASubDir);
         AnUnitConfigFileName:=PackageBaseDir+APackage.GetUnitConfigOutputFilename(Defaults.CPU,Defaults.OS);
-        PackageBaseDir:=IncludeTrailingPathDelimiter(PackageBaseDir+APackage.GetPackageUnitInstallDir(defaults.CPU, Defaults.OS))+APackage.GetUnitsOutputDir(defaults.CPU, Defaults.OS);
+        PackageBaseDir:=IncludeTrailingPathDelimiter(PackageBaseDir+APackage.GetUnitsOutputDir(defaults.CPU, Defaults.OS));
       end
     else
       begin
@@ -5960,7 +6053,7 @@ begin
   // Convert to string
   Result:='';
   for i:=0 to Args.Count-1 do
-    Result:=Result+' '+maybequoted(Args[i]);
+    Result:=Result+' '+maybequoted(APackage.Dictionary.ReplaceStrings(Args[i]));
   Delete(result,1,1);
 
   if Defaults.UseEnvironment and assigned(Env) then
@@ -5990,7 +6083,7 @@ begin
     FCompiler:=Defaults.Compiler;
     If (ExtractFilePath(FCompiler)='') then
       begin
-      S:=ExeSearch(FCompiler,GetEnvironmentVariable('PATH'));
+      S:=ExeSearch(FCompiler,SysUtils.GetEnvironmentVariable('PATH'));
       If (S<>'') then
          FCompiler:=S;
       end;
@@ -6351,7 +6444,7 @@ begin
 end;
 
 
-function TBuildEngine.CheckExternalPackage(Const APackageName : String):TPackage;
+function TBuildEngine.CheckExternalPackage(Const APackageName : String; ErrorOnFailure: boolean):TPackage;
 var
   S : String;
   F : String;
@@ -6384,7 +6477,7 @@ begin
       // Check recursive implicit dependencies
       CompileDependencies(Result);
     end
-  else
+  else if ErrorOnFailure then
     Error(SErrDependencyNotFound,[APackageName]);
 end;
 
@@ -6418,7 +6511,7 @@ begin
             end
           else
             begin
-              D.Target:=CheckExternalPackage(D.Value);
+              D.Target:=CheckExternalPackage(D.Value, true);
               P:=TPackage(D.Target);
             end;
           if (D.RequireChecksum<>$ffffffff) and
@@ -6430,7 +6523,7 @@ begin
     end;
 end;
 
-function TBuildEngine.CheckDependencies(APackage: TPackage): TCheckDependencyResult;
+function TBuildEngine.CheckDependencies(APackage: TPackage; ErrorOnFailure: boolean): TCheckDependencyResult;
 Var
   I : Integer;
   P : TPackage;
@@ -6460,7 +6553,7 @@ begin
             end
           else
             begin
-              D.Target:=CheckExternalPackage(D.Value);
+              D.Target:=CheckExternalPackage(D.Value, ErrorOnFailure);
               P:=TPackage(D.Target);
             end;
           if (D.RequireChecksum<>$ffffffff) and
@@ -6684,7 +6777,7 @@ begin
           end;
 
           //execute fpdoc
-          Cmd:=ExeSearch('fpdoc',GetEnvironmentvariable('PATH'));
+          Cmd:=ExeSearch('fpdoc',SysUtils.GetEnvironmentvariable('PATH'));
           if Cmd = '' then Cmd := 'fpdoc';
           ExecuteProcess(Cmd, sFPDocFormat + cmdOpts);
         end;
@@ -6731,7 +6824,7 @@ begin
   // dependencies.
   if Defaults.ThreadsAmount=-1 then
     CompileDependencies(APackage)
-  else if CheckDependencies(APackage)=cdNotYetAvailable then
+  else if CheckDependencies(APackage, true)=cdNotYetAvailable then
     begin
       log(vlInfo,'Delaying package '+apackage.name);
       result := False;
@@ -7040,6 +7133,10 @@ begin
   try
     If (APackage.Directory<>'') then
       EnterDir(APackage.Directory);
+    // Check for inherited options (packagevariants) from other packages
+    ResolveDependencies(APackage.Dependencies, (APackage.Collection as TPackages));
+    CheckDependencies(APackage, False);
+    APackage.SetDefaultPackageVariant;
     DoBeforeClean(Apackage);
     AddPackageMacrosToDictionary(APackage, APackage.Dictionary);
     if AllTargets then
@@ -7115,31 +7212,6 @@ begin
 end;
 
 
-Procedure TBuildEngine.Manifest(APackage : TPackage);
-Var
-  L : TStrings;
-  PD,
-  MF : String;
-begin
-  L:=TStringList.Create;
-  Try
-    Log(vlInfo, Format(SInfoManifestPackage,[APackage.Name]));
-    PD:=APackage.Directory;
-    if PD<>'' then
-      PD:=IncludeTrailingPathDelimiter(PD);
-    MF:=PD+ManifestFile;
-    Log(vlDebug, Format(SDbgGenerating, [MF]));
-    L.Add('<?xml version="1.0"?>');
-    L.Add('<packages>');
-    APackage.GetManifest(L);
-    L.Add('</packages>');
-    L.SaveToFile(MF);
-  Finally
-    L.Free;
-  end;
-end;
-
-
 Procedure TBuildEngine.PkgList(PkgList: TStrings; APackage : TPackage);
 begin
   Log(vlInfo, Format(SInfoPkgListPackage,[APackage.Name]));
@@ -7228,8 +7300,7 @@ Var
 {$endif NO_THREADING}
 
 begin
-  If Assigned(BeforeCompile) then
-    BeforeCompile(Self);
+  NotifyEventCollection.CallEvents(neaBeforeCompile, Self);
   FProgressMax:=Packages.Count;
   FProgressCount:=0;
 
@@ -7288,8 +7359,7 @@ begin
       raise Exception.Create(ErrorMessage);
 {$endif NO_THREADING}
     end;
-  If Assigned(AfterCompile) then
-    AfterCompile(Self);
+  NotifyEventCollection.CallEvents(neaAfterCompile, Self);
 end;
 
 
@@ -7298,8 +7368,7 @@ Var
   I : Integer;
   P : TPackage;
 begin
-  If Assigned(BeforeInstall) then
-    BeforeInstall(Self);
+  NotifyEventCollection.CallEvents(neaBeforeInstall, Self);
   For I:=0 to Packages.Count-1 do
     begin
       P:=Packages.PackageItems[i];
@@ -7311,8 +7380,7 @@ begin
       else
         log(vlWarning,SWarnSkipPackageTarget,[P.Name, Defaults.Target]);
     end;
-  If Assigned(AfterInstall) then
-    AfterInstall(Self);
+  NotifyEventCollection.CallEvents(neaAfterInstall, Self);
 end;
 
 procedure TBuildEngine.ZipInstall(Packages: TPackages);
@@ -7322,8 +7390,7 @@ var
   P : TPackage;
 
 begin
-  If Assigned(BeforeInstall) then
-    BeforeInstall(Self);
+  NotifyEventCollection.CallEvents(neaBeforeInstall, Self);
 
   if Defaults.UnixPaths then
     Defaults.IntSetBaseInstallDir('lib/fpc/' + Defaults.FCompilerVersion+ '/')
@@ -7346,8 +7413,7 @@ begin
     FinishArchive(P);
   end;
 
-  If Assigned(AfterInstall) then
-    AfterInstall(Self);
+  NotifyEventCollection.CallEvents(neaAfterInstall, Self);
 end;
 
 
@@ -7356,34 +7422,44 @@ Var
   I : Integer;
   P : TPackage;
 begin
-  If Assigned(BeforeArchive) then
-    BeforeArchive(Self);
+  NotifyEventCollection.CallEvents(neaBeforeArchive, Self);
   Log(vlDebug, SDbgBuildEngineArchiving);
   For I:=0 to Packages.Count-1 do
     begin
       P:=Packages.PackageItems[i];
       Archive(P);
     end;
-  If Assigned(AfterArchive) then
-    AfterArchive(Self);
+  NotifyEventCollection.CallEvents(neaAfterArchive, Self);
 end;
 
 
 procedure TBuildEngine.Manifest(Packages: TPackages);
 Var
+  L : TStrings;
   I : Integer;
   P : TPackage;
 begin
-  If Assigned(BeforeManifest) then
-    BeforeManifest(Self);
+  NotifyEventCollection.CallEvents(neaBeforeManifest, Self);
   Log(vlDebug, SDbgBuildEngineGenerateManifests);
-  For I:=0 to Packages.Count-1 do
-    begin
-      P:=Packages.PackageItems[i];
-      Manifest(P);
-    end;
-  If Assigned(AfterManifest) then
-    AfterManifest(Self);
+
+  L:=TStringList.Create;
+  Try
+    Log(vlDebug, Format(SDbgGenerating, [ManifestFile]));
+    L.Add('<?xml version="1.0"?>');
+    L.Add('<packages>');
+    For I:=0 to Packages.Count-1 do
+      begin
+        P:=Packages.PackageItems[i];
+        Log(vlInfo, Format(SInfoManifestPackage,[P.Name]));
+        P.GetManifest(L);
+      end;
+    L.Add('</packages>');
+    L.SaveToFile(ManifestFile);
+  Finally
+    L.Free;
+  end;
+
+  NotifyEventCollection.CallEvents(neaAfterManifest, Self);
 end;
 
 
@@ -7395,8 +7471,7 @@ Var
   PKGL : String;
 begin
   L:=TStringList.Create;
-  If Assigned(BeforePkgList) then
-    BeforePkgList(Self);
+  NotifyEventCollection.CallEvents(neaBeforePkgList, Self);
   Log(vlDebug, SDbgBuildEngineGeneratePkgList);
 { Consider only the target OS, because the installer would be run there }
   if Defaults.OS in AllLimit83fsOSes then
@@ -7421,8 +7496,7 @@ begin
     L.Free;
   end;
 
-  If Assigned(AfterPkgList) then
-    AfterPkgList(Self);
+  NotifyEventCollection.CallEvents(neaAfterPkgList, Self);
 end;
 
 procedure TBuildEngine.Clean(Packages: TPackages; AllTargets: boolean);
@@ -7430,8 +7504,7 @@ Var
   I : Integer;
   P : TPackage;
 begin
-  If Assigned(BeforeClean) then
-    BeforeClean(Self);
+  NotifyEventCollection.CallEvents(neaBeforeClean, Self);
   Log(vldebug, SDbgBuildEngineCleaning);
   For I:=0 to Packages.Count-1 do
     begin
@@ -7440,8 +7513,7 @@ begin
         Clean(P, AllTargets);
       log(vlWarning, SWarnCleanPackagecomplete, [P.Name]);
     end;
-  If Assigned(AfterClean) then
-    AfterClean(Self);
+  NotifyEventCollection.CallEvents(neaAfterClean, Self);
 end;
 
 {****************************************************************************
@@ -8114,6 +8186,62 @@ begin
   FFunc:=AFunc;
 end;
 
+{****************************************************************************
+                           TNotifyEventItem
+****************************************************************************}
+
+procedure TNotifyEventItem.CallEvent(Sender: TObject);
+begin
+  if assigned(OnEvent) then
+    OnEvent(Sender);
+  if assigned(OnProcEvent) then
+    OnProcEvent(sender);
+end;
+
+{****************************************************************************
+                           TNotifyEventCollection
+****************************************************************************}
+
+constructor TNotifyEventCollection.create(ASupportedActionSet: TNotifyEventActionSet);
+begin
+  FSupportedActionSet:=ASupportedActionSet;
+  inherited create(TNotifyEventItem);
+end;
+
+procedure TNotifyEventCollection.AppendEvent(AnAction: TNotifyEventAction; AnEvent: TNotifyEvent);
+var
+  item: TNotifyEventItem;
+begin
+  if not (AnAction in FSupportedActionSet) then
+    raise Exception.Create(SErrEventNotSupported);
+  item := TNotifyEventItem(add);
+  item.OnEvent:=AnEvent;
+  item.OnAction:=AnAction;
+end;
+
+procedure TNotifyEventCollection.AppendProcEvent(AnAction: TNotifyEventAction; AnProcEvent: TNotifyProcEvent);
+var
+  item: TNotifyEventItem;
+begin
+  if not (AnAction in FSupportedActionSet) then
+    raise Exception.Create(SErrEventNotSupported);
+  item := TNotifyEventItem(add);
+  item.OnProcEvent:=AnProcEvent;
+  item.OnAction:=AnAction;
+end;
+
+procedure TNotifyEventCollection.CallEvents(AnAction: TNotifyEventAction; Sender: TObject);
+var
+  i: integer;
+  item: TNotifyEventItem;
+begin
+  for i := 0 to Count-1 do
+    begin
+      item := TNotifyEventItem(Items[i]);
+      if item.OnAction=AnAction then
+        item.CallEvent(Sender);
+    end;
+end;
 
 {****************************************************************************
                                  TDictionary
@@ -8200,7 +8328,7 @@ begin
 end;
 
 
-function TDictionary.ReplaceStrings(Const ASource: String): String;
+function TDictionary.ReplaceStrings(Const ASource: String; Const MaxDepth: Integer = 10): String;
 Var
   S,FN,FV : String;
   P: Integer;
@@ -8224,7 +8352,10 @@ begin
         end
       else
         FV:='';
-      Result:=Result+GetValue(FN,FV);
+      if MaxDepth > 0 then
+        Result:=Result+ReplaceStrings(GetValue(FN,FV), MaxDepth-1)
+      else
+        Result:=Result+GetValue(FN,FV);
       P:=Pos('$(',S);
     end;
   Result:=Result+S;

+ 66 - 37
packages/fppkg/src/pkgcommands.pp

@@ -16,6 +16,7 @@ uses
   pkgoptions,
   pkgdownload,
   pkgrepos,
+  fpxmlrep,
   fprepos;
 
 type
@@ -392,65 +393,93 @@ var
   P,
   InstalledP,
   AvailP : TFPPackage;
+  PackNr: integer;
+  ManifestPackages : TFPPackages;
+  X : TFPXMLRepositoryHandler;
   L : TStringList;
   status : string;
-  FreeManifest : boolean;
 begin
   if PackageName='' then
     Error(SErrNoPackageSpecified);
-  FreeManifest:=false;
+  ManifestPackages:=nil;
   // Load dependencies for local packages
   if (PackageName=CmdLinePackageName) or (PackageName=CurrentDirPackageName) then
     begin
       ExecuteAction(PackageName,'fpmakemanifest');
-      P:=LoadManifestFromFile(ManifestFileName);
-      FreeManifest:=true;
+      ManifestPackages:=TFPPackages.Create(TFPPackage);
+      X:=TFPXMLRepositoryHandler.Create;
+      try
+        X.LoadFromXml(ManifestPackages,ManifestFileName);
+      finally
+        X.Free;
+      end;
+      if ManifestPackages.Count>0 then
+        begin
+          PackNr:=0;
+          P := ManifestPackages[PackNr];
+        end
+      else
+        begin
+          ManifestPackages.Free;
+          Error(SErrManifestNoSinglePackage,[ManifestFileName]);
+        end;
     end
   else
     P:=AvailableRepository.PackageByName(PackageName);
-  // Find and List dependencies
+
   MissingDependency:=nil;
-  L:=TStringList.Create;
-  for i:=0 to P.Dependencies.Count-1 do
+  while assigned(P) do
     begin
-      D:=P.Dependencies[i];
-      if (CompilerOptions.CompilerOS in D.OSes) and
-         (CompilerOptions.CompilerCPU in D.CPUs) then
+      // Find and List dependencies
+      L:=TStringList.Create;
+      for i:=0 to P.Dependencies.Count-1 do
         begin
-          InstalledP:=InstalledRepository.FindPackage(D.PackageName);
-          // Need installation?
-          if not assigned(InstalledP) or
-             (InstalledP.Version.CompareVersion(D.MinVersion)<0) then
+          D:=P.Dependencies[i];
+          if not ((CompilerOptions.CompilerOS in D.OSes) and (CompilerOptions.CompilerCPU in D.CPUs)) then
+            Log(llDebug,SDbgPackageDependencyOtherTarget,[D.PackageName,MakeTargetString(CompilerOptions.CompilerCPU,CompilerOptions.CompilerOS)])
+          // Skip dependencies that are available within the fpmake-file itself
+          else if not (assigned(ManifestPackages) and assigned(ManifestPackages.FindPackage(D.PackageName))) then
             begin
-              AvailP:=AvailableRepository.FindPackage(D.PackageName);
-              if not assigned(AvailP) or
-                 (AvailP.Version.CompareVersion(D.MinVersion)<0) then
+              InstalledP:=InstalledRepository.FindPackage(D.PackageName);
+              // Need installation?
+              if not assigned(InstalledP) or
+                 (InstalledP.Version.CompareVersion(D.MinVersion)<0) then
                 begin
-                  status:='Not Available!';
-                  MissingDependency:=D;
+                  AvailP:=AvailableRepository.FindPackage(D.PackageName);
+                  if not assigned(AvailP) or
+                     (AvailP.Version.CompareVersion(D.MinVersion)<0) then
+                    begin
+                      status:='Not Available!';
+                      MissingDependency:=D;
+                    end
+                  else
+                    begin
+                      status:='Updating';
+                      L.Add(D.PackageName);
+                    end;
                 end
               else
                 begin
-                  status:='Updating';
-                  L.Add(D.PackageName);
+                  if PackageIsBroken(InstalledP, True) then
+                    begin
+                      status:='Broken, recompiling';
+                      L.Add(D.PackageName);
+                    end
+                  else
+                    status:='OK';
                 end;
+              Log(llInfo,SLogPackageDependency,
+                  [D.PackageName,D.MinVersion.AsString,PackageInstalledVersionStr(D.PackageName),
+                   PackageAvailableVersionStr(D.PackageName),status])
             end
-          else
-            begin
-              if PackageIsBroken(InstalledP, True) then
-                begin
-                  status:='Broken, recompiling';
-                  L.Add(D.PackageName);
-                end
-              else
-                status:='OK';
-            end;
-          Log(llInfo,SLogPackageDependency,
-              [D.PackageName,D.MinVersion.AsString,PackageInstalledVersionStr(D.PackageName),
-               PackageAvailableVersionStr(D.PackageName),status]);
+        end;
+      if assigned(ManifestPackages) and (PackNr<ManifestPackages.Count-1)  then
+        begin
+          inc(PackNr);
+          P := ManifestPackages[PackNr]
         end
       else
-        Log(llDebug,SDbgPackageDependencyOtherTarget,[D.PackageName,MakeTargetString(CompilerOptions.CompilerCPU,CompilerOptions.CompilerOS)]);
+        p := nil;
     end;
   // Give error on first missing dependency
   if assigned(MissingDependency) then
@@ -470,8 +499,8 @@ begin
         pkgglobals.Log(llProgres,SProgrDependenciesInstalled);
     end;
   FreeAndNil(L);
-  if FreeManifest then
-    FreeAndNil(P);
+  if assigned(ManifestPackages) then
+    ManifestPackages.Free;
 end;
 
 

+ 26 - 7
packages/fppkg/src/pkgfpmake.pp

@@ -15,7 +15,8 @@ uses
   pkgoptions,
   pkgglobals,
   pkgmessages,
-  pkgrepos;
+  pkgrepos,
+  fpxmlrep;
 
 type
   { TFPMakeCompiler }
@@ -269,6 +270,29 @@ Var
       AddOption(Name+'='+Value);
   end;
 
+  procedure ObtainSupportedTargetsFromManifest(p:TFPPackage);
+  var
+    X : TFPXMLRepositoryHandler;
+    ManifestPackages : TFPPackages;
+    i: integer;
+  begin
+    p.OSes:=[];
+    p.CPUs:=[];
+    ManifestPackages:=TFPPackages.Create(TFPPackage);
+    X:=TFPXMLRepositoryHandler.Create;
+    try
+      X.LoadFromXml(ManifestPackages,ManifestFileName);
+      for i := 0 to ManifestPackages.Count-1 do
+        begin
+          p.OSes:=p.OSes+ManifestPackages[i].OSes;
+          p.CPUs:=p.CPUs+ManifestPackages[i].CPUs;
+        end;
+    finally
+      X.Free;
+      ManifestPackages.Free;
+    end;
+  end;
+
 begin
   OOptions:='';
   // Does the current package support this CPU-OS?
@@ -276,12 +300,7 @@ begin
     begin
       P:=AvailableRepository.PackageByName(PackageName);
       if (PackageName=CurrentDirPackageName) and (FileExists(ManifestFileName)) then
-        begin
-          ManifestPackage:=LoadManifestFromFile(ManifestFileName);
-          P.OSes:=ManifestPackage.OSes;
-          P.CPUs:=ManifestPackage.CPUs;
-          ManifestPackage.Free;
-        end;
+        ObtainSupportedTargetsFromManifest(p);
     end
   else
     P:=nil;

+ 9 - 1
packages/fv/src/amismsg.inc

@@ -102,6 +102,14 @@ begin
          LastYSize:=height;
          PollSystemEvent:=true;
        end;
+     end else if Video.HasActiveWindow then begin
+       SystemEvent.typ:=SysSetFocus;
+       PutSystemEvent(SystemEvent);
+       PollSystemEvent:=true;
+     end else if Video.HasInactiveWindow then begin
+       SystemEvent.typ:=SysReleaseFocus;
+       PutSystemEvent(SystemEvent);
+       PollSystemEvent:=true;
      end;
-    end;
+   end;
 end;

+ 6 - 0
packages/fv/src/app.pas

@@ -947,8 +947,14 @@ BEGIN
            Drivers.GetMouseEvent(Event);              { Load mouse event }
            If (Event.What = evNothing) Then
              begin
+{$IFNDEF HASAMIGA}
+               { due to isses with the event handling in FV itself,
+                 we skip this here, and let the IDE to handle it
+                 directly on Amiga-like systems. The FV itself cannot
+                 handle the System Events anyway. (KB) }
                Drivers.GetSystemEvent(Event);         { Load system event }
                If (Event.What = evNothing) Then
+{$ENDIF}
                  Idle;     { Idle if no event }
              end;
          End;

+ 2 - 1
packages/fv/src/drivers.pas

@@ -825,7 +825,8 @@ end;
 {$IFDEF OS_AMIGA}
   begin
     { AmigaOS Delay() wait's argument in 1/50 seconds }
-    DOSDelay(2);
+    { DOSDelay(2); // the old solution... }
+    Keyboard.WaitForSystemEvent(150);
   end;
 {$ENDIF OS_AMIGA}
 

+ 3 - 3
packages/gtk2/examples/gtk_demo/drawingarea.inc

@@ -38,7 +38,7 @@ begin
   (* Initialize the pixmap to white *)
   gdk_draw_rectangle (da_pixmap,
                       widget^.style^.white_gc,
-                      gTRUE,
+                      gint(gTRUE),
                       0, 0,
                       widget^.allocation.width,
                       widget^.allocation.height);
@@ -85,7 +85,7 @@ begin
   (* Paint to the pixmap, where we store our state *)
   gdk_draw_rectangle (da_pixmap,
               widget^.style^.black_gc,
-                      gTRUE,
+                      gint(gTRUE),
                       update_rect.x, update_rect.y,
                       update_rect.width, update_rect.height);
 
@@ -199,7 +199,7 @@ begin
            *)
           gdk_draw_rectangle (da^.window,
                               gc,
-                              gTRUE,
+                              gint(gTRUE),
                               i, j,
                               CHECK_SIZE,
                               CHECK_SIZE);

+ 1 - 1
packages/gtk2/examples/helloworld/helloworld.pas

@@ -12,7 +12,7 @@ begin
    g_print ('Hello World'#13#10);
 end;
 
-function delete_event( Widget: PGtkWidget; Event: PGdkEvent; Data: gpointer):gint; cdecl;
+function delete_event( Widget: PGtkWidget; Event: PGdkEvent; Data: gpointer):gboolean; cdecl;
 begin
   (* If you return FALSE in the "delete_event" signal handler,
    * GTK will emit the "destroy" signal. Returning TRUE means

+ 3 - 3
packages/gtk2/examples/scribble_simple/scribble_simple.pas

@@ -24,7 +24,7 @@ begin
                             -1);
   gdk_draw_rectangle (pixmap,
                               widget^.style^.white_gc,
-                              gTRUE,
+                              gint(gTRUE),
                               0, 0,
                               widget^.allocation.width,
                               widget^.allocation.height);
@@ -61,7 +61,7 @@ begin
 
   gdk_draw_rectangle (pixmap,
                               widget^.style^.black_gc,
-                          gTRUE,
+                          gint(gTRUE),
                               update_rect.x, update_rect.y,
                               update_rect.width, update_rect.height);
 
@@ -86,7 +86,7 @@ var
   state : TGdkModifierType;
 
 begin
-  if event^.is_hint = gTRUE then
+  if event^.is_hint = gint(gTRUE) then
     gdk_window_get_pointer (event^.window, @x, @y, @state)
   else begin
     x := round (event^.x);

Fișier diff suprimat deoarece este prea mare
+ 1025 - 85
packages/libndsfpc/examples/graphics/Effects/windows/Makefile


+ 2 - 2
packages/libndsfpc/examples/graphics/Effects/windows/Makefile.fpc

@@ -17,7 +17,7 @@ fpcpackage=y
 [default]
 cpu=arm
 target=nds
-fpcdir=
+fpcdir=../../../../../..
 
 [compiler]
 options=-g -Xm  
@@ -90,4 +90,4 @@ $(BIN_FILES): $(wildcard %.*)
         @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size": cuint32; cvar; external;" >> `(echo "inc/"$(@F) | tr . .)`.inc
         @echo 'Assembling $(@).s file...'
         @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s
-        @echo 'Done!'
+        @echo 'Done!'

Fișier diff suprimat deoarece este prea mare
+ 1027 - 87
packages/libndsfpc/examples/graphics/Ext_Palettes/backgrounds/Makefile


+ 2 - 2
packages/libndsfpc/examples/graphics/Ext_Palettes/backgrounds/Makefile.fpc

@@ -17,7 +17,7 @@ fpcpackage=y
 [default]
 cpu=arm
 target=nds
-fpcdir=
+fpcdir=../../../../../..
 
 [compiler]
 options=-g -Xm  
@@ -92,4 +92,4 @@ $(BIN_FILES): $(wildcard %.*)
         @echo " " `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size": cuint32; cvar; external;" >> `(echo "$(INC)/"$(@F) | tr . .)`.inc
         @echo 'Assembling $(@).s file...'
         @$(AS) -o $(BUILD)/$(@).o $(BUILD)/$(@).s
-        @echo 'Done!'
+        @echo 'Done!'

+ 1 - 1
packages/morphunits/src/intuition.pas

@@ -4211,7 +4211,7 @@ SysCall IntuitionBase 354;
 function BuildSysRequest(window : pWindow location 'a0'; body : pIntuiText location 'a1'; posText : pIntuiText location 'a2'; negText : pIntuiText location 'a3'; flags : CARDINAL location 'd0'; width : CARDINAL location 'd1'; height : CARDINAL location 'd2') : pWindow;
 SysCall IntuitionBase 360;
 
-procedure EndRefresh(window : pWindow location 'a0'; complete : LongInt location 'd0');
+procedure EndRefresh(window : pWindow location 'a0'; complete : LongBool location 'd0');
 SysCall IntuitionBase 366;
 
 procedure FreeSysRequest(window : pWindow location 'a0');

+ 161 - 2
packages/rtl-console/src/amicommon/keyboard.pp

@@ -17,10 +17,24 @@ interface
 
 {$i keybrdh.inc}
 
+{
+  Amiga specific function, waits for a system event to occur on the
+  message port of the window. This is mainly used in Free Vision to
+  give up the Task's timeslice instead of dos.library/Delay() which
+  blocks the event handling and ruins proper window refreshing among
+  others 
+  input: specify a timeout to wait for an event to arrive. this is the
+         maximum timeout. the function might return earlier or even
+         immediately if there's an event. it's specified in milliseconds
+  result: boolean if there is an incoming system event. false otherwise
+}
+
+function WaitForSystemEvent(millisec: Integer): boolean;
+
 implementation
 
 uses
-   video, exec,intuition, inputevent, mouse, sysutils, keymap;
+   video, exec, intuition, inputevent, mouse, sysutils, keymap, timer;
 
 {$i keyboard.inc}
 {$i keyscan.inc}
@@ -212,6 +226,36 @@ begin
       SetShiftState(IQual); // set Shift state qualifiers. do this for all messages we get.
       // main event case
       case (IClass) of
+        IDCMP_ACTIVEWINDOW: begin
+            GotActiveWindow;
+          end;
+        IDCMP_INACTIVEWINDOW: begin
+            // force cursor off. we stop getting IntuiTicks when 
+            // the window is inactive, so the blinking stops.
+            ToggleCursor(true);
+            GotInactiveWindow;
+          end;
+        IDCMP_INTUITICKS: begin
+            ToggleCursor(false);
+            MouseX := (MouseX - VideoWindow^.BorderLeft) div 8;
+            MouseY := (MouseY - VideoWindow^.BorderTop) div 16;
+            if (MouseX >= 0) and (MouseY >= 0) and
+               (MouseX < Video.ScreenWidth) and (MouseY < Video.ScreenHeight) and
+               ((MouseX <> OldMouseX) or (MouseY <> OldmouseY))
+              then begin
+//              //writeln('mousemove:',Mousex,'/',Mousey,' oldbutt:',OldButtons);
+              // Drawing is very slow so when moving window it will drag behind
+              // because the mouse events stack in the messageport
+              // -> so we override move until messageport is empty or keyevent is fired
+              SendMouse := True;
+              MouseEvent := True;
+              mes.Action := MouseActionMove;
+              mes.Buttons := OldButtons;
+              mes.X := MouseX;
+              mes.Y := MouseY;
+              //PutMouseEvent(me);
+            end;
+          end;
         IDCMP_CLOSEWINDOW: begin
             //writeln('got close');
             GotCloseWindow;
@@ -219,6 +263,9 @@ begin
         IDCMP_CHANGEWINDOW: begin
             GotResizeWindow;
           end;
+        IDCMP_REFRESHWINDOW: begin
+            GotRefreshWindow;
+          end;
         IDCMP_MOUSEBUTTONS: begin
             MouseEvent := True;
             me.x := (MouseX - videoWindow^.BorderLeft) div 8;  // calculate char position
@@ -256,6 +303,9 @@ begin
             //writeln('Buttons: ' , me.Buttons);
           end;
         IDCMP_MOUSEMOVE: begin
+            { IDCMP_MOUSEMOVE is disabled now in the video unit,
+              according to autodocs INTUITICKS should be enough
+              to handle most moves, esp. in a "textmode" app }
             MouseX := (MouseX - VideoWindow^.BorderLeft) div 8;
             MouseY := (MouseY - VideoWindow^.BorderTop) div 16;
             if (MouseX >= 0) and (MouseY >= 0) and
@@ -456,6 +506,111 @@ begin
   SysGetShiftState := LastShiftState;
 end;
 
+var
+  waitTPort:  PMsgPort;
+  waitTimer: PTimeRequest;
+  waitTimerFired: boolean;
+
+function WaitForSystemEvent(millisec: Integer): boolean;
+var
+  windowbit: PtrUInt;
+  timerbit: PtrUInt;
+  recvbits: PtrUInt;
+begin
+  WaitForSystemEvent:=false;
+  if waitTPort = nil then
+  begin
+    { this really shouldn't happen, but it's enough to avoid a
+      crash if the timer init failed during startup }
+    if VideoWindow <> nil then
+      WaitPort(VideoWindow^.UserPort);
+    exit;
+  end;
+
+  windowbit:=0;
+  if VideoWindow <> nil then
+  begin
+    if not IsMsgPortEmpty(VideoWindow^.UserPort) then
+    begin
+      WaitForSystemEvent:=true;
+      exit;
+    end;
+    windowbit:=1 shl (VideoWindow^.UserPort^.mp_SigBit);
+  end;
+  timerbit:=0;
+  if waitTPort <> nil then
+    timerbit:=1 shl (waitTPort^.mp_SigBit);
+  if (windowbit or timerbit) = 0 then exit;
+
+  if not waitTimerFired then
+  begin
+    waitTimer^.tr_node.io_Command:=TR_ADDREQUEST;
+    waitTimer^.tr_time.tv_secs:=millisec div 1000;
+    waitTimer^.tr_time.tv_micro:=(millisec mod 1000) * 1000;
+    SendIO(PIORequest(waitTimer));
+    waitTimerFired:=true;
+  end;
+
+  recvbits:=Wait(windowbit or timerbit);
+  if (recvbits and windowbit) > 0 then
+    WaitForSystemEvent:=true;
+
+  if waitTimerFired then 
+  begin
+    AbortIO(PIORequest(waitTimer));
+    WaitIO(PIORequest(waitTimer));
+    SetSignal(0,timerbit);
+    waitTimerFired:=false;
+  end;
+end;
+
+procedure DoneSystemEventWait;
+begin
+  if assigned(waitTimer) then
+  begin
+    if waitTimerFired then 
+    begin
+      AbortIO(PIORequest(waitTimer));
+      WaitIO(PIORequest(waitTimer));
+      waitTimerFired:=false;
+    end;
+    CloseDevice(PIORequest(waitTimer));
+    DeleteIORequest(PIORequest(waitTimer));
+    waitTimer:=nil;
+  end;
+  if assigned(waitTPort) then
+  begin
+    DeleteMsgPort(waitTPort);
+    waitTPort:=nil;
+  end;
+end;
+
+procedure InitSystemEventWait;
+var
+  initOK: boolean;
+begin
+  waitTimerFired:=false;
+  waitTPort:=CreateMsgPort();
+  if assigned(waitTPort) then
+  begin
+    waitTimer:=PTimeRequest(CreateIORequest(waitTPort,sizeof(TTimeRequest)));
+    if assigned(waitTimer) then
+    begin
+      if OpenDevice(TIMERNAME,UNIT_VBLANK,PIORequest(waitTimer),0) = 0 then
+      begin
+        initOK:=true;
+        waitTimerFired:=false;
+      end;
+    end;
+  end;
+  if not initOK then begin
+    {* this really shouldn't happen if everything is OK with the system *}
+    SysDebugLn('FPC RTL-Console: SystemEventWait Initialization failed!');
+    DoneSystemEventWait;
+  end;
+end;
+
+
 const
   SysKeyboardDriver : TKeyboardDriver = (
     InitDriver : @SysInitKeyBoard;
@@ -468,6 +623,10 @@ const
     TranslateKeyEventUnicode : Nil;
   );
 
-begin
+
+initialization
   SetKeyBoardDriver(SysKeyBoardDriver);
+  InitSystemEventWait;
+finalization
+  DoneSystemEventWait;
 end.

+ 0 - 8
packages/rtl-console/src/amicommon/mouse.pp

@@ -31,14 +31,6 @@ begin
   SysDetectMouse:=3;
 end;
 
-
-
-
-
-
-
-
-
 const
   SysMouseDriver : TMouseDriver = (
     UseDefaultQueue : True;

+ 180 - 44
packages/rtl-console/src/amiga/video.pp → packages/rtl-console/src/amicommon/video.pp

@@ -1,9 +1,9 @@
 {
     This file is part of the Free Pascal run time library.
-    Copyright (c) 2006 by Karoly Balogh
+    Copyright (c) 2006-2014 by Karoly Balogh
     member of the Free Pascal development team
 
-    Video unit for Amiga and MorphOS
+    Video unit for Amiga, MorphOS and AROS
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
@@ -45,6 +45,13 @@ procedure GotCloseWindow;
 function  HasCloseWindow: boolean;
 procedure GotResizeWindow;
 function  HasResizeWindow(var winw:longint; var winh: longint): boolean;
+procedure GotRefreshWindow;
+procedure ToggleCursor(forceOff: boolean);
+procedure GotActiveWindow;
+function HasActiveWindow: boolean;
+procedure GotInactiveWindow;
+function HasInactiveWindow: boolean;
+procedure SetWindowTitle(const winTitle: AnsiString; const screenTitle: AnsiString);
 
 var
   VideoWindow: PWindow;
@@ -69,10 +76,16 @@ var
   VideoColorMap         : PColorMap;
   VideoPens             : array[0..15] of LongInt;
 
+  OldSH, OldSW          : longint;
+
   OldCursorX, 
   OldCursorY            : LongInt;
   CursorType            : Word;
   OldCursorType         : Word;
+  CursorUpdateCnt       : Word;
+  CursorUpdateSpeed     : Word;
+  CursorState           : boolean;
+  ForceCursorUpdate     : boolean;
 
   {$ifdef WITHBUFFERING}
   BitmapWidth, BitmapHeight: Integer;
@@ -81,6 +94,8 @@ var
 
   GotCloseWindowMsg     : Boolean;
   GotResizeWindowMsg    : Boolean;
+  GotActiveWindowMsg    : Boolean;
+  GotInactiveWindowMsg  : Boolean;
   LastL, LastT: Integer;
   LastW, LastH: Integer;
   WindowForReqSave: PWindow;
@@ -134,6 +149,18 @@ begin
   _OpenWindowTags:=OpenWindowTagList(a, @tags);
 end;
 
+const
+  VIDEO_IDCMP_DEFAULTS = IDCMP_RAWKEY       or
+                         IDCMP_MOUSEBUTTONS or
+                         IDCMP_CHANGEWINDOW or IDCMP_CLOSEWINDOW or
+                         IDCMP_ACTIVEWINDOW or IDCMP_INACTIVEWINDOW or
+                         IDCMP_REFRESHWINDOW or
+                         IDCMP_INTUITICKS;
+  { simple refresh would be nicer here, but smart refresh gives better
+    results when moving around the window with the input blocked.
+    (eg. compiling in the IDE) }
+  VIDEO_WFLG_DEFAULTS = WFLG_RMBTRAP or WFLG_SMART_REFRESH;
+
 Function GetWindow: PWindow;
 begin
   if FPC_VIDEO_FULLSCREEN then
@@ -155,11 +182,8 @@ begin
       WA_Activate   , 1,
       WA_Borderless , 1,
       WA_BackDrop   , 1,
-      WA_FLAGS      , (WFLG_GIMMEZEROZERO or WFLG_REPORTMOUSE   or WFLG_RMBTRAP or
-                       WFLG_SMART_REFRESH or WFLG_NOCAREREFRESH),
-      WA_IDCMP      , (IDCMP_RAWKEY       or
-                       IDCMP_MOUSEMOVE    or IDCMP_MOUSEBUTTONS or
-                       IDCMP_CHANGEWINDOW or IDCMP_CLOSEWINDOW)
+      WA_FLAGS      , VIDEO_WFLG_DEFAULTS,
+      WA_IDCMP      , VIDEO_IDCMP_DEFAULTS
     ]); 
   end else  
   begin      // Windowed Mode
@@ -172,14 +196,11 @@ begin
       WA_MaxHeight  , 32768,
       WA_Title      , PtrUInt(PChar('FPC Video Window Output')),
       WA_Activate   , 1,
-      WA_FLAGS      , (WFLG_GIMMEZEROZERO or WFLG_REPORTMOUSE   or
-                       WFLG_SMART_REFRESH or WFLG_NOCAREREFRESH or 
+      WA_FLAGS      , (VIDEO_WFLG_DEFAULTS or
                        WFLG_DRAGBAR       or WFLG_DEPTHGADGET   or WFLG_SIZEGADGET or
-                       WFLG_SIZEBBOTTOM   or WFLG_RMBTRAP       or WFLG_CLOSEGADGET),
-      WA_IDCMP      , (IDCMP_RAWKEY       or
-                       IDCMP_MOUSEMOVE    or IDCMP_MOUSEBUTTONS or
-                       IDCMP_CHANGEWINDOW or IDCMP_CLOSEWINDOW)//,
-    ]);  
+                       WFLG_SIZEBBOTTOM   or WFLG_CLOSEGADGET),
+      WA_IDCMP      , VIDEO_IDCMP_DEFAULTS
+    ]);
   end;
 
   Process := PProcess(FindTask(nil));
@@ -206,8 +227,13 @@ procedure SysInitVideo;
 var
   Counter: LongInt;
 begin
+{$IFDEF MORPHOS}
+  InitGraphicsLibrary;
+  InitIntuitionLibrary;
+{$ENDIF}
+
   {$ifdef VIDEODEBUG}
-  WriteLn('FULLSCREEN VIDEO UNIT MODIFICATION v2');  
+  WriteLn('FULLSCREEN VIDEO UNIT MODIFICATION v2');
   if FPC_VIDEO_FULLSCREEN then
     WriteLn('DEBUG: Recognized fullscreen mode')
   else
@@ -247,9 +273,9 @@ begin
      ScreenColor := True;
    end;
    {$ifdef WITHBUFFERING}
-   BufRp^.Bitmap := AllocBitmap(VideoWindow^.GZZWidth, VideoWindow^.GZZHeight, VideoWindow^.RPort^.Bitmap^.Depth, BMF_CLEAR, VideoWindow^.RPort^.Bitmap);
-   BitmapWidth := VideoWindow^.GZZWidth;
-   BitmapHeight := VideoWindow^.GZZHeight;
+   BufRp^.Bitmap := AllocBitmap(VideoWindow^.InnerWidth, VideoWindow^.InnerHeight, VideoWindow^.RPort^.Bitmap^.Depth, BMF_CLEAR, VideoWindow^.RPort^.Bitmap);
+   BitmapWidth := VideoWindow^.InnerWidth;
+   BitmapHeight := VideoWindow^.InnerHeight;
    {$endif}
    { viewpostcolormap info }
    videoColorMap := pScreen(videoWindow^.WScreen)^.ViewPort.ColorMap;
@@ -272,14 +298,21 @@ begin
    OldCursorY := 0;
    CursorType := crHidden;
    OldCursorType := crHidden;
+   CursorState := true;
+   ForceCursorUpdate:=false;
+   CursorUpdateSpeed:=2; // this could come from an env-var or something
+   CursorUpdateCnt:=0;
 
    GotCloseWindowMsg := false;
    GotResizeWindowMsg := false;
+   GotActiveWindowMsg := false;
+   GotInactiveWindowMsg := false;
 end;
 
 procedure SysDoneVideo;
 var
   Counter: LongInt;
+  msg: PMessage;
 begin
   if VideoWindow <> nil then
   begin
@@ -289,13 +322,21 @@ begin
       LastL := VideoWindow^.LeftEdge;
       LastT := VideoWindow^.TopEdge;
     end;
+    // clean up the messages from our window before closing
+    Forbid();
+    repeat
+      msg:=GetMsg(videoWindow^.UserPort);
+      if (msg <> nil) then ReplyMsg(msg);
+    until msg = nil;
+    ModifyIDCMP(videoWindow,0);
+    Permit();
     CloseWindow(videoWindow);
+    VideoWindow := nil;
   end;
   {$ifdef WITHBUFFERING}
   FreeBitmap(BufRp^.Bitmap);
   BufRp^.Bitmap := nil;
   {$endif}
-  VideoWindow := nil;
   for Counter := 0 to 15 do
     ReleasePen(VideoColorMap, VideoPens[Counter]);
   if ((FPC_VIDEO_FULLSCREEN) and (OS_Screen <> nil)) then
@@ -317,6 +358,7 @@ begin
     begin
       LastT := 50;
       LastL := 50;
+      
       LastW := 80;
       LastH := 25;
     end;
@@ -336,8 +378,6 @@ begin
   SysSetVideoMode := True;
 end;
 
-var
-  OldSH, OldSW : longint;
 
 procedure SysClearScreen;
 begin
@@ -355,12 +395,12 @@ var
   sX, sY: LongInt;
 begin
   TmpCharData := VideoBuf^[y * ScreenWidth + x];
-  TmpChar    := TmpCharData and $0ff;
+  TmpChar    := byte(TmpCharData);
   TmpFGColor := (TmpCharData shr 8) and %00001111;
   TmpBGColor := (TmpCharData shr 12) and %00000111;
 
-  sX := x * 8;
-  sY := y * 16;
+  sX := x * 8 + videoWindow^.borderLeft;
+  sY := y * 16 + videoWindow^.borderTop;
 
   if crType <> crBlock then
   begin
@@ -397,7 +437,7 @@ begin
   if Force then
   begin
     if (OldSH = ScreenHeight) and (OldSW = ScreenWidth) then
-      Force:=false
+      Force := false
     else
     begin
       OldSH := ScreenHeight;
@@ -411,20 +451,21 @@ begin
   end else
   begin
     Counter:=0;
-    while not smallforce and (Counter < (VideoBufSize div 4) - 1) do
-    begin
-      SmallForce := (PDWord(VideoBuf)[Counter] <> PDWord(OldVideoBuf)[Counter]);
-      inc(Counter);
-    end;
+    if not ForceCursorUpdate then
+      while not smallforce and (Counter < (VideoBufSize div 4) - 1) do
+      begin
+        SmallForce := (PDWord(VideoBuf)[Counter] <> PDWord(OldVideoBuf)[Counter]);
+        inc(Counter);
+      end;
   end;
 
   {$ifdef WITHBUFFERING}
-  if (VideoWindow^.GZZWidth > BitmapWidth) or (VideoWindow^.GZZHeight > BitmapHeight) then
+  if (VideoWindow^.InnerWidth > BitmapWidth) or (VideoWindow^.InnerHeight > BitmapHeight) then
   begin
     FreeBitmap(BufRp^.Bitmap);
-    BufRp^.Bitmap := AllocBitmap(VideoWindow^.GZZWidth, VideoWindow^.GZZHeight, VideoWindow^.RPort^.Bitmap^.Depth, BMF_CLEAR, VideoWindow^.RPort^.Bitmap);
-    BitmapWidth := VideoWindow^.GZZWidth;
-    BitmapHeight := VideoWindow^.GZZHeight;
+    BufRp^.Bitmap := AllocBitmap(VideoWindow^.InnerWidth, VideoWindow^.InnerHeight, VideoWindow^.RPort^.Bitmap^.Depth, BMF_CLEAR, VideoWindow^.RPort^.Bitmap);
+    BitmapWidth := VideoWindow^.InnerWidth;
+    BitmapHeight := VideoWindow^.InnerHeight;
     Force := True;
     Smallforce := True;
   end;
@@ -458,14 +499,14 @@ begin
 
   if (CursorType <> OldCursorType) or
      (CursorX <> OldCursorX) or (CursorY <> OldCursorY) or
-     SmallForce then
+     SmallForce or ForceCursorUpdate then
   begin
     {$ifdef WITHBUFFERING}
     DrawChar(BufRp, OldCursorY, OldCursorX, crHidden);
-    DrawChar(BufRp, CursorY, CursorX, CursorType);
+    if CursorState then DrawChar(BufRp, CursorY, CursorX, CursorType);
     {$else}
     DrawChar(VideoWindow^.RPort, OldCursorY, OldCursorX, crHidden);
-    DrawChar(VideoWindow^.RPort, CursorY, CursorX, CursorType);
+    if CursorState then DrawChar(VideoWindow^.RPort, CursorY, CursorX, CursorType);
     {$endif}
     OldCursorX := CursorX;
     OldCursorY := CursorY;
@@ -526,21 +567,116 @@ end;
 
 function HasResizeWindow(var WinW: LongInt; var WinH: LongInt): Boolean;
 begin
-  //writeln('Has resize ', GotResizeWindowMsg);
   WinW := 0;
   WinH := 0;
   HasResizeWindow := GotResizeWindowMsg;
-  if Assigned(VideoWindow) then
+  if GotResizeWindowMsg then
+  begin
+    //writeln('Has resize ', GotResizeWindowMsg);
+    if Assigned(VideoWindow) then
+    begin
+      WinW := VideoWindow^.GZZWidth div 8;
+      WinH := VideoWindow^.GZZHeight div 16;
+//      writeln('resize', winw, ' ',winh);
+      LastW := WinW;
+      LastH := WinH;
+    end
+  end
+  else
   begin
-    //writeln('resize');
-    WinW := VideoWindow^.GZZWidth div 8;
-    WinH := VideoWindow^.GZZHeight div 16;
-    LastW := WinW;
-    LastH := WinH;
+    WinW := LastW;
+    WinH := LastH;
   end;
   GotResizeWindowMsg := False;
 end;
 
+procedure GotRefreshWindow;
+begin
+  if assigned(VideoWindow) then
+  begin
+    oldSH := -1;
+    oldSW := -1;
+    BeginRefresh(VideoWindow);
+    SysUpdateScreen(true);
+    EndRefresh(VideoWindow, true);
+  end;
+end;
+
+procedure ToggleCursor(forceOff: boolean);
+begin
+  if CursorType = crHidden then exit;
+
+  if forceOff then
+  begin
+    CursorState:=false;
+    // to immediately turn on cursor on the next toggle
+    CursorUpdateCnt:=CursorUpdateSpeed;
+  end
+  else
+  begin
+    Inc(CursorUpdateCnt);
+    if CursorUpdateCnt >= CursorUpdateSpeed then
+    begin
+      CursorState:=not CursorState;
+      CursorUpdateCnt:=0;
+    end
+    else
+      exit;
+  end;
+  ForceCursorUpdate:=true;
+  SysUpdateScreen(False);
+  ForceCursorUpdate:=false;
+end;
+
+procedure GotActiveWindow;
+begin
+  GotActiveWindowMsg:=true;
+end;
+
+function HasActiveWindow: boolean;
+begin
+  HasActiveWindow:=GotActiveWindowMsg;
+  GotActiveWindowMsg:=false;
+end;
+
+procedure GotInactiveWindow;
+begin
+  GotInactiveWindowMsg:=true;
+end;
+
+function HasInactiveWindow: boolean;
+begin
+  HasInactiveWindow:=GotInactiveWindowMsg;
+  GotInactiveWindowMsg:=false;
+end;
+
+{ SetWindowTitles seems not to copy the buffer, at least on AROS.
+  So we better keep a reference of the strings to ourselves... }
+var
+  globWinT: AnsiString;
+  globScreenT: AnsiString;
+
+procedure SetWindowTitle(const winTitle: AnsiString; const screenTitle: AnsiString);
+var
+  winT: PChar;
+  screenT: PChar;
+begin
+  globWinT:=winTitle;
+  globScreenT:=screenTitle;
+  if VideoWindow <> nil then
+  begin
+    if globWinT = '' then
+      winT:=PChar(PtrInt(-1))
+    else
+      winT:=PChar(globWinT);
+    if globScreenT = '' then 
+      screenT:=PChar(PtrInt(-1))
+    else
+      screenT:=PChar(globScreenT);
+    SetWindowTitles(VideoWindow, winT, screenT);
+  end;
+end;
+
 function SysGetVideoModeCount: Word;
 begin
   SysGetVideoModeCount := 2;

+ 0 - 606
packages/rtl-console/src/aros/video.pp

@@ -1,606 +0,0 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 2006 by Karoly Balogh
-    member of the Free Pascal development team
-
-    Video unit for Amiga and MorphOS
-
-    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 Video;
-
-{.$define VIDEODEBUG}
-{.$define WITHBUFFERING}
-
-
-{
-  Date: 2013-01-09
-  What: Adjusted FPC video unit for AROS (/AmigaOS?)
-
-  goal:
-  ---------------------------------------------------------------------------
-  Attempt to add user-on-demand support for AROS Fullscreen to the FPC video 
-  unit.
-}
-
-
-interface
-
-uses
-  amigados, intuition, tagsarray, utility, sysutils;
-
-{$i videoh.inc}
-
-
-{ Amiga specific calls, to help interaction between Keyboard, Mouse and
-  Video units, and Free Vision }
-procedure GotCloseWindow;
-function  HasCloseWindow: boolean;
-procedure GotResizeWindow;
-function  HasResizeWindow(var winw:longint; var winh: longint): boolean;
-
-var
-  VideoWindow: PWindow;
-
-implementation
-
-uses
-   exec, agraphics;
-
-{$i video.inc}
-
-{$i videodata.inc}
-
-const
-  VIDEOSCREENNAME = 'FPC Video Screen Output';
-
-var
-  OS_Screen             : PScreen   = nil;    // To hold our screen, when necessary
-  FPC_VIDEO_FULLSCREEN  : Boolean   = False;  // Global that defines when we need to attempt opening on own scren
-
-var
-  VideoColorMap         : PColorMap;
-  VideoPens             : array[0..15] of LongInt;
-
-  OldCursorX, 
-  OldCursorY            : LongInt;
-  CursorType            : Word;
-  OldCursorType         : Word;
-
-  {$ifdef WITHBUFFERING}
-  BitmapWidth, BitmapHeight: Integer;
-  BufRp: PRastPort;
-  {$endif}
-
-  GotCloseWindowMsg     : Boolean;
-  GotResizeWindowMsg    : Boolean;
-  LastL, LastT: Integer;
-  LastW, LastH: Integer;
-  WindowForReqSave: PWindow;
-  Process: PProcess;
-(*
-  GetScreen: pScreen;
-
-  Tries to open a custom screen, which attempt to clone the workbench,
-  and returns the pointer to the screen. Result can be nil when failed
-  otherwise the screen got opened correctly.
-*)
-Function GetScreen: pScreen;
-var
-  ScreenTags: TTagsList;
-  Tags: PTagItem;
-begin
-  AddTags(ScreenTags,[
-    SA_Title          , VIDEOSCREENNAME,
-    SA_Left           , 0,
-    SA_Top            , 0,
-    SA_ShowTitle      , 0,    // Do not show the screen's TitleBar
-    SA_Type           , 1 shl 1, // pubscreen
-    SA_PubName        , VIDEOSCREENNAME,
-    SA_Quiet          , True,
-    SA_LikeWorkbench  , 1     // Let OS  
-  ]);
-  Tags := GetTagPtr(ScreenTags);
-  GetScreen := OpenScreenTagList(nil, Tags);
-  {$ifdef VIDEODEBUG}
-  if (GetScreen <> nil) then
-    Writeln('DEBUG: Opened a new screen')
-  else
-    Writeln('ERROR: Failed to open new screen');
-  {$endif}
-end;
-
-(*
-  GetWindow: pWindow;
-  
-  Tries to create and open a window. Returns the pointer to
-  the window or nil in case of failure.
-
-  The routine keeps the global FPC_FULL_SCREEM option into 
-  account and act accordingly.
-  
-  In windowed mode it returns a window with another kind of 
-  settings then when it has to reside on it's own customscreen.
-*)
-Function GetWindow: PWindow;
-Var
-  WindowTags: TTagsList;
-  Tags: PTagItem;
-begin  
-  if FPC_VIDEO_FULLSCREEN then
-  begin
-    OS_Screen := GetScreen;
-    If OS_Screen = nil then
-      Exit;
-
-    {$ifdef VIDEODEBUG}
-    WriteLn('DEBUG: Opened customscreen succesfully');
-    {$endif}
-    Addtags(WindowTags, [
-      WA_CustomScreen, OS_Screen,
-      WA_Left       , 0,
-      WA_Top        , 0,
-      WA_InnerWidth , (OS_Screen^.Width div 8) * 8,
-      WA_InnerHeight, (OS_Screen^.Height div 16) * 16,
-      WA_AutoAdjust , 1,
-      WA_Activate   , 1,
-      WA_Borderless , 1,
-      WA_BackDrop   , 1,
-      WA_FLAGS      , (WFLG_GIMMEZEROZERO or WFLG_REPORTMOUSE   or WFLG_RMBTRAP or
-                       WFLG_SMART_REFRESH or WFLG_NOCAREREFRESH),
-      WA_IDCMP      , (IDCMP_RAWKEY       or
-                       IDCMP_MOUSEMOVE    or IDCMP_MOUSEBUTTONS or
-                       IDCMP_CHANGEWINDOW or IDCMP_CLOSEWINDOW)
-    ]); 
-  end else  
-  begin      // Windowed Mode
-    AddTags(WindowTags, [
-      WA_Left       , LastL,
-      WA_Top        , LastT,
-      WA_InnerWidth , LastW*8,
-      WA_InnerHeight, LastH*16,
-      WA_MaxWidth   , 32768,
-      WA_MaxHeight  , 32768,
-      WA_Title      , PChar('FPC Video Window Output'),
-      WA_Activate   , 1,
-      WA_FLAGS      , (WFLG_GIMMEZEROZERO or WFLG_REPORTMOUSE   or
-                       WFLG_SMART_REFRESH or WFLG_NOCAREREFRESH or 
-                       WFLG_DRAGBAR       or WFLG_DEPTHGADGET   or WFLG_SIZEGADGET or
-                       WFLG_SIZEBBOTTOM   or WFLG_RMBTRAP       or WFLG_CLOSEGADGET),
-      WA_IDCMP      , (IDCMP_RAWKEY       or
-                       IDCMP_MOUSEMOVE    or IDCMP_MOUSEBUTTONS or
-                       IDCMP_CHANGEWINDOW or IDCMP_CLOSEWINDOW)//,
-    ]);  
-  end;
-
-  Tags := GetTagPtr(WindowTags);
-  GetWindow := OpenWindowTagList(nil, Tags);
-
-  Process := PProcess(FindTask(nil));
-  WindowForReqSave := Process^.pr_WindowPtr;
-  Process^.pr_WindowPtr := GetWindow;
-
-  {$ifdef VIDEODEBUG}
-  If GetWindow <> nil then
-    WriteLn('DEBUG: Sucessfully opened videounit Window')
-  else
-    WriteLn('ERROR: Failed to open videounit Window');
-  {$endif}
-end;
-
-
-// ==========================================================================
-// ==
-// ==  Original source code continues, with minor adjustments
-// ==
-// ==========================================================================
-
-
-procedure SysInitVideo;
-var
-  Counter: LongInt;
-begin
-  {$ifdef VIDEODEBUG}
-  WriteLn('FULLSCREEN VIDEO UNIT MODIFICATION v2');  
-  if FPC_VIDEO_FULLSCREEN then
-    WriteLn('DEBUG: Recognized fullscreen mode')
-  else
-    WriteLn('DEBUG: Recognized windowed mode');
-  {$endif}
-
-  // fill videobuf and oldvideobuf with different bytes, to allow proper first draw
-  FillDword(VideoBuf^, VideoBufSize div 4, $1234D3AD);
-  FillDword(OldVideoBuf^, VideoBufSize div 4, $4321BEEF);
-
-  VideoWindow := GetWindow;
-
-  // nice hardcode values are probably going to screw up things
-  // so wee neeed a way to detrmined how many chars could be on
-  // the screen in both directions. And a bit accurate.
-  if FPC_VIDEO_FULLSCREEN then
-  begin
-    // just to make sure that we are going to use the window width 
-    // and height instead of the one from the screen. 
-    // This is to circumvent that the window (or virtual window from
-    // vision based on characters pixels * characters in both 
-    // dimensions) is actually smaller then the window it resides on.
-    //
-    // Can happen for instance when the window does not hide it's 
-    // borders or title as intended.
-    ScreenWidth := VideoWindow^.GZZWidth div 8;
-    ScreenHeight := VideoWindow^.GZZHeight div 16;
-    ScreenColor := False;
-
-    {$ifdef VIDEODEBUG}
-    Writeln('DEBUG: Fullscreen - windowed - Width * Heigth = ',ScreenWidth,' * ',ScreenHeight);
-    {$endif}
-   end else
-   begin
-     ScreenWidth := LastW;
-     ScreenHeight := LastH;
-     ScreenColor := True;
-   end;
-   {$ifdef WITHBUFFERING}
-   BufRp^.Bitmap := AllocBitmap(VideoWindow^.GZZWidth, VideoWindow^.GZZHeight, VideoWindow^.RPort^.Bitmap^.Depth, BMF_CLEAR, VideoWindow^.RPort^.Bitmap);
-   BitmapWidth := VideoWindow^.GZZWidth;
-   BitmapHeight := VideoWindow^.GZZHeight;
-   {$endif}
-   { viewpostcolormap info }
-   videoColorMap := pScreen(videoWindow^.WScreen)^.ViewPort.ColorMap;
-   
-   for Counter := 0 to 15 do 
-   begin
-     VideoPens[Counter] := ObtainPen(VideoColorMap, LongWord(-1),
-         vgacolors[counter, 0] shl 24, vgacolors[counter, 1] shl 24, vgacolors[counter, 2] shl 24,
-         PEN_EXCLUSIVE);
-     {$ifdef VIDEODEBUG}
-     If VideoPens[Counter] = -1 then
-       WriteLn('errr color[',Counter,'] = ', VideoPens[Counter])
-     else
-       WriteLn('good color[',Counter,'] = ', VideoPens[Counter]);
-     {$endif}        
-   end;   
-   
-   CursorX := 0;
-   CursorY := 0;
-   OldCursorX := 0;
-   OldCursorY := 0;
-   CursorType := crHidden;
-   OldCursorType := crHidden;
-
-   GotCloseWindowMsg := false;
-   GotResizeWindowMsg := false;
-end;
-
-procedure SysDoneVideo;
-var
-  Counter: LongInt;
-begin
-  if VideoWindow <> nil then
-  begin
-    Process^.pr_WindowPtr := WindowForReqSave;
-    if not FPC_VIDEO_FULLSCREEN then
-    begin
-      LastL := VideoWindow^.LeftEdge;
-      LastT := VideoWindow^.TopEdge;
-    end;
-    CloseWindow(videoWindow);
-  end;
-  {$ifdef WITHBUFFERING}
-  FreeBitmap(BufRp^.Bitmap);
-  BufRp^.Bitmap := nil;
-  {$endif}
-  VideoWindow := nil;
-  for Counter := 0 to 15 do
-    ReleasePen(VideoColorMap, VideoPens[Counter]);
-  if ((FPC_VIDEO_FULLSCREEN) and (OS_Screen <> nil)) then
-  begin
-    CloseScreen(OS_Screen);
-  end;
-end;
-
-function SysSetVideoMode(const Mode: TVideoMode): Boolean;
-var
-  dx: integer;
-  dy: integer;
-begin
-  if ScreenColor <> Mode.Color then
-  begin
-    SysDoneVideo;
-    FPC_VIDEO_FULLSCREEN := not Mode.color;
-    if not FPC_VIDEO_FULLSCREEN then
-    begin
-      LastT := 50;
-      LastL := 50;
-      LastW := 80;
-      LastH := 25;
-    end;
-    SysInitVideo;
-  end else
-    if not FPC_VIDEO_FULLSCREEN then
-    begin
-      dx := (Mode.col * 8) - VideoWindow^.GZZWidth;
-      dy := (Mode.row * 16) - VideoWindow^.GZZHeight;
-      SizeWindow(videoWindow, dx, dy);
-    end;
-  ScreenWidth := Mode.col;
-  ScreenHeight := Mode.row;
-  LastW := Mode.Col;
-  LastH := Mode.Row;
-  ScreenColor := Mode.color;
-  SysSetVideoMode := True;
-end;
-
-var
-  OldSH, OldSW : longint;
-
-procedure SysClearScreen;
-begin
-  oldSH := -1;
-  oldSW := -1;
-  UpdateScreen(True);
-end;
-
-procedure DrawChar(rp: PRastPort; x, y: LongInt; crType: Word);
-var
-  TmpCharData: Word;
-  TmpChar: Byte;
-  TmpFGColor: Byte;
-  TmpBGColor: Byte;
-  sX, sY: LongInt;
-begin
-  TmpCharData := VideoBuf^[y * ScreenWidth + x];
-  TmpChar    := TmpCharData and $0ff;
-  TmpFGColor := (TmpCharData shr 8) and %00001111;
-  TmpBGColor := (TmpCharData shr 12) and %00000111;
-
-  sX := x * 8;
-  sY := y * 16;
-
-  if crType <> crBlock then
-  begin
-    SetABPenDrMd(rp, VideoPens[TmpFGColor], VideoPens[tmpBGColor], JAM2);
-  end else
-  begin
-    { in case of block cursor, swap fg/bg colors
-      and BltTemplate() below will take care of everything }
-    SetABPenDrMd(rp, VideoPens[tmpBGColor], VideoPens[tmpFGColor], JAM2);
-  end;
-
-  BltTemplate(@Vgafont[tmpChar, 0], 0, 1, rp, sX, sY, 8, 16);
-
-  if crType = crUnderLine then
-  begin
-    { draw two lines at the bottom of the char, in case of underline cursor }
-    GfxMove(rp, sX, sY + 14); Draw(rp, sX + 7, sY + 14);
-    GfxMove(rp, sX, sY + 15); Draw(rp, sX + 7, sY + 15);
-  end;
-end;
-
-procedure SysUpdateScreen(Force: Boolean);
-var
-  BufCounter: Longint;
-  SmallForce: Boolean;
-  Counter, CounterX, CounterY: LongInt;
-  //BufRp: PRastPort;
-  t: Double;
-  NumChanged: Integer;
-begin
-  SmallForce := False;
-
-  // override forced update when screen dimensions haven't changed
-  if Force then
-  begin
-    if (OldSH = ScreenHeight) and (OldSW = ScreenWidth) then
-      Force:=false
-    else
-    begin
-      OldSH := ScreenHeight;
-      OldSW := ScreenWidth;
-    end;
-  end;
-
-  if Force then
-  begin
-    SmallForce:=true;
-  end else
-  begin
-    Counter:=0;
-    while not smallforce and (Counter < (VideoBufSize div 4) - 1) do
-    begin
-      SmallForce := (PDWord(VideoBuf)[Counter] <> PDWord(OldVideoBuf)[Counter]);
-      inc(Counter);
-    end;
-  end;
-
-  {$ifdef WITHBUFFERING}
-  if (VideoWindow^.GZZWidth > BitmapWidth) or (VideoWindow^.GZZHeight > BitmapHeight) then
-  begin
-    FreeBitmap(BufRp^.Bitmap);
-    BufRp^.Bitmap := AllocBitmap(VideoWindow^.GZZWidth, VideoWindow^.GZZHeight, VideoWindow^.RPort^.Bitmap^.Depth, BMF_CLEAR, VideoWindow^.RPort^.Bitmap);
-    BitmapWidth := VideoWindow^.GZZWidth;
-    BitmapHeight := VideoWindow^.GZZHeight;
-    Force := True;
-    Smallforce := True;
-  end;
-  {$endif}
-
-  BufCounter:=0;
-  NumChanged:=0;
-  if Smallforce then
-  begin
-    //t := now();
-    for CounterY := 0 to ScreenHeight - 1 do
-    begin
-      for CounterX := 0 to ScreenWidth - 1 do
-      begin
-        if (VideoBuf^[BufCounter] <> OldVideoBuf^[BufCounter]) or Force then
-        begin
-          {$ifdef WITHBUFFERING}
-          DrawChar(BufRp, CounterX, CounterY, crHidden);
-          {$else}
-          DrawChar(VideoWindow^.RPort, CounterX, CounterY, crHidden);
-          {$endif}
-          OldVideoBuf^[BufCounter] := VideoBuf^[BufCounter];
-          Inc(NumChanged);
-        end;
-        Inc(BufCounter);
-      end;
-    end;
-    //if NumChanged > 100 then
-    //  writeln('redraw time: ', floattoStrF((Now-t)* 24 * 60 * 60 * 1000000 / NumChanged, fffixed, 8,3), ' us/char' ); // ms
-  end;
-
-  if (CursorType <> OldCursorType) or
-     (CursorX <> OldCursorX) or (CursorY <> OldCursorY) or
-     SmallForce then
-  begin
-    {$ifdef WITHBUFFERING}
-    DrawChar(BufRp, OldCursorY, OldCursorX, crHidden);
-    DrawChar(BufRp, CursorY, CursorX, CursorType);
-    {$else}
-    DrawChar(VideoWindow^.RPort, OldCursorY, OldCursorX, crHidden);
-    DrawChar(VideoWindow^.RPort, CursorY, CursorX, CursorType);
-    {$endif}
-    OldCursorX := CursorX;
-    OldCursorY := CursorY;
-    OldcursorType := CursorType;
-  end;
-  {$ifdef WITHBUFFERING}
-  BltBitMapRastPort(BufRp^.Bitmap, 0, 0, VideoWindow^.RPort, 0, 0, ScreenWidth * 8, ScreenHeight * 16, $00C0);
-  {$endif}
-end;
-
-
-procedure SysSetCursorPos(NewCursorX, NewCursorY: Word);
-begin
-  CursorX := NewCursorY;
-  CursorY := NewCursorX;
-  SysUpdateScreen(False);
-end;
-
-function SysGetCapabilities: Word;
-begin
-  SysGetCapabilities := cpColor or cpChangeCursor;
-end;
-
-function SysGetCursorType: Word;
-begin
-  SysGetCursorType := cursorType;
-end;
-
-
-procedure SysSetCursorType(NewType: Word);
-begin
-  cursorType := newType;
-  { FIXME: halfBlock cursors are not supported for now
-           by the rendering code }
-  if CursorType = crHalfBlock then
-    cursorType := crBlock;
-
-  SysUpdateScreen(False);
-end;
-
-
-// Amiga specific calls
-procedure GotCloseWindow;
-begin
-  GotCloseWindowMsg := True;
-end;
-
-function HasCloseWindow: Boolean;
-begin
-  HasCloseWindow := GotCloseWindowMsg;
-  GotCloseWindowMsg := False;
-end;
-
-procedure GotResizeWindow;
-begin
-  GotResizeWindowMsg := True;
-end;
-
-function HasResizeWindow(var WinW: LongInt; var WinH: LongInt): Boolean;
-begin
-  //writeln('Has resize ', GotResizeWindowMsg);
-  WinW := 0;
-  WinH := 0;
-  HasResizeWindow := GotResizeWindowMsg;
-  if Assigned(VideoWindow) then
-  begin
-    //writeln('resize');
-    WinW := VideoWindow^.GZZWidth div 8;
-    WinH := VideoWindow^.GZZHeight div 16;
-    LastW := WinW;
-    LastH := WinH;
-  end;
-  GotResizeWindowMsg := False;
-end;
-
-function SysGetVideoModeCount: Word;
-begin
-  SysGetVideoModeCount := 2;
-end;
-
-function SysGetVideoModeData(Index: Word; var Mode: TVideoMode): Boolean;
-var
-   Screen: PScreen;
-begin
-  case Index of
-    0: begin
-         Mode.Col := 80;
-         Mode.Row := 25;
-         Mode.Color := True;
-       end;
-    1: begin
-        Screen := LockPubScreen('Workbench');
-        Mode.Col := Screen^.Width div 8;
-        Mode.Row := Screen^.Height div 16;
-        UnlockPubScreen('Workbench', Screen);
-        Mode.Color := False;
-      end;
-  end;
-  SysGetVideoModeData := True;
-end;
-
-
-const
-  SysVideoDriver : TVideoDriver = (
-    InitDriver : @SysInitVideo;
-    DoneDriver : @SysDoneVideo;
-    UpdateScreen : @SysUpdateScreen;
-    ClearScreen : @SysClearScreen;
-    SetVideoMode : @SysSetVideoMode;
-    GetVideoModeCount : @SysGetVideoModeCount;
-    GetVideoModeData : @SysGetVideoModeData;
-    SetCursorPos : @SysSetCursorPos;
-    GetCursorType : @SysGetCursorType;
-    SetCursorType : @SysSetCursorType;
-    GetCapabilities : @SysGetCapabilities
-  );
-
-
-initialization
-  SetVideoDriver(SysVideoDriver);
-  LastT := 50;
-  LastL := 50;
-  LastW := 80;
-  LastH := 25;
-  {$ifdef WITHBUFFERING}
-  BufRp := CreateRastPort;
-  BufRp^.Layer := nil;
-  BufRp^.Bitmap := nil;
-  {$endif}
-finalization
-  {$ifdef WITHBUFFERING}
-  if Assigned(BufRp^.Bitmap) then
-    FreeBitmap(BufRp^.Bitmap);
-  FreeRastPort(BufRp);
-  {$endif}
-end.

+ 0 - 650
packages/rtl-console/src/morphos/video.pp

@@ -1,650 +0,0 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 2006 by Karoly Balogh
-    member of the Free Pascal development team
-
-    Video unit for Amiga and MorphOS
-
-    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 Video;
-
-{.$define VIDEODEBUG}
-{.$define WITHBUFFERING}
-
-
-{
-  Date: 2013-01-09
-  What: Adjusted FPC video unit for AROS (/AmigaOS?)
-
-  goal:
-  ---------------------------------------------------------------------------
-  Attempt to add user-on-demand support for AROS Fullscreen to the FPC video 
-  unit.
-
-  DISCLAIMER:
-  Experimental code only meant as PoC.
-  
-  DON'T USE FOR PUBLICATION UNLESS ALL PERSONAL COMMENTS AND REFERENCES ARE 
-  REMOVED AND THE ACTUAL CODE IS APPROVED BY SOMEONE THAT KNOWS WHAT HE/SHE 
-  IS DOING.
-  THIS CODE IS PROOF OF CONCEPT ONLY AND AS SUCH DOES NOT PROVIDE 100% 
-  RELIABLE CODE AND/OR APPROVED PROGRAMMING TECHNIQUES.
-
-  Idea:
-  The idea of running a video-unit screen on its own graphical screen
-  emerged from ALB42's port of the dos-based fp-editor that is distributed
-  with freepascal. In it's original form the editor would be run from dos
-  and would present itself in a full-screen modus fashion.
-  
-  This behaviour changed slightly with the ending of the dos era, and 
-  instead a commando window started to appear in regular OS'.
-  
-  But even when this changed, Windows users were still able to view this
-  command window in full-screen by means of pressing ctrl-enter.
-  
-  Since this behaviour is not present on current next gen amigaOS systems,
-  we have to live without that.
-  
-  And so begun the idea of letting the video-unit somehow be influenced
-  in such a way that an Freevision application that uses the videounit
-  could be shown in fullscreen.
-  
-  In order to accomplish this task we missuse the color tag of TVideomode.
-  When the color is set to monochrome it will show the 
-  dos-screen on a full graphics screen and the dos-output will be shown
-  in a borderless backdrop window. That way it appears that the vision
-  application is running full-screen.
-  
-  The current implementation has a limitation that cannot be solved.
-  
-  Namely, the vision screens are based on a ascii character screen, so 
-  the final measurements of the full-screen-window will depend
-  on the amount of pixels that maximally can be displayed by means of 
-  those same character-sizes. 
-  Since the used font is currently 8 pixels width and 16 pixels high, 
-  it becomes clear that not every screen-resolution is suitable to 
-  exactly fit both dimensions pixelwise. As a result a small
-  stripe (of default backgroundcolor) on the bottom or right may appear. 
-   
-  HAVE FUN !
-  
-  MaGoRiuM
-}
-
-
-interface
-
-uses
-  amigados, intuition, {tagsarray,} utility, sysutils;
-
-{$i videoh.inc}
-
-
-{ Amiga specific calls, to help interaction between Keyboard, Mouse and
-  Video units, and Free Vision }
-procedure GotCloseWindow;
-function  HasCloseWindow: boolean;
-procedure GotResizeWindow;
-function  HasResizeWindow(var winw:longint; var winh: longint): boolean;
-
-
-
-var
-  VideoWindow: PWindow;
-
-implementation
-
-uses
-   exec, agraphics;
-
-{$i video.inc}
-
-{$i videodata.inc}
-
-const
-  VIDEOSCREENNAME = 'FPC Video Screen Output';
-
-var
-  OS_Screen             : PScreen   = nil;    // To hold our screen, when necessary
-  FPC_VIDEO_FULLSCREEN  : Boolean   = False;  // Global that defines when we need to attempt opening on own scren
-
-var
-  VideoColorMap         : PColorMap;
-  VideoPens             : array[0..15] of LongInt;
-
-  OldCursorX,
-  OldCursorY            : LongInt;
-  CursorType            : Word;
-  OldCursorType         : Word;
-
-  {$ifdef WITHBUFFERING}
-  BitmapWidth, BitmapHeight: Integer;
-  BufRp: PRastPort;
-  {$endif}
-
-  GotCloseWindowMsg     : Boolean;
-  GotResizeWindowMsg    : Boolean;
-  LastL, LastT: Integer;
-  LastW, LastH: Integer;
-  WindowForReqSave: PWindow;
-  Process: PProcess;
-(*
-  GetScreen: pScreen;
-
-  Tries to open a custom screen, which attempt to clone the workbench,
-  and returns the pointer to the screen. Result can be nil when failed
-  otherwise the screen got opened correctly.
-*)
-Function GetScreen: pScreen;
-begin
-  GetScreen:=OpenScreenTags(nil,[
-    SA_Title          , DWord(PChar(VIDEOSCREENNAME)),
-    SA_Left           , 0,
-    SA_Top            , 0,
-    SA_ShowTitle      , 0,    // Do not show the screen's TitleBar
-    SA_Type           , PUBLICSCREEN_F,
-    SA_PubName        , DWord(PChar(VIDEOSCREENNAME)),
-    SA_Quiet          , 1,
-    SA_LikeWorkbench  , 1     // Let OS
-  ]);
-  {$ifdef VIDEODEBUG}
-  if (GetScreen <> nil) then
-    Writeln('DEBUG: Opened a new screen')
-  else
-    Writeln('ERROR: Failed to open new screen');
-  {$endif}
-end;
-
-(*
-  GetWindow: pWindow;
-  
-  Tries to create and open a window. Returns the pointer to
-  the window or nil in case of failure.
-
-  The routine keeps the global FPC_FULL_SCREEM option into 
-  account and act accordingly.
-  
-  In windowed mode it returns a window with another kind of 
-  settings then when it has to reside on it's own customscreen.
-*)
-Function GetWindow: PWindow;
-begin
-  GetWindow:=nil;
-
-  if FPC_VIDEO_FULLSCREEN then
-  begin
-    OS_Screen := GetScreen;
-    If OS_Screen = nil then
-      Exit;
-
-    {$ifdef VIDEODEBUG}
-    WriteLn('DEBUG: Opened customscreen succesfully');
-    {$endif}
-    GetWindow:=OpenWindowTags(nil, [
-      WA_CustomScreen, PtrUInt(OS_Screen),
-      WA_Left       , 0,
-      WA_Top        , 0,
-      WA_InnerWidth , (OS_Screen^.Width div 8) * 8,
-      WA_InnerHeight, (OS_Screen^.Height div 16) * 16,
-      WA_AutoAdjust , 1,
-      WA_Activate   , 1,
-      WA_Borderless , 1,
-      WA_BackDrop   , 1,
-      WA_FLAGS      , (WFLG_GIMMEZEROZERO or WFLG_REPORTMOUSE   or WFLG_RMBTRAP or
-                       WFLG_SMART_REFRESH or WFLG_NOCAREREFRESH),
-      WA_IDCMP      , (IDCMP_RAWKEY       or
-                       IDCMP_MOUSEMOVE    or IDCMP_MOUSEBUTTONS or
-                       IDCMP_CHANGEWINDOW or IDCMP_CLOSEWINDOW)
-    ]);
-  end else
-  begin      // Windowed Mode
-    GetWindow:=OpenWindowTags(nil,[
-      WA_Left       , LastL,
-      WA_Top        , LastT,
-      WA_InnerWidth , LastW*8,
-      WA_InnerHeight, LastH*16,
-      WA_MaxWidth   , 32768,
-      WA_MaxHeight  , 32768,
-      WA_Title      , PtrUInt(PChar('FPC Video Window Output')),
-      WA_Activate   , 1,
-      WA_FLAGS      , (WFLG_GIMMEZEROZERO or WFLG_REPORTMOUSE   or
-                       WFLG_SMART_REFRESH or WFLG_NOCAREREFRESH or 
-                       WFLG_DRAGBAR       or WFLG_DEPTHGADGET   or WFLG_SIZEGADGET or
-                       WFLG_SIZEBBOTTOM   or WFLG_RMBTRAP       or WFLG_CLOSEGADGET),
-      WA_IDCMP      , (IDCMP_RAWKEY       or
-                       IDCMP_MOUSEMOVE    or IDCMP_MOUSEBUTTONS or
-                       IDCMP_CHANGEWINDOW or IDCMP_CLOSEWINDOW)//,
-    ]);
-  end;
-
-  Process := PProcess(FindTask(nil));
-  WindowForReqSave := Process^.pr_WindowPtr;
-  Process^.pr_WindowPtr := GetWindow;
-
-  {$ifdef VIDEODEBUG}
-  If GetWindow <> nil then
-    WriteLn('DEBUG: Sucessfully opened videounit Window')
-  else
-    WriteLn('ERROR: Failed to open videounit Window');
-  {$endif}
-end;
-
-
-// ==========================================================================
-// ==
-// ==  Original source code continues, with minor adjustments
-// ==
-// ==========================================================================
-
-
-procedure SysInitVideo;
-var
-  Counter: LongInt;
-begin
-  InitGraphicsLibrary;
-  InitIntuitionLibrary;
-
-  {$ifdef VIDEODEBUG}
-  WriteLn('FULLSCREEN VIDEO UNIT MODIFICATION v2');  
-  if FPC_VIDEO_FULLSCREEN then
-    WriteLn('DEBUG: Recognized fullscreen mode')
-  else
-    WriteLn('DEBUG: Recognized windowed mode');
-  {$endif}
-
-  // fill videobuf and oldvideobuf with different bytes, to allow proper first draw
-  FillDword(VideoBuf^, VideoBufSize div 4, $1234D3AD);
-  FillDword(OldVideoBuf^, VideoBufSize div 4, $4321BEEF);
-
-  VideoWindow := GetWindow;
-
-  // nice hardcode values are probably going to screw up things
-  // so wee neeed a way to detrmined how many chars could be on
-  // the screen in both directions. And a bit accurate.
-  if FPC_VIDEO_FULLSCREEN then
-  begin
-    // just to make sure that we are going to use the window width 
-    // and height instead of the one from the screen. 
-    // This is to circumvent that the window (or virtual window from
-    // vision based on characters pixels * characters in both 
-    // dimensions) is actually smaller then the window it resides on.
-    //
-    // Can happen for instance when the window does not hide it's 
-    // borders or title as intended.
-    ScreenWidth := VideoWindow^.GZZWidth div 8;
-    ScreenHeight := VideoWindow^.GZZHeight div 16;
-    ScreenColor := False;
-
-    {$ifdef VIDEODEBUG}
-    Writeln('DEBUG: Fullscreen - windowed - Width * Heigth = ',ScreenWidth,' * ',ScreenHeight);
-    {$endif}
-   end else
-   begin
-     ScreenWidth := LastW;
-     ScreenHeight := LastH;
-     ScreenColor := True;
-   end;
-   {$ifdef WITHBUFFERING}
-   BufRp^.Bitmap := AllocBitmap(VideoWindow^.GZZWidth, VideoWindow^.GZZHeight, VideoWindow^.RPort^.Bitmap^.Depth, BMF_CLEAR, VideoWindow^.RPort^.Bitmap);
-   BitmapWidth := VideoWindow^.GZZWidth;
-   BitmapHeight := VideoWindow^.GZZHeight;
-   {$endif}
-   { viewpostcolormap info }
-   videoColorMap := pScreen(videoWindow^.WScreen)^.ViewPort.ColorMap;
-   
-   for Counter := 0 to 15 do 
-   begin
-     VideoPens[Counter] := ObtainPen(VideoColorMap, LongWord(-1),
-         vgacolors[counter, 0] shl 24, vgacolors[counter, 1] shl 24, vgacolors[counter, 2] shl 24,
-         PEN_EXCLUSIVE);
-     {$ifdef VIDEODEBUG}
-     If VideoPens[Counter] = -1 then
-       WriteLn('errr color[',Counter,'] = ', VideoPens[Counter])
-     else
-       WriteLn('good color[',Counter,'] = ', VideoPens[Counter]);
-     {$endif}
-   end;
-   
-   CursorX := 0;
-   CursorY := 0;
-   OldCursorX := 0;
-   OldCursorY := 0;
-   CursorType := crHidden;
-   OldCursorType := crHidden;
-
-   GotCloseWindowMsg := false;
-   GotResizeWindowMsg := false;
-end;
-
-procedure SysDoneVideo;
-var
-  Counter: LongInt;
-begin
-  if VideoWindow <> nil then
-  begin
-    Process^.pr_WindowPtr := WindowForReqSave;
-    if not FPC_VIDEO_FULLSCREEN then
-    begin
-      LastL := VideoWindow^.LeftEdge;
-      LastT := VideoWindow^.TopEdge;
-    end;
-    CloseWindow(videoWindow);
-  end;
-  {$ifdef WITHBUFFERING}
-  FreeBitmap(BufRp^.Bitmap);
-  BufRp^.Bitmap := nil;
-  {$endif}
-  VideoWindow := nil;
-  for Counter := 0 to 15 do
-    ReleasePen(VideoColorMap, VideoPens[Counter]);
-  if ((FPC_VIDEO_FULLSCREEN) and (OS_Screen <> nil)) then
-  begin
-    CloseScreen(OS_Screen);
-  end;
-end;
-
-function SysSetVideoMode(const Mode: TVideoMode): Boolean;
-var
-  dx: integer;
-  dy: integer;
-begin
-  if ScreenColor <> Mode.Color then
-  begin
-    SysDoneVideo;
-    FPC_VIDEO_FULLSCREEN := not Mode.color;
-    if not FPC_VIDEO_FULLSCREEN then
-    begin
-      LastT := 50;
-      LastL := 50;
-      LastW := 80;
-      LastH := 25;
-    end;
-    SysInitVideo;
-  end else
-    if not FPC_VIDEO_FULLSCREEN then
-    begin
-      dx := (Mode.col * 8) - VideoWindow^.GZZWidth;
-      dy := (Mode.row * 16) - VideoWindow^.GZZHeight;
-      SizeWindow(videoWindow, dx, dy);
-    end;
-  ScreenWidth := Mode.col;
-  ScreenHeight := Mode.row;
-  LastW := Mode.Col;
-  LastH := Mode.Row;
-  ScreenColor := Mode.color;
-  SysSetVideoMode := True;
-end;
-
-var
-  OldSH, OldSW : longint;
-
-procedure SysClearScreen;
-begin
-  oldSH := -1;
-  oldSW := -1;
-  UpdateScreen(True);
-end;
-
-procedure DrawChar(rp: PRastPort; x, y: LongInt; crType: Word);
-var
-  TmpCharData: Word;
-  TmpChar: Byte;
-  TmpFGColor: Byte;
-  TmpBGColor: Byte;
-  sX, sY: LongInt;
-begin
-  TmpCharData := VideoBuf^[y * ScreenWidth + x];
-  TmpChar    := TmpCharData and $0ff;
-  TmpFGColor := (TmpCharData shr 8) and %00001111;
-  TmpBGColor := (TmpCharData shr 12) and %00000111;
-
-  sX := x * 8;
-  sY := y * 16;
-
-  if crType <> crBlock then
-  begin
-    SetABPenDrMd(rp, VideoPens[TmpFGColor], VideoPens[tmpBGColor], JAM2);
-  end else
-  begin
-    { in case of block cursor, swap fg/bg colors
-      and BltTemplate() below will take care of everything }
-    SetABPenDrMd(rp, VideoPens[tmpBGColor], VideoPens[tmpFGColor], JAM2);
-  end;
-
-  BltTemplate(@Vgafont[tmpChar, 0], 0, 1, rp, sX, sY, 8, 16);
-
-  if crType = crUnderLine then
-  begin
-    { draw two lines at the bottom of the char, in case of underline cursor }
-    agraphics.gfxMove(rp, sX, sY + 14); Draw(rp, sX + 7, sY + 14);
-    agraphics.gfxMove(rp, sX, sY + 15); Draw(rp, sX + 7, sY + 15);
-  end;
-end;
-
-procedure SysUpdateScreen(Force: Boolean);
-var
-  BufCounter: Longint;
-  SmallForce: Boolean;
-  Counter, CounterX, CounterY: LongInt;
-  //BufRp: PRastPort;
-  t: Double;
-  NumChanged: Integer;
-begin
-  SmallForce := False;
-
-  // override forced update when screen dimensions haven't changed
-  if Force then
-  begin
-    if (OldSH = ScreenHeight) and (OldSW = ScreenWidth) then
-      Force:=false
-    else
-    begin
-      OldSH := ScreenHeight;
-      OldSW := ScreenWidth;
-    end;
-  end;
-
-  if Force then
-  begin
-    SmallForce:=true;
-  end else
-  begin
-    Counter:=0;
-    while not smallforce and (Counter < (VideoBufSize div 4) - 1) do
-    begin
-      SmallForce := (PDWord(VideoBuf)[Counter] <> PDWord(OldVideoBuf)[Counter]);
-      inc(Counter);
-    end;
-  end;
-
-  {$ifdef WITHBUFFERING}
-  if (VideoWindow^.GZZWidth > BitmapWidth) or (VideoWindow^.GZZHeight > BitmapHeight) then
-  begin
-    FreeBitmap(BufRp^.Bitmap);
-    BufRp^.Bitmap := AllocBitmap(VideoWindow^.GZZWidth, VideoWindow^.GZZHeight, VideoWindow^.RPort^.Bitmap^.Depth, BMF_CLEAR, VideoWindow^.RPort^.Bitmap);
-    BitmapWidth := VideoWindow^.GZZWidth;
-    BitmapHeight := VideoWindow^.GZZHeight;
-    Force := True;
-    Smallforce := True;
-  end;
-  {$endif}
-
-  BufCounter:=0;
-  NumChanged:=0;
-  if Smallforce then
-  begin
-    //t := now();
-    for CounterY := 0 to ScreenHeight - 1 do
-    begin
-      for CounterX := 0 to ScreenWidth - 1 do
-      begin
-        if (VideoBuf^[BufCounter] <> OldVideoBuf^[BufCounter]) or Force then
-        begin
-          {$ifdef WITHBUFFERING}
-          DrawChar(BufRp, CounterX, CounterY, crHidden);
-          {$else}
-          DrawChar(VideoWindow^.RPort, CounterX, CounterY, crHidden);
-          {$endif}
-          OldVideoBuf^[BufCounter] := VideoBuf^[BufCounter];
-          Inc(NumChanged);
-        end;
-        Inc(BufCounter);
-      end;
-    end;
-    //if NumChanged > 100 then
-    //  writeln('redraw time: ', floattoStrF((Now-t)* 24 * 60 * 60 * 1000000 / NumChanged, fffixed, 8,3), ' us/char' ); // ms
-  end;
-
-  if (CursorType <> OldCursorType) or
-     (CursorX <> OldCursorX) or (CursorY <> OldCursorY) or
-     SmallForce then
-  begin
-    {$ifdef WITHBUFFERING}
-    DrawChar(BufRp, OldCursorY, OldCursorX, crHidden);
-    DrawChar(BufRp, CursorY, CursorX, CursorType);
-    {$else}
-    DrawChar(VideoWindow^.RPort, OldCursorY, OldCursorX, crHidden);
-    DrawChar(VideoWindow^.RPort, CursorY, CursorX, CursorType);
-    {$endif}
-    OldCursorX := CursorX;
-    OldCursorY := CursorY;
-    OldcursorType := CursorType;
-  end;
-  {$ifdef WITHBUFFERING}
-  BltBitMapRastPort(BufRp^.Bitmap, 0, 0, VideoWindow^.RPort, 0, 0, ScreenWidth * 8, ScreenHeight * 16, $00C0);
-  {$endif}
-end;
-
-
-procedure SysSetCursorPos(NewCursorX, NewCursorY: Word);
-begin
-  CursorX := NewCursorY;
-  CursorY := NewCursorX;
-  SysUpdateScreen(False);
-end;
-
-function SysGetCapabilities: Word;
-begin
-  SysGetCapabilities := cpColor or cpChangeCursor;
-end;
-
-function SysGetCursorType: Word;
-begin
-  SysGetCursorType := cursorType;
-end;
-
-
-procedure SysSetCursorType(NewType: Word);
-begin
-  cursorType := newType;
-  { FIXME: halfBlock cursors are not supported for now
-           by the rendering code }
-  if CursorType = crHalfBlock then
-    cursorType := crBlock;
-
-  SysUpdateScreen(False);
-end;
-
-
-// Amiga specific calls
-procedure GotCloseWindow;
-begin
-  GotCloseWindowMsg := True;
-end;
-
-function HasCloseWindow: Boolean;
-begin
-  HasCloseWindow := GotCloseWindowMsg;
-  GotCloseWindowMsg := False;
-end;
-
-procedure GotResizeWindow;
-begin
-  GotResizeWindowMsg := True;
-end;
-
-function HasResizeWindow(var WinW: LongInt; var WinH: LongInt): Boolean;
-begin
-  WinW := 0;
-  WinH := 0;
-  HasResizeWindow := GotResizeWindowMsg;
-  if Assigned(VideoWindow) then
-  begin
-    //writeln('resize');
-    WinW := VideoWindow^.GZZWidth div 8;
-    WinH := VideoWindow^.GZZHeight div 16;
-    LastW := WinW;
-    LastH := WinH;
-  end;
-  GotResizeWindowMsg := False;
-end;
-
-function SysGetVideoModeCount: Word;
-begin
-  SysGetVideoModeCount := 2;
-end;
-
-function SysGetVideoModeData(Index: Word; var Mode: TVideoMode): Boolean;
-var
-   Screen: PScreen;
-begin
-  case Index of
-    0: begin
-         Mode.Col := 80;
-         Mode.Row := 25;
-         Mode.Color := True;
-       end;
-    1: begin
-        Screen := LockPubScreen('Workbench');
-        Mode.Col := Screen^.Width div 8;
-        Mode.Row := Screen^.Height div 16;
-        UnlockPubScreen('Workbench', Screen);
-        Mode.Color := False;
-      end;
-  end;
-  SysGetVideoModeData := True;
-end;
-
-
-const
-  SysVideoDriver : TVideoDriver = (
-    InitDriver : @SysInitVideo;
-    DoneDriver : @SysDoneVideo;
-    UpdateScreen : @SysUpdateScreen;
-    ClearScreen : @SysClearScreen;
-    SetVideoMode : @SysSetVideoMode;
-    GetVideoModeCount : @SysGetVideoModeCount;
-    GetVideoModeData : @SysGetVideoModeData;
-    SetCursorPos : @SysSetCursorPos;
-    GetCursorType : @SysGetCursorType;
-    SetCursorType : @SysSetCursorType;
-    GetCapabilities : @SysGetCapabilities
-  );
-
-
-initialization
-  SetVideoDriver(SysVideoDriver);
-  LastT := 50;
-  LastL := 50;
-  LastW := 80;
-  LastH := 25;
-  {$ifdef WITHBUFFERING}
-  BufRp := CreateRastPort;
-  BufRp^.Layer := nil;
-  BufRp^.Bitmap := nil;
-  {$endif}
-finalization
-  {$ifdef WITHBUFFERING}
-  if Assigned(BufRp^.Bitmap) then
-    FreeBitmap(BufRp^.Bitmap);
-  FreeRastPort(BufRp);
-  {$endif}
-end.

+ 50 - 23
packages/rtl-objpas/src/inc/variants.pp

@@ -481,15 +481,16 @@ end;
 
 function TVariantArrayIterator.AtEnd: Boolean;
 var
-  i : sizeint;
+  i,l : sizeint;
 begin
-  result:=true;
-  for i:=0 to Pred(Dims) do
-    if Coords^[i] < Bounds^[i].LowBound + Bounds^[i].ElementCount then
-      begin
-        result:=false;
-        exit;
-      end;
+  result:=false;
+  l:=Pred(dims);
+  I:=0;
+  While (not Result) and (I<=L) do
+    begin
+    Result:=Coords^[i] >= (Bounds^[i].LowBound + Bounds^[i].ElementCount);
+    inc(i);
+    end;
 end;
 
 {$pop}// {$r-} for TVariantArrayIterator
@@ -4004,6 +4005,8 @@ var
   arg_ptr: pointer;
   arg_data: PVarData;
   dummy_data: TVarData;
+  arg_advanced: boolean;
+
 const
   argtype_mask = $7F;
   argref_mask = $80;
@@ -4032,22 +4035,46 @@ begin
         Inc(arg_ptr,sizeof(Pointer));
       end
       else
-        case arg_type of
-          varError:
-            arg_data^.vError:=VAR_PARAMNOTFOUND;
-          varVariant:
-            begin
+        begin
+          arg_advanced:=false;
+          case arg_type of
+            varError:
+              begin
+                arg_data^.vError:=VAR_PARAMNOTFOUND;
+                arg_advanced := true;
+              end;
+            varVariant:
               arg_data^ := PVarData(PPointer(arg_ptr)^)^;
-              Inc(arg_ptr,sizeof(Pointer));
-            end;
-          varDouble, varCurrency, varInt64, varQWord:
-            begin
-              arg_data^.vQWord := PQWord(arg_ptr)^; // 64bit on all platforms
-              inc(arg_ptr,sizeof(qword))
-            end
-        else
-          arg_data^.vAny := PPointer(arg_ptr)^; // 32 or 64bit
-          inc(arg_ptr,sizeof(pointer))
+            varDouble, varCurrency, varDate, varInt64, varQWord:
+              begin
+                arg_data^.vQWord := PQWord(arg_ptr)^; // 64bit on all platforms
+                inc(arg_ptr,sizeof(QWord));
+                arg_advanced := true;
+              end;
+            { values potentially smaller than sizeof(pointer) must be handled
+              explicitly to guarantee endian safety and to prevent copying/
+              skipping data (they are always copied into a 4 byte element
+              by the compiler, although it will still skip sizeof(pointer)
+              bytes afterwards) }
+            varSingle:
+              arg_data^.vSingle := PSingle(arg_ptr)^;
+            varSmallint:
+              arg_data^.vSmallInt := PLongint(arg_ptr)^;
+            varInteger:
+              arg_data^.vInteger := PLongint(arg_ptr)^;
+            varBoolean:
+              arg_data^.vBoolean := WordBool(PLongint(arg_ptr)^);
+            varShortInt:
+              arg_data^.vShortInt := PLongint(arg_ptr)^;
+            varByte:
+              arg_data^.vByte := PLongint(arg_ptr)^;
+            varWord:
+              arg_data^.vWord := PLongint(arg_ptr)^;
+            else
+              arg_data^.vAny := PPointer(arg_ptr)^; // 32 or 64bit
+          end;
+          if not arg_advanced then
+            inc(arg_ptr,sizeof(pointer));
         end;
     end;
   end;

+ 1 - 1
packages/zlib/fpmake.pp

@@ -13,7 +13,7 @@ begin
 {$endif ALLPACKAGES}
 
     P:=AddPackage('zlib');
-    P.Description := 'Interface units for the ZLIB library - support for deflate compression method using for GZIP, PNG, ZIP, etc.';
+    P.Description := 'Interface units for the ZLIB library - support for deflate compression method used for GZIP, PNG, ZIP, etc.';
 {$ifdef ALLPACKAGES}
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}

+ 161 - 130
rtl/amicommon/dos.pp

@@ -49,6 +49,12 @@ type
 
 {$I dosh.inc}
 
+function DeviceByIdx(Idx: Integer): string;
+function AddDisk(Const Path: string): Integer;
+function RefreshDeviceList: Integer;
+function DiskSize(Drive: AnsiString): Int64;
+function DiskFree(Drive: AnsiString): Int64;
+
 implementation
 
 {$DEFINE HAS_GETMSCOUNT}
@@ -104,7 +110,7 @@ end;
 
 function BADDR(bval: LongInt): Pointer; Inline;
 begin
-  {$if defined(AROS) or (not defined(AROS_FLAVOUR_BINCOMPAT))}
+  {$if defined(AROS) and (not defined(AROS_FLAVOUR_BINCOMPAT))}
   BADDR := Pointer(bval);
   {$else}
   BADDR:=Pointer(bval Shl 2);
@@ -113,7 +119,7 @@ end;
 
 function BSTR2STRING(s : Pointer): PChar; Inline;
 begin
-  {$if defined(AROS) or (not defined(AROS_FLAVOUR_BINCOMPAT))}
+  {$if defined(AROS) and (not defined(AROS_FLAVOUR_BINCOMPAT))}
   BSTR2STRING:=PChar(s);
   {$else}
   BSTR2STRING:=PChar(BADDR(PtrInt(s)))+1;
@@ -122,7 +128,7 @@ end;
 
 function BSTR2STRING(s : LongInt): PChar; Inline;
 begin
-  {$if defined(AROS) or (not defined(AROS_FLAVOUR_BINCOMPAT))}
+  {$if defined(AROS) and (not defined(AROS_FLAVOUR_BINCOMPAT))}
   BSTR2STRING:=PChar(s);
   {$else}
   BSTR2STRING:=PChar(BADDR(s))+1;
@@ -507,91 +513,169 @@ end;
                                --- Disk ---
 ******************************************************************************}
 
-{ How to solve the problem with this:       }
-{  We could walk through the device list    }
-{  at startup to determine possible devices }
-
+{
+  The Diskfree and Disksize functions need a file on the specified drive, since this
+  is required for the statfs system call.
+  These filenames are set in drivestr[0..26], and have been preset to :
+   0 - ':'      (default drive - hence current dir is ok.)
+   1 - 'DF0:'   (floppy drive 1 - should be adapted to local system )
+   2 - 'DF1:'   (floppy drive 2 - should be adapted to local system )
+   3 - 'SYS:'   (C: equivalent of dos is the SYS: partition)
+   4..26          (can be set by you're own applications)
+  ! Use AddDisk() to Add new drives !
+  They both return -1 when a failure occurs.
+}
+var
+  DeviceList: array[0..26] of string[20];
+  NumDevices: Integer = 0;
+  
 const
-
-  not_to_use_devs : array[0..12] of string =(
-                   'DF0:',
-                   'DF1:',
-                   'DF2:',
-                   'DF3:',
-                   'PED:',
+  IllegalDevices: array[0..12] of string =(
+                   'PED:',  
                    'PRJ:',
-                   'PIPE:',
-                   'RAM:',
-                   'CON:',
-                   'RAW:',
-                   'SER:',
-                   'PAR:',
-                   'PRT:');
+                   'PIPE:',   // Pipes
+                   'XPIPE:',  // Extented Pipe
+                   'CON:',    // Console
+                   'RAW:',    // RAW: Console
+                   'KCON:',   // KingCON Console
+                   'KRAW:',   // KingCON RAW
+                   'SER:',    // serial Ports
+                   'SER0:',
+                   'SER1:',
+                   'PAR:',    // Parallel Porty
+                   'PRT:');   // Printer
+
+function IsIllegalDevice(DeviceName: string): Boolean;
+var
+  i: Integer;
+  Str: AnsiString;
+begin
+  IsIllegalDevice := False;
+  Str := UpCase(DeviceName);
+  for i := Low(IllegalDevices) to High(IllegalDevices) do
+  begin
+    if Str = IllegalDevices[i] then
+    begin
+      IsIllegalDevice := True;
+      Exit;
+    end;
+  end;
+end;
 
+function DeviceByIdx(Idx: Integer): string;
+begin
+  DeviceByIdx := '';
+  if (Idx < 0) or (Idx >= NumDevices) then
+    Exit;
+  DeviceByIdx := DeviceList[Idx];
+end;
+
+function AddDisk(const Path: string): Integer;
+begin
+  // if hit border, restart at 4
+  if NumDevices > 26 then
+    NumDevices := 4;
+  // set the device
+  DeviceList[NumDevices] := Copy(Path, 1, 20);
+  // return the Index increment for next run
+  AddDisk := NumDevices;
+  Inc(NumDevices);
+end;
+
+function RefreshDeviceList: Integer;
 var
-   deviceids : array[1..20] of byte;
-   devicenames : array[1..20] of string[20];
-   numberofdevices : Byte;
+  List: PDosList;
+  Temp: PChar;
+  Str: string;
+begin
+  NumDevices := 0;
+  AddDisk(':');          // Index 0
+  AddDisk('DF0:');       // Index 1
+  AddDisk('DF1:');       // Index 2
+  AddDisk('SYS:');       // Index 3
+  // Lock the List
+  List := LockDosList(LDF_DEVICES or LDF_READ);
+  // Inspect the List
+  repeat
+    List := NextDosEntry(List, LDF_DEVICES);
+    if List <> nil then
+    begin
+      Temp := BSTR2STRING(List^.dol_Name);
+      Str := strpas(Temp) + ':';
+      if not IsIllegalDevice(str) then
+        AddDisk(Str);
+    end;
+  until List = nil;
+  RefreshDeviceList := NumDevices;
+end;
 
-Function DiskFree(Drive: Byte): int64;
-Var
-  MyLock      : LongInt;
-  Inf         : pInfoData;
-  Free        : Int64;
-  myproc      : pProcess;
-  OldWinPtr   : Pointer;
-Begin
-  Free := -1;
-  { Here we stop systemrequesters to appear }
-  myproc := pProcess(FindTask(nil));
-  OldWinPtr := myproc^.pr_WindowPtr;
-  myproc^.pr_WindowPtr := Pointer(-1);
-  { End of systemrequesterstop }
-  New(Inf);
-  MyLock := dosLock(devicenames[deviceids[Drive]],SHARED_LOCK);
-  If MyLock <> 0 then begin
-     if Info(MyLock,Inf) <> 0 then begin
-        Free := (Int64(Inf^.id_NumBlocks) * Inf^.id_BytesPerBlock) -
-                (Int64(Inf^.id_NumBlocksUsed) * Inf^.id_BytesPerBlock);
-     end;
-     Unlock(MyLock);
+// New easier DiskSize()
+//
+function DiskSize(Drive: AnsiString): Int64;
+var
+  DirLock: LongInt;
+  Inf: TInfoData;
+  MyProc: PProcess;
+  OldWinPtr: Pointer;
+begin
+  DiskSize := -1;
+  //
+  MyProc := PProcess(FindTask(Nil));
+  OldWinPtr := MyProc^.pr_WindowPtr;
+  MyProc^.pr_WindowPtr := Pointer(-1);
+  //
+  DirLock := Lock(PChar(Drive), SHARED_LOCK);
+  if DirLock <> 0 then
+  begin
+    if Info(DirLock, @Inf) <> 0 then
+      DiskSize := Int64(Inf.id_NumBlocks) * Inf.id_BytesPerBlock;
+    UnLock(DirLock);
   end;
-  Dispose(Inf);
-  { Restore systemrequesters }
-  myproc^.pr_WindowPtr := OldWinPtr;
-  diskfree := Free;
+  if OldWinPtr <> Pointer(-1) then
+    MyProc^.pr_WindowPtr := OldWinPtr;
 end;
 
+function DiskSize(Drive: Byte): Int64;
+begin
+  DiskSize := -1;
+  if (Drive < 0) or (Drive >= NumDevices) then
+    Exit;
+  DiskSize := DiskSize(DeviceList[Drive]);
+end;
 
-
-Function DiskSize(Drive: Byte): int64;
-Var
-  MyLock      : LongInt;
-  Inf         : pInfoData;
-  Size        : Int64;
-  myproc      : pProcess;
-  OldWinPtr   : Pointer;
-Begin
-  Size := -1;
-  { Here we stop systemrequesters to appear }
-  myproc := pProcess(FindTask(nil));
-  OldWinPtr := myproc^.pr_WindowPtr;
-  myproc^.pr_WindowPtr := Pointer(-1);
-  { End of systemrequesterstop }
-  New(Inf);
-  MyLock := dosLock(devicenames[deviceids[Drive]],SHARED_LOCK);
-  If MyLock <> 0 then begin
-     if Info(MyLock,Inf) <> 0 then begin
-        Size := (Int64(Inf^.id_NumBlocks) * Inf^.id_BytesPerBlock);
-     end;
-     Unlock(MyLock);
+// New easier DiskFree()
+//
+function DiskFree(Drive: AnsiString): Int64;
+var
+  DirLock: LongInt;
+  Inf: TInfoData;
+  MyProc: PProcess;
+  OldWinPtr: Pointer;
+begin
+  DiskFree := -1;
+  //
+  MyProc := PProcess(FindTask(Nil));
+  OldWinPtr := MyProc^.pr_WindowPtr;
+  MyProc^.pr_WindowPtr := Pointer(-1);
+  //
+  DirLock := Lock(PChar(Drive), SHARED_LOCK);
+  if DirLock <> 0 then
+  begin
+    if Info(DirLock, @Inf) <> 0 then
+      DiskFree := Int64(Inf.id_NumBlocks - Inf.id_NumBlocksUsed) * Inf.id_BytesPerBlock;
+    UnLock(DirLock);
   end;
-  Dispose(Inf);
-  { Restore systemrequesters }
-  myproc^.pr_WindowPtr := OldWinPtr;
-  disksize := Size;
+  if OldWinPtr <> Pointer(-1) then
+    MyProc^.pr_WindowPtr := OldWinPtr;
 end;
 
+function DiskFree(Drive: Byte): Int64;
+begin
+  DiskFree := -1;
+  if (Drive < 0) or (Drive >= NumDevices) then
+    Exit;
+  DiskFree := DiskSize(DeviceList[Drive]);
+end;
 
 procedure FindFirst(const Path: PathStr; Attr: Word; Var f: SearchRec);
 var
@@ -1082,61 +1166,8 @@ begin
   end;  
 end;
 
-
-procedure AddDevice(str : String);
-begin
-    inc(numberofdevices);
-    deviceids[numberofdevices] := numberofdevices;
-    devicenames[numberofdevices] := str;
-end;
-
-function MakeDeviceName(str : pchar): string;
-var
-   temp : string[20];
-begin
-   temp := strpas(str);
-   temp := temp + ':';
-   MakeDeviceName := temp;
-end;
-
-function IsInDeviceList(str : string): boolean;
-var
-   i : byte;
-   theresult : boolean;
-begin
-   theresult := false;
-   for i := low(not_to_use_devs) to high(not_to_use_devs) do
-   begin
-       if str = not_to_use_devs[i] then begin
-          theresult := true;
-          break;
-       end;
-   end;
-   IsInDeviceList := theresult;
-end;
-
-procedure ReadInDevices;
-var
-   dl : pDosList;
-   temp : pchar;
-   str  : string[20];
-begin
-   dl := LockDosList(LDF_DEVICES or LDF_READ );
-   repeat
-      dl := NextDosEntry(dl,LDF_DEVICES );
-      if dl <> nil then begin
-         temp := BSTR2STRING(dl^.dol_Name);
-         str := MakeDeviceName(temp);
-         if not IsInDeviceList(str) then
-              AddDevice(str);
-      end;
-   until dl = nil;
-   UnLockDosList(LDF_DEVICES or LDF_READ );
-end;
-
 begin
   DosError:=0;
-  numberofdevices := 0;
   StrOfPaths := '';
-  ReadInDevices;
+  RefreshDeviceList;
 end.

+ 182 - 32
rtl/amicommon/sysutils.pp

@@ -42,12 +42,17 @@ interface
 
 { Platform dependent calls }
 
-Procedure AddDisk(const path:string);
+function DeviceByIdx(Idx: Integer): string;
+function AddDisk(Const Path: string): Integer;
+function RefreshDeviceList: Integer;
+function DiskSize(Drive: AnsiString): Int64;
+function DiskFree(Drive: AnsiString): Int64;
 
 
 implementation
 
-uses dos,sysconst;
+uses
+  dos, sysconst;
 
 {$DEFINE FPC_FEXPAND_VOLUMES} (* Full paths begin with drive specification *)
 {$DEFINE FPC_FEXPAND_DRIVESEP_IS_ROOT}
@@ -76,6 +81,33 @@ var
   ASYS_FileList: Pointer; external name 'ASYS_FILELIST';
 
 
+function BADDR(bval: LongInt): Pointer; Inline;
+begin
+  {$if defined(AROS) and (not defined(AROS_FLAVOUR_BINCOMPAT))}
+  BADDR := Pointer(bval);
+  {$else}
+  BADDR:=Pointer(bval Shl 2);
+  {$endif}
+end;
+
+function BSTR2STRING(s : Pointer): PChar; Inline;
+begin
+  {$if defined(AROS) and (not defined(AROS_FLAVOUR_BINCOMPAT))}
+  BSTR2STRING:=PChar(s);
+  {$else}
+  BSTR2STRING:=PChar(BADDR(PtrInt(s)))+1;
+  {$endif}
+end;
+
+function BSTR2STRING(s : LongInt): PChar; Inline;
+begin
+  {$if defined(AROS) and (not defined(AROS_FLAVOUR_BINCOMPAT))}
+  BSTR2STRING:=PChar(s);
+  {$else}
+  BSTR2STRING:=PChar(BADDR(s))+1;
+  {$endif}
+end;
+
 function AmigaFileDateToDateTime(aDate: TDateStamp; out success: boolean): TDateTime;
 var
   tmpSecs: DWord;
@@ -494,48 +526,165 @@ end;
   The Diskfree and Disksize functions need a file on the specified drive, since this
   is required for the statfs system call.
   These filenames are set in drivestr[0..26], and have been preset to :
-   0 - '.'      (default drive - hence current dir is ok.)
-   1 - '/fd0/.'  (floppy drive 1 - should be adapted to local system )
-   2 - '/fd1/.'  (floppy drive 2 - should be adapted to local system )
-   3 - '/'       (C: equivalent of dos is the root partition)
+   0 - ':'      (default drive - hence current dir is ok.)
+   1 - 'DF0:'   (floppy drive 1 - should be adapted to local system )
+   2 - 'DF1:'   (floppy drive 2 - should be adapted to local system )
+   3 - 'SYS:'   (C: equivalent of dos is the SYS: partition)
    4..26          (can be set by you're own applications)
   ! Use AddDisk() to Add new drives !
   They both return -1 when a failure occurs.
 }
-Const
-  FixDriveStr : array[0..3] of pchar=(
-    '.',
-    '/fd0/.',
-    '/fd1/.',
-    '/.'
-    );
 var
-  Drives   : byte;
-  DriveStr : array[4..26] of pchar;
+  DeviceList: array[0..26] of string[20];
+  NumDevices: Integer = 0;
+  
+const
+  IllegalDevices: array[0..12] of string =(
+                   'PED:',  
+                   'PRJ:',
+                   'PIPE:',   // Pipes
+                   'XPIPE:',  // Extented Pipe
+                   'CON:',    // Console
+                   'RAW:',    // RAW: Console
+                   'KCON:',   // KingCON Console
+                   'KRAW:',   // KingCON RAW
+                   'SER:',    // serial Ports
+                   'SER0:',
+                   'SER1:',
+                   'PAR:',    // Parallel Porty
+                   'PRT:');   // Printer
+
+function IsIllegalDevice(DeviceName: string): Boolean;
+var
+  i: Integer;
+  Str: AnsiString;
+begin
+  IsIllegalDevice := False;
+  Str := UpperCase(DeviceName);
+  for i := Low(IllegalDevices) to High(IllegalDevices) do
+  begin
+    if Str = IllegalDevices[i] then
+    begin
+      IsIllegalDevice := True;
+      Exit;
+    end;
+  end;
+end;
+
+function DeviceByIdx(Idx: Integer): string;
+begin
+  DeviceByIdx := '';
+  if (Idx < 0) or (Idx >= NumDevices) then
+    Exit;
+  DeviceByIdx := DeviceList[Idx];
+end;
 
-Procedure AddDisk(const path:string);
+function AddDisk(const Path: string): Integer;
 begin
-  if not (DriveStr[Drives]=nil) then
-   FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1);
-  GetMem(DriveStr[Drives],length(Path)+1);
-  StrPCopy(DriveStr[Drives],path);
-  inc(Drives);
-  if Drives>26 then
-   Drives:=4;
+  // if hit border, restart at 4
+  if NumDevices > 26 then
+    NumDevices := 4;
+  // set the device
+  DeviceList[NumDevices] := Copy(Path, 1, 20);
+  // return the Index increment for next run
+  AddDisk := NumDevices;
+  Inc(NumDevices);
 end;
 
+function RefreshDeviceList: Integer;
+var
+  List: PDosList;
+  Temp: PChar;
+  Str: string;
+begin
+  NumDevices := 0;
+  AddDisk(':');          // Index 0
+  AddDisk('DF0:');       // Index 1
+  AddDisk('DF1:');       // Index 2
+  AddDisk('SYS:');       // Index 3
+  // Lock the List
+  List := LockDosList(LDF_DEVICES or LDF_READ);
+  // Inspect the List
+  repeat
+    List := NextDosEntry(List, LDF_DEVICES);
+    if List <> nil then
+    begin
+      Temp := BSTR2STRING(List^.dol_Name);
+      Str := strpas(Temp) + ':';
+      if not IsIllegalDevice(str) then
+        AddDisk(Str);
+    end;
+  until List = nil;
+  RefreshDeviceList := NumDevices;
+end;
 
+// New easier DiskSize()
+//
+function DiskSize(Drive: AnsiString): Int64;
+var
+  DirLock: LongInt;
+  Inf: TInfoData;
+  MyProc: PProcess;
+  OldWinPtr: Pointer;
+begin
+  DiskSize := -1;
+  //
+  MyProc := PProcess(FindTask(Nil));
+  OldWinPtr := MyProc^.pr_WindowPtr;
+  MyProc^.pr_WindowPtr := Pointer(-1);
+  //
+  DirLock := Lock(PChar(Drive), SHARED_LOCK);
+  if DirLock <> 0 then
+  begin
+    if Info(DirLock, @Inf) <> 0 then
+      DiskSize := Int64(Inf.id_NumBlocks) * Inf.id_BytesPerBlock;
+    UnLock(DirLock);
+  end;
+  if OldWinPtr <> Pointer(-1) then
+    MyProc^.pr_WindowPtr := OldWinPtr;
+end;
 
-Function DiskFree(Drive: Byte): int64;
-Begin
-  DiskFree := dos.diskFree(Drive);
-End;
+function DiskSize(Drive: Byte): Int64;
+begin
+  DiskSize := -1;
+  if (Drive < 0) or (Drive >= NumDevices) then
+    Exit;
+  DiskSize := DiskSize(DeviceList[Drive]);
+end;
 
+// New easier DiskFree()
+//
+function DiskFree(Drive: AnsiString): Int64;
+var
+  DirLock: LongInt;
+  Inf: TInfoData;
+  MyProc: PProcess;
+  OldWinPtr: Pointer;
+begin
+  DiskFree := -1;
+  //
+  MyProc := PProcess(FindTask(Nil));
+  OldWinPtr := MyProc^.pr_WindowPtr;
+  MyProc^.pr_WindowPtr := Pointer(-1);
+  //
+  DirLock := Lock(PChar(Drive), SHARED_LOCK);
+  if DirLock <> 0 then
+  begin
+    if Info(DirLock, @Inf) <> 0 then
+      DiskFree := Int64(Inf.id_NumBlocks - Inf.id_NumBlocksUsed) * Inf.id_BytesPerBlock;
+    UnLock(DirLock);
+  end;
+  if OldWinPtr <> Pointer(-1) then
+    MyProc^.pr_WindowPtr := OldWinPtr;
+end;
 
-Function DiskSize(Drive: Byte): int64;
-Begin
-  DiskSize := dos.DiskSize(Drive);
-End;
+function DiskFree(Drive: Byte): Int64;
+begin
+  DiskFree := -1;
+  if (Drive < 0) or (Drive >= NumDevices) then
+    Exit;
+  DiskFree := DiskSize(DeviceList[Drive]);
+end;
 
 function DirectoryExists(const Directory: RawByteString): Boolean;
 var
@@ -763,7 +912,8 @@ Initialization
   OnBeep:=Nil;          { No SysBeep() on Amiga, for now. Figure out if we want 
                           to use intuition.library/DisplayBeep() for this (KB) }
   StrOfPaths:='';
-
+  
+  RefreshDeviceList;
 Finalization
   DoneExceptions;
 end.

+ 64 - 5
rtl/android/Makefile

@@ -1,9 +1,9 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-04-01 rev 27428]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
-BSDs = freebsd netbsd openbsd darwin
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+BSDs = freebsd netbsd openbsd darwin dragonfly
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
 OSNeedsComspecToRunBatch = go32v2 watcom
@@ -416,6 +416,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) $(CPU_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem linuxvcs sysutils typinfo math charset cpall character getopts errors dl dynlibs types  sysconst cthreads classes fgl  rtlconsts dos cwstring fpcylix unixcp fpwidestring
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) $(CPU_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem linuxvcs sysutils typinfo math charset cpall character getopts errors dl dynlibs types  sysconst cthreads classes fgl  rtlconsts dos cwstring fpcylix unixcp fpwidestring
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) $(CPU_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem linuxvcs sysutils typinfo math charset cpall character getopts errors dl dynlibs types  sysconst cthreads classes fgl  rtlconsts dos cwstring fpcylix unixcp fpwidestring
 endif
@@ -503,6 +506,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) $(CPU_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem linuxvcs sysutils typinfo math charset cpall character getopts errors dl dynlibs types  sysconst cthreads classes fgl  rtlconsts dos cwstring fpcylix unixcp fpwidestring
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) $(CPU_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem linuxvcs sysutils typinfo math charset cpall character getopts errors dl dynlibs types  sysconst cthreads classes fgl  rtlconsts dos cwstring fpcylix unixcp fpwidestring
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) $(CPU_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem linuxvcs sysutils typinfo math charset cpall character getopts errors dl dynlibs types  sysconst cthreads classes fgl  rtlconsts dos cwstring fpcylix unixcp fpwidestring
 endif
@@ -641,6 +647,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
 endif
@@ -728,6 +737,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
 endif
@@ -866,6 +878,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_LOADERS+=$(LOADERS)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_LOADERS+=$(LOADERS)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
@@ -953,6 +968,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_LOADERS+=$(LOADERS)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_LOADERS+=$(LOADERS)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
@@ -1091,6 +1109,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_RSTS+=math  typinfo  sysconst rtlconsts
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_RSTS+=math  typinfo  sysconst rtlconsts
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_RSTS+=math  typinfo  sysconst rtlconsts
 endif
@@ -1178,6 +1199,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_RSTS+=math  typinfo  sysconst rtlconsts
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_RSTS+=math  typinfo  sysconst rtlconsts
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_RSTS+=math  typinfo  sysconst rtlconsts
 endif
@@ -1316,6 +1340,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override CLEAN_UNITS+=syslinux linux
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override CLEAN_UNITS+=syslinux linux
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override CLEAN_UNITS+=syslinux linux
 endif
@@ -1403,6 +1430,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override CLEAN_UNITS+=syslinux linux
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override CLEAN_UNITS+=syslinux linux
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override CLEAN_UNITS+=syslinux linux
 endif
@@ -1542,6 +1572,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(LINUXINC) $(OSPROCINC)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(LINUXINC) $(OSPROCINC)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(LINUXINC) $(OSPROCINC)
 endif
@@ -1629,6 +1662,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(LINUXINC) $(OSPROCINC)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(LINUXINC) $(OSPROCINC)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(LINUXINC) $(OSPROCINC)
 endif
@@ -1767,6 +1803,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) $(LINUXINC)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) $(LINUXINC)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) $(LINUXINC)
 endif
@@ -1854,6 +1893,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) $(LINUXINC)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) $(LINUXINC)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) $(LINUXINC)
 endif
@@ -1992,6 +2034,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_TARGETDIR+=.
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_TARGETDIR+=.
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_TARGETDIR+=.
 endif
@@ -2079,6 +2124,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_TARGETDIR+=.
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_TARGETDIR+=.
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_TARGETDIR+=.
 endif
@@ -2391,6 +2439,12 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=lnx
 endif
+ifeq ($(OS_TARGET),dragonfly)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=df
+endif
 ifeq ($(OS_TARGET),freebsd)
 BATCHEXT=.sh
 EXEEXT=
@@ -2436,6 +2490,11 @@ EXEEXT=
 SHAREDLIBEXT=.library
 SHORTSUFFIX=amg
 endif
+ifeq ($(OS_TARGET),aros)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=aros
+endif
 ifeq ($(OS_TARGET),morphos)
 EXEEXT=
 SHAREDLIBEXT=.library
@@ -2900,7 +2959,7 @@ endif
 ifdef CREATESHARED
 override FPCOPT+=-Cg
 endif
-ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),)
+ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
 ifeq ($(CPU_TARGET),x86_64)
 override FPCOPT+=-Cg
 endif
@@ -3355,7 +3414,7 @@ dllprt0$(OEXT) : $(ARCH)/dllprt0.as
 $(SYSTEMUNIT)$(PPUEXT) : $(LINUXINC)/$(SYSTEMUNIT).pp $(SYSDEPS)
 	$(COMPILER) -Us -Sg $(LINUXINC)/$(SYSTEMUNIT).pp
 uuchar$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) $(INC)/uuchar.pp
-		$(COMPILER) $(INC)/uuchar.pp
+	$(COMPILER) $(INC)/uuchar.pp
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\

+ 3 - 2
rtl/android/Makefile.fpc

@@ -121,7 +121,7 @@ $(SYSTEMUNIT)$(PPUEXT) : $(LINUXINC)/$(SYSTEMUNIT).pp $(SYSDEPS)
         $(COMPILER) -Us -Sg $(LINUXINC)/$(SYSTEMUNIT).pp
 
 uuchar$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) $(INC)/uuchar.pp
-		$(COMPILER) $(INC)/uuchar.pp
+	$(COMPILER) $(INC)/uuchar.pp
 
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
@@ -129,6 +129,7 @@ objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
                    $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
                    $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/strings.pp
 
 #
 # $(SYSTEMUNIT) Dependent Units
@@ -163,7 +164,7 @@ dynlibs$(PPUEXT) : $(INC)/dynlibs.pas $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$
 
 initc$(PPUEXT) : $(UNIXINC)/initc.pp ctypes$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) $(UNIXINC)/initc.pp
-        
+
 unixcp$(PPUEXT) : $(UNIXINC)/unixcp.pp $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) baseunix$(PPUEXT)
         $(COMPILER) $(UNIXINC)/unixcp.pp
 

+ 43 - 6
rtl/android/jvm/Makefile

@@ -1,9 +1,9 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-04-01 rev 27428]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
-BSDs = freebsd netbsd openbsd darwin
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+BSDs = freebsd netbsd openbsd darwin dragonfly
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
 OSNeedsComspecToRunBatch = go32v2 watcom
@@ -409,6 +409,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas androidr14
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas androidr14
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas androidr14
 endif
@@ -496,6 +499,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas androidr14
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas androidr14
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas androidr14
 endif
@@ -635,6 +641,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
@@ -722,6 +731,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
@@ -860,6 +872,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON) $(ARCH)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON) $(ARCH)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON) $(ARCH)
 endif
@@ -947,6 +962,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON) $(ARCH)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON) $(ARCH)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON) $(ARCH)
 endif
@@ -1258,6 +1276,12 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=lnx
 endif
+ifeq ($(OS_TARGET),dragonfly)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=df
+endif
 ifeq ($(OS_TARGET),freebsd)
 BATCHEXT=.sh
 EXEEXT=
@@ -1303,6 +1327,11 @@ EXEEXT=
 SHAREDLIBEXT=.library
 SHORTSUFFIX=amg
 endif
+ifeq ($(OS_TARGET),aros)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=aros
+endif
 ifeq ($(OS_TARGET),morphos)
 EXEEXT=
 SHAREDLIBEXT=.library
@@ -1767,7 +1796,7 @@ endif
 ifdef CREATESHARED
 override FPCOPT+=-Cg
 endif
-ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),)
+ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
 ifeq ($(CPU_TARGET),x86_64)
 override FPCOPT+=-Cg
 endif
@@ -2194,15 +2223,20 @@ SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
 $(SYSTEMUNIT)$(PPUEXT) : $(RTL)/java/$(SYSTEMUNIT).pp $(SYSDEPS)
 	$(COMPILER) -Us -Sg $(RTL)/java/$(SYSTEMUNIT).pp $(REDIR)
 uuchar$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) $(INC)/uuchar.pp
+	$(COMPILER) $(INC)/uuchar.pp
 objpas$(PPUEXT): $(RTL)/java/objpas.pp
 	$(COMPILER) $(RTL)/java/objpas.pp $(REDIR)
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
-		   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
-		   $(SYSTEMUNIT)$(PPUEXT)
+	$(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
+	$(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/strings.pp
 androidr14$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) androidr14.pas androidr14.inc
+	$(COMPILER) androidr14.pas
 dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
 	       $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) dos.pp
 objects$(PPUEXT) : $(INC)/objects.pp dos$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/objects.pp
 sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
 		    objpas$(PPUEXT) dos$(PPUEXT) sysconst$(PPUEXT)
 	$(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp
@@ -2229,7 +2263,10 @@ dateutil$(PPUEXT) : $(OBJPASDIR)/dateutil.pp
 macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
 	$(COMPILER) $(INC)/macpas.pp $(REDIR)
 ucomplex$(PPUEXT): $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/ucomplex.pp
 getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/getopts.pp
 heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
 charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/charset.pp

+ 10 - 2
rtl/android/jvm/Makefile.fpc

@@ -81,15 +81,18 @@ $(SYSTEMUNIT)$(PPUEXT) : $(RTL)/java/$(SYSTEMUNIT).pp $(SYSDEPS)
         $(COMPILER) -Us -Sg $(RTL)/java/$(SYSTEMUNIT).pp $(REDIR)
 
 uuchar$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) $(INC)/uuchar.pp
+	$(COMPILER) $(INC)/uuchar.pp
 
 objpas$(PPUEXT): $(RTL)/java/objpas.pp
         $(COMPILER) $(RTL)/java/objpas.pp $(REDIR)
 
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
-                   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
-                   $(SYSTEMUNIT)$(PPUEXT)
+	$(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
+        $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/strings.pp
 
 androidr14$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) androidr14.pas androidr14.inc
+	$(COMPILER) androidr14.pas
 
 #
 # System Dependent Units
@@ -105,10 +108,12 @@ androidr14$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) androidr14.pas andro
 
 dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
                $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) dos.pp
 
 #crt$(PPUEXT) : crt.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT)
 
 objects$(PPUEXT) : $(INC)/objects.pp dos$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/objects.pp
 
 #printer$(PPUEXT) : printer.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT)
 
@@ -163,8 +168,10 @@ macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
 #
 
 ucomplex$(PPUEXT): $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/ucomplex.pp
 
 getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(INC)/getopts.pp
 
 heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) -Sg $(INC)/heaptrc.pp $(REDIR)
@@ -172,3 +179,4 @@ heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
 #lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
 
 charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
+        $(COMPILER) $(INC)/charset.pp

+ 24 - 4
rtl/darwin/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-04-01 rev 27428]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-08-17 rev 28432]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
@@ -427,6 +427,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes objpas macpas iso7185 strings sysctl baseunix unixutil unix initc cmem dynlibs $(CPU_UNITS) dos dl sysutils typinfo fgl classes math types charset cpall character getopts heaptrc lineinfo lnfodwrf lnfogdb errors termio sysconst cthreads rtlconsts cwstring bsd fpwidestring fpintres fpextres objc objcbase unixcp
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes objpas macpas iso7185 strings sysctl baseunix unixutil unix initc cmem dynlibs $(CPU_UNITS) dos dl sysutils typinfo fgl classes math types charset cpall character getopts heaptrc lineinfo lnfodwrf lnfogdb errors termio sysconst cthreads rtlconsts cwstring bsd fpwidestring fpintres fpextres objc objcbase unixcp
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes objpas macpas iso7185 strings sysctl baseunix unixutil unix initc cmem dynlibs $(CPU_UNITS) dos dl sysutils typinfo fgl classes math types charset cpall character getopts heaptrc lineinfo lnfodwrf lnfogdb errors termio sysconst cthreads rtlconsts cwstring bsd fpwidestring fpintres fpextres objc objcbase unixcp
 endif
@@ -652,6 +655,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable
 endif
@@ -877,6 +883,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_RSTS+=math typinfo classes sysconst rtlconsts
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_RSTS+=math typinfo classes sysconst rtlconsts
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_RSTS+=math typinfo classes sysconst rtlconsts
 endif
@@ -1103,6 +1112,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC) $(BSDPROCINC) $(OSPROCINC)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC) $(BSDPROCINC) $(OSPROCINC)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC) $(BSDPROCINC) $(OSPROCINC)
 endif
@@ -1328,6 +1340,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC) $(COMMON)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC) $(COMMON)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(BSDINC) $(COMMON)
 endif
@@ -1771,6 +1786,11 @@ EXEEXT=
 SHAREDLIBEXT=.library
 SHORTSUFFIX=amg
 endif
+ifeq ($(OS_TARGET),aros)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=aros
+endif
 ifeq ($(OS_TARGET),morphos)
 EXEEXT=
 SHAREDLIBEXT=.library
@@ -2703,9 +2723,9 @@ rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PP
 macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
 	$(COMPILER) $(INC)/macpas.pp $(REDIR)
 ifeq ($(ARCH),x86_64)
-cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT)
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT)
 else
-cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 endif
 mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)

+ 2 - 2
rtl/darwin/Makefile.fpc

@@ -228,9 +228,9 @@ macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
 #
 
 ifeq ($(ARCH),x86_64)
-cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT)
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT)
 else
-cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 endif
 
 mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)

+ 345 - 79
rtl/gba/Makefile

@@ -1,9 +1,9 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-04-01 rev 27428]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
-BSDs = freebsd netbsd openbsd darwin
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+BSDs = freebsd netbsd openbsd darwin dragonfly
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
 OSNeedsComspecToRunBatch = go32v2 watcom
@@ -341,229 +341,466 @@ endif
 OBJPASDIR=$(RTL)/objpas
 GRAPHDIR=$(INC)/graph
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
+endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-wii)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-aix)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
+endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc64-aix)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),mips-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),mipsel-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),mipsel-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),jvm-java)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),jvm-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i8086-msdos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-iphonesim)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-android)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-aix)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-openbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-android)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc64-aix)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),mips-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),mipsel-android)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),jvm-java)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),jvm-android)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i8086-msdos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt0 cprt0
@@ -634,6 +871,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_LOADERS+=prt0 cprt0
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_LOADERS+=prt0 cprt0
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_LOADERS+=prt0 cprt0
 endif
@@ -721,6 +961,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_LOADERS+=prt0 cprt0
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_LOADERS+=prt0 cprt0
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_LOADERS+=prt0 cprt0
 endif
@@ -860,6 +1103,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
@@ -947,6 +1193,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
@@ -1085,6 +1334,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
@@ -1172,6 +1424,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
@@ -1483,6 +1738,12 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=lnx
 endif
+ifeq ($(OS_TARGET),dragonfly)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=df
+endif
 ifeq ($(OS_TARGET),freebsd)
 BATCHEXT=.sh
 EXEEXT=
@@ -1528,6 +1789,11 @@ EXEEXT=
 SHAREDLIBEXT=.library
 SHORTSUFFIX=amg
 endif
+ifeq ($(OS_TARGET),aros)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=aros
+endif
 ifeq ($(OS_TARGET),morphos)
 EXEEXT=
 SHAREDLIBEXT=.library
@@ -1992,7 +2258,7 @@ endif
 ifdef CREATESHARED
 override FPCOPT+=-Cg
 endif
-ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),)
+ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
 ifeq ($(CPU_TARGET),x86_64)
 override FPCOPT+=-Cg
 endif

+ 1 - 1
rtl/gba/Makefile.fpc

@@ -12,7 +12,7 @@ units=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings \
       sysutils \
       classes math typinfo ctypes \
       charset cpall getopts \
-      types rtlconsts sysconst lineinfo fgl \
+      types rtlconsts sysconst lineinfo fgl
 #      exec timer doslib utility hardware inputevent graphics layers \
 # these can be moved to packages later
 #      clipboard datatypes asl ahi tinygl get9 muihelper  \

+ 0 - 4
rtl/i8086/i8086.inc

@@ -586,10 +586,6 @@ const
   FPU_StackOverflow = $40;
   FPU_ExceptionMask = $ff;
 
-  { use Default8087CW instead
-  fpucw : word = $1300 or FPU_StackUnderflow or FPU_Underflow or FPU_Denormal;
-  }
-
 { Detects the FPU and initializes the Test8087 variable (and Default8087CW):
   0 = NO FPU
   1 = 8087

+ 82 - 0
rtl/inc/dynarr.inc

@@ -303,6 +303,88 @@ function fpc_dynarray_copy(psrc : pointer;ti : pointer;
 procedure DynArraySetLength(var a: Pointer; typeInfo: Pointer; dimCnt: SizeInt; lengthVec: PSizeInt);
   external name 'FPC_DYNARR_SETLENGTH';
 
+function DynArraySize(a : pointer): tdynarrayindex;
+  external name 'FPC_DYNARRAY_LENGTH';
+
+procedure DynArrayClear(var a: Pointer; typeInfo: Pointer);
+  external name 'FPC_DYNARRAY_CLEAR';
+
+function DynArrayDim(typeInfo: Pointer): Integer;
+  begin
+    result:=0;
+    while (typeInfo <> nil) and (pdynarraytypeinfo(typeInfo)^.kind = tkDynArray) do
+    begin
+      { skip kind and name }
+      typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
+
+      { element type info}
+      typeInfo:=pdynarraytypedata(typeInfo)^.elType2;
+
+      Inc(result);
+    end;
+  end;
+
+function DynArrayBounds(a: Pointer; typeInfo: Pointer): TBoundArray;
+  var
+    i,dim: sizeint;
+  begin
+    dim:=DynArrayDim(typeInfo);
+    SetLength(result, dim);
+
+    for i:=0 to pred(dim) do
+      if a = nil then
+        exit
+      else
+      begin
+        result[i]:=DynArraySize(a)-1;
+        a:=PPointerArray(a)^[0];
+      end;
+  end;
+
+function IsDynArrayRectangular(a: Pointer; typeInfo: Pointer): Boolean;
+  var
+    i,j: sizeint;
+    dim,count: sizeint;
+  begin
+    dim:=DynArrayDim(typeInfo);
+    for i:=1 to pred(dim) do
+    begin
+      count:=DynArraySize(PPointerArray(a)^[0]);
+
+      for j:=1 to Pred(DynArraySize(a)) do
+        if count<>DynArraySize(PPointerArray(a)^[j]) then
+          exit(false);
+
+      a:=PPointerArray(a)^[0];
+    end;
+    result:=true;
+  end;
+
+function DynArrayIndex(a: Pointer; const indices: array of SizeInt; typeInfo: Pointer): Pointer;
+  var
+    i,h: sizeint;
+  begin
+    h:=High(indices);
+    for i:=0 to h do
+    begin
+      if i<h then
+        a := PPointerArray(a)^[indices[i]];
+
+      { skip kind and name }
+      typeInfo:=(typeInfo+2+PByte(typeInfo)[1]);
+      { element type info}
+      typeInfo:=pdynarraytypedata(typeInfo)^.elType2;
+
+      if typeInfo=nil then
+        exit(nil);
+    end;
+
+    { skip kind and name }
+    typeInfo:=(typeInfo+2+PByte(typeInfo)[1]);
+
+    result:=@(PByte(a)[indices[h]*pdynarraytypedata(typeInfo)^.elSize]);
+  end;
+
 { obsolete but needed for bootstrapping }
 procedure fpc_dynarray_decr_ref(var p : pointer;ti : pointer); [Public,Alias:'FPC_DYNARRAY_DECR_REF']; compilerproc;
   begin

+ 8 - 0
rtl/inc/dynarrh.inc

@@ -30,4 +30,12 @@ type
   end;
   
 procedure DynArraySetLength(var a: Pointer; typeInfo: Pointer; dimCnt: SizeInt; lengthVec: PSizeInt);
+function DynArraySize(a : pointer): tdynarrayindex;
+procedure DynArrayClear(var a: Pointer; typeInfo: Pointer);
+function DynArrayDim(typeInfo: Pointer): Integer;
+function DynArrayBounds(a: Pointer; typeInfo: Pointer): TBoundArray;
+
+function IsDynArrayRectangular(a: Pointer; typeInfo: Pointer): Boolean;
+function DynArrayIndex(a: Pointer; const indices: array of SizeInt; typeInfo: Pointer): Pointer;
+
 procedure fpc_dynarray_rangecheck(p : pointer;i : tdynarrayindex); compilerproc;

+ 16 - 0
rtl/inc/rtti.inc

@@ -392,3 +392,19 @@ procedure fpc_decref_array(data,typeinfo: pointer; count: SizeInt); [public,alia
     int_finalizeArray(data,typeinfo,count);
   end;
 
+procedure InitializeArray(p, typeInfo: Pointer; count: SizeInt);
+  external name 'FPC_INITIALIZE_ARRAY';
+
+procedure FinalizeArray(p, typeInfo: Pointer; count: SizeInt);
+  external name 'FPC_FINALIZE_ARRAY';
+
+procedure CopyArray(dest, source, typeInfo: Pointer; count: SizeInt);
+  var
+    i, size: SizeInt;
+  begin
+    size:=RTTISize(typeInfo);
+    if size>0 then
+      for i:=0 to count-1 do
+        fpc_Copy_internal(source+size*i, dest+size*i, typeInfo);
+  end;
+

+ 18 - 0
rtl/inc/rttih.inc

@@ -0,0 +1,18 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2014 by Maciej Izak
+
+    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.
+
+ **********************************************************************}
+
+procedure InitializeArray(p, typeInfo: Pointer; count: SizeInt);
+procedure FinalizeArray(p, typeInfo: Pointer; count: SizeInt);
+procedure CopyArray(dest, source, typeInfo: Pointer; count: SizeInt);
+
+

+ 8 - 0
rtl/inc/systemh.inc

@@ -1476,6 +1476,14 @@ const
 {$i varianth.inc}
 {$endif FPC_HAS_FEATURE_VARIANTS}
 
+{*****************************************************************************
+                           RTTI support
+*****************************************************************************}
+
+{$ifdef FPC_HAS_FEATURE_RTTI}
+{$i rttih.inc}
+{$endif FPC_HAS_FEATURE_RTTI}
+
 {*****************************************************************************
                    Internal helper routines support
 *****************************************************************************}

+ 3 - 1
rtl/m68k/m68k.inc

@@ -99,7 +99,9 @@ asm
   ble    @LMEMSET5
 {$ifdef CPUM68K_HAS_DBRA}
 { FIXME: Any reason why not always just use DBRA mode on
-         CPUs which support it? (KB) }
+         CPUs which support it? (KB)
+         - DBRA does only 16-bit decrements, so handling more than 65535 bytes
+         requires additional code anyway (Sergei) }
   cmpi.l #65535, d1     { check, if this is a word move }
   ble    @LMEMSET3      { use fast dbra mode            }
 {$endif CPUM68K_HAS_DBRA}

+ 345 - 79
rtl/nds/Makefile

@@ -1,9 +1,9 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-04-01 rev 27428]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
-BSDs = freebsd netbsd openbsd darwin
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+BSDs = freebsd netbsd openbsd darwin dragonfly
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
 OSNeedsComspecToRunBatch = go32v2 watcom
@@ -341,229 +341,466 @@ endif
 OBJPASDIR=$(RTL)/objpas
 GRAPHDIR=$(INC)/graph
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i386-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
+endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-wii)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc-aix)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
+endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),arm-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),powerpc64-aix)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),mips-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),mipsel-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),mipsel-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),jvm-java)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),jvm-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
 endif
 ifeq ($(FULL_TARGET),i8086-msdos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl implicitunits=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings sysutils classes math typinfo ctypes charset cpall getopts types rtlconsts sysconst lineinfo fgl
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-iphonesim)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-android)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc-aix)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-openbsd)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),arm-android)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),powerpc64-aix)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),mips-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),mipsel-android)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),jvm-java)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),jvm-android)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
+endif
+ifeq ($(FULL_TARGET),i8086-msdos)
+override TARGET_IMPLICITUNITS+=cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt07 prt09 cprt07 cprt09
@@ -634,6 +871,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override TARGET_LOADERS+=prt07 prt09 cprt07 cprt09
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override TARGET_LOADERS+=prt07 prt09 cprt07 cprt09
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_LOADERS+=prt07 prt09 cprt07 cprt09
 endif
@@ -721,6 +961,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_LOADERS+=prt07 prt09 cprt07 cprt09
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_LOADERS+=prt07 prt09 cprt07 cprt09
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_LOADERS+=prt07 prt09 cprt07 cprt09
 endif
@@ -860,6 +1103,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
@@ -947,6 +1193,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
@@ -1085,6 +1334,9 @@ endif
 ifeq ($(FULL_TARGET),i386-android)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
+ifeq ($(FULL_TARGET),i386-aros)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
@@ -1172,6 +1424,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
@@ -1483,6 +1738,12 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=lnx
 endif
+ifeq ($(OS_TARGET),dragonfly)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=df
+endif
 ifeq ($(OS_TARGET),freebsd)
 BATCHEXT=.sh
 EXEEXT=
@@ -1528,6 +1789,11 @@ EXEEXT=
 SHAREDLIBEXT=.library
 SHORTSUFFIX=amg
 endif
+ifeq ($(OS_TARGET),aros)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=aros
+endif
 ifeq ($(OS_TARGET),morphos)
 EXEEXT=
 SHAREDLIBEXT=.library
@@ -1992,7 +2258,7 @@ endif
 ifdef CREATESHARED
 override FPCOPT+=-Cg
 endif
-ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),)
+ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
 ifeq ($(CPU_TARGET),x86_64)
 override FPCOPT+=-Cg
 endif

+ 1 - 1
rtl/nds/Makefile.fpc

@@ -12,7 +12,7 @@ units=$(SYSTEMUNIT) uuchar objpas macpas iso7185 strings \
       sysutils \
       classes math typinfo ctypes \
       charset cpall getopts \
-      types rtlconsts sysconst lineinfo fgl \
+      types rtlconsts sysconst lineinfo fgl
 #      exec timer doslib utility hardware inputevent graphics layers \
 # these can be moved to packages later
 #      clipboard datatypes asl ahi tinygl get9 muihelper \

+ 5 - 1
rtl/objpas/sysutils/fina.inc

@@ -402,7 +402,11 @@ begin
   Result:=-1;
   While I<=Length(DirName) do
     begin
-    If CharInSet(DirName[i],AllowDirectorySeparators) and
+    If (CharInSet(DirName[i],AllowDirectorySeparators)
+    {$ifdef HASAMIGA}
+      or (DirName[i] = DriveSeparator)
+    {$endif}
+      ) and
        { avoid error in case last char=pathdelim }
        (length(dirname)>i) then
       begin

+ 7 - 2
rtl/objpas/unicodedata.pas

@@ -207,7 +207,12 @@ type
 
   { TUC_Prop }
 
-  TUC_Prop = packed record
+  { On alignment-sensitive targets, at least some of them, assembler uses to forcibly align data >1 byte.
+    This breaks intended layout of initialized constants/variables.
+    A proper solution is to patch compiler to emit always unaligned directives for words/dwords/etc,
+    but for now just declare this record as "unpacked". This causes bloat, but it's better than having
+    entire unit not working at all. }
+  TUC_Prop = {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}packed{$endif} record
   private
     function GetCategory : Byte;inline;
     procedure SetCategory(AValue : Byte);
@@ -322,7 +327,7 @@ type
   TCollationName = string[128];
 
   PUCA_DataBook = ^TUCA_DataBook;
-  TUCA_DataBook = packed record
+  TUCA_DataBook = record
   public
     Base               : PUCA_DataBook;
     Version            : TCollationName;

+ 101 - 80
rtl/solaris/Makefile

@@ -1,9 +1,9 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-08-17 rev 28432]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
-BSDs = freebsd netbsd openbsd darwin
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku 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 i386-nativent i386-iphonesim i386-android i386-aros 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 powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos
+BSDs = freebsd netbsd openbsd darwin dragonfly
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
 OSNeedsComspecToRunBatch = go32v2 watcom
@@ -354,232 +354,235 @@ ifndef USELIBGGI
 USELIBGGI=NO
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-aros)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc-wii)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc-aix)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),x86_64-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),x86_64-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
+endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),arm-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),powerpc64-aix)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),mips-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),mipsel-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),mipsel-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),jvm-java)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),jvm-android)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i8086-msdos)
-override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos unixcp fpwidestring cwstring fpintres $(CPU_UNITS)
+override TARGET_UNITS+=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas heaptrc lineinfo lnfodwrf baseunix unixutil unixcp termio unix initc cmem sysutils typinfo math fgl classes charset cpall getopts errors dl dynlibs types sysconst character rtlconsts cthreads dos fpwidestring cwstring fpintres $(CPU_UNITS)
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable
@@ -740,6 +743,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable
 endif
@@ -968,6 +974,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_RSTS+=math typinfo classes sysconst rtlconst
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override TARGET_RSTS+=math typinfo classes sysconst rtlconst
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_RSTS+=math typinfo classes sysconst rtlconst
 endif
@@ -1197,6 +1206,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
 endif
@@ -1425,6 +1437,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
 endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
 endif
@@ -1736,6 +1751,12 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=lnx
 endif
+ifeq ($(OS_TARGET),dragonfly)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=df
+endif
 ifeq ($(OS_TARGET),freebsd)
 BATCHEXT=.sh
 EXEEXT=
@@ -2250,7 +2271,7 @@ endif
 ifdef CREATESHARED
 override FPCOPT+=-Cg
 endif
-ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),)
+ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
 ifeq ($(CPU_TARGET),x86_64)
 override FPCOPT+=-Cg
 endif

+ 1 - 1
rtl/solaris/Makefile.fpc

@@ -17,7 +17,7 @@ units=$(SYSTEMUNIT) uuchar unixtype ctypes strings objpas iso7185 macpas \
       dl dynlibs \
       types sysconst character \
       rtlconsts cthreads \
-      dos unixcp fpwidestring \
+      dos fpwidestring \
       cwstring fpintres $(CPU_UNITS)
 
 implicitunits=exeinfo \

+ 31 - 9
rtl/unix/cwstring.pp

@@ -993,6 +993,18 @@ begin
   ansi2pchar(temp,str,result);
 end;
 
+
+function envvarset(const varname: pchar): boolean;
+var
+  varval: pchar;
+begin
+  varval:=fpgetenv(varname);
+  result:=
+    assigned(varval) and
+    (varval[0]<>#0);
+end;
+
+
 function GetStandardCodePage(const stdcp: TStandardCodePageEnum): TSystemCodePage;
 var
   langinfo: pchar;
@@ -1004,15 +1016,25 @@ begin
       exit;
     end;
 {$endif}
-  langinfo:=nl_langinfo(CODESET);
-  { there's a bug in the Mac OS X 10.5 libc (based on FreeBSD's)
-    that causes it to return an empty string of UTF-8 locales
-    -> patch up (and in general, UTF-8 is a good default on
-    Unix platforms) }
-  if not assigned(langinfo) or
-     (langinfo^=#0) then
-    langinfo:='UTF-8';
-  Result := GetCodepageByName(ansistring(langinfo));
+  { if none of the relevant LC_* environment variables are set, fall back to
+    UTF-8 (this happens under some versions of OS X for GUI applications, which
+    otherwise get CP_ASCII) }
+  if envvarset('LC_ALL') or
+     envvarset('LC_CTYPE') or
+     envvarset('LANG') then
+    begin
+      langinfo:=nl_langinfo(CODESET);
+      { there's a bug in the Mac OS X 10.5 libc (based on FreeBSD's)
+        that causes it to return an empty string of UTF-8 locales
+        -> patch up (and in general, UTF-8 is a good default on
+        Unix platforms) }
+      if not assigned(langinfo) or
+         (langinfo^=#0) then
+        langinfo:='UTF-8';
+      Result:=GetCodepageByName(ansistring(langinfo));
+    end
+  else
+    Result:=unixcp.GetSystemCodepage;
 end;
 
 {$ifdef FPC_HAS_CPSTRING}

+ 1 - 1
rtl/unix/unixcp.pp

@@ -714,7 +714,7 @@ var
 begin
   // Get one of non-empty environment variables in the next order:
   // LC_ALL, LC_CTYPE, LANG. Default is UTF-8 or ASCII.
-{$ifdef linux}
+{$if defined(linux) or defined(darwin)}
   Result:=CP_UTF8;
 {$else}
   Result:=CP_ASCII;

+ 2 - 2
rtl/win/wininc/unifun.inc

@@ -295,8 +295,8 @@ function EnumDisplaySettingsW(lpszDeviceName:LPCWSTR; iModeNum:DWORD;lpDevMode:L
 function SystemParametersInfoW(uiAction:UINT; uiParam:UINT; pvParam:PVOID; fWinIni:UINT):WINBOOL; external 'user32' name 'SystemParametersInfoW';
 function AddFontResourceW(_para1:LPCWSTR):longint; external 'gdi32' name 'AddFontResourceW';
 function CopyMetaFileW(_para1:HMETAFILE; _para2:LPCWSTR):HMETAFILE; external 'gdi32' name 'CopyMetaFileW';
-function CreateFontIndirectW(_para1:PLOGFONT):HFONT; external 'gdi32' name 'CreateFontIndirectW';
-function CreateFontIndirectW(var _para1:LOGFONT):HFONT; external 'gdi32' name 'CreateFontIndirectW';
+function CreateFontIndirectW(_para1:PLOGFONTW):HFONT; external 'gdi32' name 'CreateFontIndirectW';
+function CreateFontIndirectW(var _para1:LOGFONTW):HFONT; external 'gdi32' name 'CreateFontIndirectW';
 function CreateFontW(_para1:longint; _para2:longint; _para3:longint; _para4:longint; _para5:longint;_para6:DWORD; _para7:DWORD; _para8:DWORD; _para9:DWORD; _para10:DWORD;_para11:DWORD; _para12:DWORD; _para13:DWORD; _para14:LPCWSTR):HFONT;
   external 'gdi32' name 'CreateFontW';
 function CreateICW(_para1:LPCWSTR; _para2:LPCWSTR; _para3:LPCWSTR; _para4:LPDEVMODEw):HDC; external 'gdi32' name 'CreateICW';

+ 1 - 0
rtl/wince/wininc/coredll.inc

@@ -2168,6 +2168,7 @@ function GetFileVersionInfoSizeW(lptstrFilename:LPWSTR; lpdwHandle:LPDWORD):DWOR
 function GetFileVersionInfoSizeW(lptstrFilename:LPWSTR; var dwHandle:DWORD):DWORD; external KernelDLL name 'GetFileVersionInfoSizeW';
 function GetFileVersionInfo(lptstrFilename:LPWSTR; dwHandle:DWORD; dwLen:DWORD; lpData:LPVOID):WINBOOL; external KernelDLL name 'GetFileVersionInfoW';
 function GetFileVersionInfoW(lptstrFilename:LPWSTR; dwHandle:DWORD; dwLen:DWORD; lpData:LPVOID):WINBOOL; external KernelDLL name 'GetFileVersionInfoW';
+function GetIconInfo(hIcon: HICON; piconinfo: pIconInfo): BOOL; external KernelDLL name 'GetIconInfo';
 function GetIdleTime:DWORD; external KernelDLL name 'GetIdleTime'; // index 399
 function GetKeyboardLayout(dwLayout:DWORD):HKL; external KernelDLL name 'GetKeyboardLayout';
 function GetKeyboardLayoutList(nBuff:longint; var lpList:HKL):UINT; external KernelDLL name 'GetKeyboardLayoutList';

+ 18 - 0
tests/test/tgeneric97.pp

@@ -0,0 +1,18 @@
+program tgeneric97;
+
+{$mode objfpc}
+
+type
+  generic TTest<T> = class
+
+  end;
+
+  TTestLongInt = specialize TTest<LongInt>;
+  TTestString = specialize TTest<AnsiString>;
+
+begin
+  if LowerCase(TTestLongInt.ClassName) <> 'ttest<system.longint>' then
+    halt(1);
+  if LowerCase(TTestString.ClassName) <> 'ttest<system.ansistring>' then
+    halt(2);
+end.

+ 56 - 0
tests/test/thlp47.pp

@@ -0,0 +1,56 @@
+{ This tests that class variables for the various helper kinds work correctly }
+
+program thlp47;
+
+{$mode objfpc}
+{$modeswitch advancedrecords}
+{$modeswitch typehelpers}
+
+type
+  TObjectHelper = class helper for TObject
+  public
+    class procedure Init;
+  public class var
+    Value: LongInt;
+  end;
+
+  TGuidHelper = record helper for TGuid
+  public
+    class procedure Init; static;
+  public class var
+    Value: LongInt;
+  end;
+
+  TLongIntHelper = type helper for LongInt
+  public
+    class procedure Init; static;
+  public class var
+    Value: LongInt;
+  end;
+
+class procedure TObjectHelper.Init;
+begin
+  Value := 42;
+end;
+
+class procedure TGuidHelper.Init;
+begin
+  Value := 21;
+end;
+
+class procedure TLongIntHelper.Init;
+begin
+  Value := 84;
+end;
+
+begin
+  TObject.Init;
+  if TObject.Value <> 42 then
+    Halt(1);
+  TGuid.Init;
+  if TGuid.Value <> 21 then
+    Halt(2);
+  LongInt.Init;
+  if LongInt.Value <> 84 then
+    Halt(3);
+end.

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff