Răsfoiți Sursa

Merged revisions 13351-13373,13376-13457 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

git-svn-id: branches/objc@13458 -

Jonas Maebe 16 ani în urmă
părinte
comite
335e159c11
100 a modificat fișierele cu 10230 adăugiri și 1715 ștergeri
  1. 41 2
      .gitattributes
  2. 2 2
      compiler/arm/cpubase.pas
  3. 37 0
      compiler/avr/cgcpu.pas
  4. 2 2
      compiler/avr/cpubase.pas
  5. 1 0
      compiler/avr/cpunode.pas
  6. 13 1
      compiler/avr/navradd.pas
  7. 180 0
      compiler/avr/navrcnv.pas
  8. 4 3
      compiler/cgbase.pas
  9. 4 4
      compiler/cgobj.pas
  10. 2 0
      compiler/cgutils.pas
  11. 49 57
      compiler/dbgdwarf.pas
  12. 12 9
      compiler/gendef.pas
  13. 2 1
      compiler/htypechk.pas
  14. 3 3
      compiler/i386/cpupara.pas
  15. 2 2
      compiler/m68k/cpubase.pas
  16. 2 2
      compiler/m68k/cpupara.pas
  17. 22 14
      compiler/msg/errore.msg
  18. 13 12
      compiler/msgidx.inc
  19. 354 354
      compiler/msgtxt.inc
  20. 5 1
      compiler/nadd.pas
  21. 18 0
      compiler/ncal.pas
  22. 1 1
      compiler/ncgld.pas
  23. 1 1
      compiler/ncnv.pas
  24. 1 1
      compiler/nld.pas
  25. 1 1
      compiler/nobj.pas
  26. 3 1
      compiler/options.pas
  27. 2 1
      compiler/parser.pas
  28. 1 1
      compiler/pdecobj.pas
  29. 14 7
      compiler/pdecsub.pas
  30. 11 14
      compiler/pdecvar.pas
  31. 7 4
      compiler/pexpr.pas
  32. 2 2
      compiler/powerpc/cpubase.pas
  33. 2 2
      compiler/powerpc/cpupara.pas
  34. 2 2
      compiler/powerpc64/cpubase.pas
  35. 2 2
      compiler/powerpc64/cpupara.pas
  36. 3 3
      compiler/pp.lpi
  37. 10 10
      compiler/ppc68k.lpi
  38. 2 2
      compiler/ppcarm.lpi
  39. 3 4
      compiler/ppcavr.lpi
  40. 3 4
      compiler/ppcppc.lpi
  41. 3 4
      compiler/ppcsparc.lpi
  42. 11 10
      compiler/ppx86_64.lpi
  43. 1 1
      compiler/psystem.pas
  44. 38 25
      compiler/ptconst.pas
  45. 12 9
      compiler/ptype.pas
  46. 4 4
      compiler/scandir.pas
  47. 22 6
      compiler/sparc/cpubase.pas
  48. 2 2
      compiler/sparc/cpupara.pas
  49. 1 1
      compiler/symdef.pas
  50. 2 2
      compiler/systems/t_linux.pas
  51. 19 4
      compiler/x86/cpubase.pas
  52. 2 0
      compiler/x86/rax86int.pas
  53. 14 5
      compiler/x86_64/cpupara.pas
  54. 121 43
      packages/Makefile
  55. 28 22
      packages/Makefile.fpc
  56. 73 59
      packages/bzip2/Makefile
  57. 1 1
      packages/bzip2/Makefile.fpc
  58. 2 61
      packages/bzip2/src/bzip2.pas
  59. 76 0
      packages/bzip2/src/bzip2comn.pp
  60. 31 0
      packages/bzip2/src/bzip2si386.inc
  61. 668 0
      packages/bzip2/src/bzip2stream.pp
  62. 14 1
      packages/cairo/src/cairo.pp
  63. 2350 0
      packages/fastcgi/Makefile
  64. 24 0
      packages/fastcgi/Makefile.fpc
  65. 35 0
      packages/fastcgi/fpmake.pp
  66. 0 0
      packages/fastcgi/src/fastcgi.pp
  67. 146 0
      packages/fcl-base/src/ascii85.pp
  68. 28 32
      packages/fcl-base/src/base64.pp
  69. 21 1
      packages/fcl-base/src/blowfish.pp
  70. 1 0
      packages/fcl-db/src/base/dataset.inc
  71. 2 1
      packages/fcl-db/src/base/db.pas
  72. 39 10
      packages/fcl-db/src/base/fields.inc
  73. 8 1
      packages/fcl-db/src/base/sqlscript.pp
  74. 10 8
      packages/fcl-db/src/sqldb/interbase/ibconnection.pp
  75. 8 4
      packages/fcl-db/src/sqldb/sqldb.pp
  76. 37 18
      packages/fcl-db/src/sqlite/customsqliteds.pas
  77. 25 0
      packages/fcl-db/tests/testfieldtypes.pas
  78. 231 2
      packages/fcl-json/src/fpjson.pp
  79. 53 0
      packages/fcl-json/src/jsonconf.pp
  80. 4 1
      packages/fcl-json/src/jsonparser.pp
  81. 4 1
      packages/fcl-json/tests/jsonconftest.pp
  82. 170 14
      packages/fcl-json/tests/testjsondata.pp
  83. 24 0
      packages/fcl-json/tests/testjsonparser.pp
  84. 111 27
      packages/fcl-web/Makefile
  85. 11 11
      packages/fcl-web/Makefile.fpc
  86. 1 0
      packages/fcl-web/fpmake.pp
  87. 587 366
      packages/fcl-xml/src/dom_html.pp
  88. 491 246
      packages/fcl-xml/src/htmldefs.pp
  89. 17 1
      packages/fcl-xml/src/htmwrite.pp
  90. 48 23
      packages/fcl-xml/src/sax.pp
  91. 135 108
      packages/fcl-xml/src/sax_html.pp
  92. 25 26
      packages/fcl-xml/src/sax_xml.pp
  93. 27 18
      packages/fcl-xml/src/xmlread.pp
  94. 71 2
      packages/fcl-xml/src/xpath.pp
  95. 16 2
      packages/fcl-xml/tests/xpathts.pp
  96. 3071 0
      packages/fpvectorial/Makefile
  97. 37 0
      packages/fpvectorial/Makefile.fpc
  98. 57 0
      packages/fpvectorial/fpmake.pp
  99. 234 0
      packages/fpvectorial/src/avisocncgcodereader.pas
  100. 87 0
      packages/fpvectorial/src/avisocncgcodewriter.pas

+ 41 - 2
.gitattributes

@@ -90,6 +90,7 @@ compiler/avr/cpupi.pas svneol=native#text/plain
 compiler/avr/cputarg.pas svneol=native#text/plain
 compiler/avr/itcpugas.pas svneol=native#text/plain
 compiler/avr/navradd.pas svneol=native#text/plain
+compiler/avr/navrcnv.pas svneol=native#text/plain
 compiler/avr/navrmat.pas svneol=native#text/plain
 compiler/avr/raavr.pas svneol=native#text/plain
 compiler/avr/raavrgas.pas svneol=native#text/plain
@@ -929,7 +930,10 @@ packages/bzip2/Makefile.fpc svneol=native#text/plain
 packages/bzip2/examples/pasbzip.pas svneol=native#text/plain
 packages/bzip2/fpmake.pp svneol=native#text/plain
 packages/bzip2/src/bzip2.pas svneol=native#text/plain
+packages/bzip2/src/bzip2comn.pp svneol=native#text/plain
 packages/bzip2/src/bzip2i386.inc svneol=native#text/plain
+packages/bzip2/src/bzip2si386.inc svneol=native#text/plain
+packages/bzip2/src/bzip2stream.pp svneol=native#text/plain
 packages/cairo/Makefile svneol=native#text/plain
 packages/cairo/Makefile.fpc svneol=native#text/plain
 packages/cairo/fpmake.pp svneol=native#text/plain
@@ -1005,6 +1009,10 @@ packages/dts/Makefile svneol=native#text/plain
 packages/dts/Makefile.fpc svneol=native#text/plain
 packages/dts/fpmake.pp svneol=native#text/plain
 packages/dts/src/dts.pas svneol=native#text/plain
+packages/fastcgi/Makefile svneol=native#text/plain
+packages/fastcgi/Makefile.fpc svneol=native#text/plain
+packages/fastcgi/fpmake.pp svneol=native#text/plain
+packages/fastcgi/src/fastcgi.pp svneol=native#text/plain
 packages/fcl-async/Makefile svneol=native#text/plain
 packages/fcl-async/Makefile.fpc svneol=native#text/plain
 packages/fcl-async/fpmake.pp svneol=native#text/plain
@@ -1640,7 +1648,6 @@ packages/fcl-web/src/custcgi.pp svneol=native#text/plain
 packages/fcl-web/src/custfcgi.pp svneol=native#text/plain
 packages/fcl-web/src/custweb.pp svneol=native#text/plain
 packages/fcl-web/src/ezcgi.pp svneol=native#text/plain
-packages/fcl-web/src/fastcgi.pp svneol=native#text/plain
 packages/fcl-web/src/fpapache.pp svneol=native#text/plain
 packages/fcl-web/src/fpcgi.pp svneol=native#text/plain
 packages/fcl-web/src/fpdatasetform.pp svneol=native#text/plain
@@ -1725,6 +1732,19 @@ packages/fpmkunit/Makefile.fpc svneol=native#text/plain
 packages/fpmkunit/examples/ppu2fpmake.sh svneol=native#text/plain
 packages/fpmkunit/fpmake.pp svneol=native#text/plain
 packages/fpmkunit/src/fpmkunit.pp svneol=native#text/plain
+packages/fpvectorial/Makefile svneol=native#text/plain
+packages/fpvectorial/Makefile.fpc svneol=native#text/plain
+packages/fpvectorial/fpmake.pp svneol=native#text/plain
+packages/fpvectorial/src/avisocncgcodereader.pas svneol=native#text/plain
+packages/fpvectorial/src/avisocncgcodewriter.pas svneol=native#text/plain
+packages/fpvectorial/src/avisozlib.pas svneol=native#text/plain
+packages/fpvectorial/src/fpvectbuildunit.pas svneol=native#text/plain
+packages/fpvectorial/src/fpvectorial.pas svneol=native#text/plain
+packages/fpvectorial/src/fpvtocanvas.pas svneol=native#text/plain
+packages/fpvectorial/src/pdfvectorialreader.pas svneol=native#text/plain
+packages/fpvectorial/src/pdfvrlexico.pas svneol=native#text/plain
+packages/fpvectorial/src/pdfvrsemantico.pas svneol=native#text/plain
+packages/fpvectorial/src/pdfvrsintatico.pas svneol=native#text/plain
 packages/fv/Makefile svneol=native#text/plain
 packages/fv/Makefile.fpc svneol=native#text/plain
 packages/fv/examples/Makefile svneol=native#text/plain
@@ -2537,6 +2557,7 @@ packages/gtk2/src/pango/pango-engine.inc svneol=native#text/plain
 packages/gtk2/src/pango/pango-font.inc svneol=native#text/plain
 packages/gtk2/src/pango/pango-fontmap.inc svneol=native#text/plain
 packages/gtk2/src/pango/pango-fontset.inc svneol=native#text/plain
+packages/gtk2/src/pango/pango-glyph-item.inc svneol=native#text/plain
 packages/gtk2/src/pango/pango-glyph.inc svneol=native#text/plain
 packages/gtk2/src/pango/pango-item.inc svneol=native#text/plain
 packages/gtk2/src/pango/pango-layout.inc svneol=native#text/plain
@@ -2547,6 +2568,7 @@ packages/gtk2/src/pango/pango-types.inc svneol=native#text/plain
 packages/gtk2/src/pango/pango.pas svneol=native#text/plain
 packages/gtk2/src/pango/pangoincludes.inc svneol=native#text/plain
 packages/gtk2/src/pango/pangoutils.pas svneol=native#text/plain
+packages/gtk2/src/pangocairo/pangocairo.pas svneol=native#text/plain
 packages/hash/Makefile svneol=native#text/plain
 packages/hash/Makefile.fpc svneol=native#text/plain
 packages/hash/examples/Makefile svneol=native#text/plain
@@ -3914,7 +3936,6 @@ packages/numlib/tests/timer.pas svneol=native#text/plain
 packages/numlib/tests/turte.pas svneol=native#text/plain
 packages/objcrtl/Makefile svneol=native#text/plain
 packages/objcrtl/Makefile.fpc svneol=native#text/plain
-packages/objcrtl/Package.fpc svneol=native#text/plain
 packages/objcrtl/examples/objcrtltest.pas svneol=native#text/plain
 packages/objcrtl/fpmake.pp svneol=native#text/plain
 packages/objcrtl/src/objcrtl.pas svneol=native#text/plain
@@ -6246,6 +6267,8 @@ rtl/objpas/sysutils/sysstr.inc svneol=native#text/plain
 rtl/objpas/sysutils/sysstrh.inc svneol=native#text/plain
 rtl/objpas/sysutils/systhrdh.inc svneol=native#text/plain
 rtl/objpas/sysutils/sysuintf.inc svneol=native#text/plain
+rtl/objpas/sysutils/sysuni.inc svneol=native#text/plain
+rtl/objpas/sysutils/sysunih.inc svneol=native#text/plain
 rtl/objpas/sysutils/sysuthrd.inc svneol=native#text/plain
 rtl/objpas/sysutils/sysutilh.inc svneol=native#text/plain
 rtl/objpas/sysutils/sysutils.inc svneol=native#text/plain
@@ -8495,6 +8518,8 @@ tests/test/units/system/tres2.txt -text
 tests/test/units/system/tres2ext.pp svneol=native#text/plain
 tests/test/units/system/tres3.pp svneol=native#text/plain
 tests/test/units/system/tres3ext.pp svneol=native#text/plain
+tests/test/units/system/tres4.pp svneol=native#text/plain
+tests/test/units/system/tres4.res -text
 tests/test/units/system/tresb.rc svneol=native#text/plain
 tests/test/units/system/tresb.res -text
 tests/test/units/system/tresext.pp svneol=native#text/plain
@@ -8627,6 +8652,9 @@ tests/webtbf/tw1395.pp svneol=native#text/plain
 tests/webtbf/tw13956.pp svneol=native#text/plain
 tests/webtbf/tw13992.pp svneol=native#text/plain
 tests/webtbf/tw1407.pp svneol=native#text/plain
+tests/webtbf/tw14104a.pp svneol=native#text/plain
+tests/webtbf/tw14104b.pp svneol=native#text/plain
+tests/webtbf/tw14104c.pp svneol=native#text/plain
 tests/webtbf/tw1432.pp svneol=native#text/plain
 tests/webtbf/tw1467.pp svneol=native#text/plain
 tests/webtbf/tw1483.pp svneol=native#text/plain
@@ -9050,6 +9078,7 @@ tests/webtbs/tw1133.pp svneol=native#text/plain
 tests/webtbs/tw11349.pp svneol=native#text/plain
 tests/webtbs/tw11354.pp svneol=native#text/plain
 tests/webtbs/tw11369.pp svneol=native#text/plain
+tests/webtbs/tw11371.pp svneol=native#text/plain
 tests/webtbs/tw11372.pp svneol=native#text/plain
 tests/webtbs/tw11392.pp svneol=native#text/plain
 tests/webtbs/tw11431.pp svneol=native#text/plain
@@ -9067,6 +9096,7 @@ tests/webtbs/tw11638.pp svneol=native#text/plain
 tests/webtbs/tw11711.pp svneol=native#text/plain
 tests/webtbs/tw11762.pp svneol=native#text/plain
 tests/webtbs/tw11763.pp svneol=native#text/plain
+tests/webtbs/tw11771.pp svneol=native#text/plain
 tests/webtbs/tw11786.pp svneol=native#text/plain
 tests/webtbs/tw11791.pp svneol=native#text/plain
 tests/webtbs/tw1181.pp svneol=native#text/plain
@@ -9133,6 +9163,8 @@ tests/webtbs/tw12894.pp svneol=native#text/plain
 tests/webtbs/tw12942.pp svneol=native#text/plain
 tests/webtbs/tw1295.pp svneol=native#text/plain
 tests/webtbs/tw12985.pp svneol=native#text/plain
+tests/webtbs/tw12987a.pp svneol=native#text/plain
+tests/webtbs/tw12987b.pp svneol=native#text/plain
 tests/webtbs/tw1299.pp svneol=native#text/plain
 tests/webtbs/tw12993.pp svneol=native#text/plain
 tests/webtbs/tw13015.pp svneol=native#text/plain
@@ -9194,12 +9226,19 @@ tests/webtbs/tw14019.pp svneol=native#text/plain
 tests/webtbs/tw14020.pp svneol=native#text/plain
 tests/webtbs/tw14020a.pp svneol=native#text/plain
 tests/webtbs/tw14040.pp svneol=native#text/plain
+tests/webtbs/tw14067.pp svneol=native#text/plain
 tests/webtbs/tw1407.pp svneol=native#text/plain
 tests/webtbs/tw1408.pp svneol=native#text/plain
 tests/webtbs/tw1409.pp svneol=native#text/plain
 tests/webtbs/tw1412.pp svneol=native#text/plain
+tests/webtbs/tw14134.pp svneol=native#text/plain
 tests/webtbs/tw1414.pp svneol=native#text/plain
+tests/webtbs/tw14143.pp svneol=native#text/plain
+tests/webtbs/tw14145.pp svneol=native#text/plain
+tests/webtbs/tw14149.pp svneol=native#text/plain
+tests/webtbs/tw14155.pp svneol=native#text/plain
 tests/webtbs/tw1416.pp svneol=native#text/plain
+tests/webtbs/tw14174.pp svneol=native#text/plain
 tests/webtbs/tw1430.pp svneol=native#text/plain
 tests/webtbs/tw1433.pp svneol=native#text/plain
 tests/webtbs/tw1445.pp svneol=native#text/plain

+ 2 - 2
compiler/arm/cpubase.pas

@@ -354,7 +354,7 @@ unit cpubase;
 
     { Returns the tcgsize corresponding with the size of reg.}
     function reg_cgsize(const reg: tregister) : tcgsize;
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
     function is_calljmp(o:tasmop):boolean;
     procedure inverse_flags(var f: TResFlags);
     function flags_to_cond(const f: TResFlags) : TAsmCond;
@@ -391,7 +391,7 @@ unit cpubase;
       );
 
 
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
       begin
         cgsize2subreg:=R_SUBWHOLE;
       end;

+ 37 - 0
compiler/avr/cgcpu.pas

@@ -368,8 +368,45 @@ unit cgcpu;
        end;
 
 
+     procedure tcgarm.a_load_ref_reg(list : TAsmList; fromsize, tosize : tcgsize;const Ref : treference;reg : tregister);
+       var
+         oppostfix:toppostfix;
+         usedtmpref: treference;
+         tmpreg,tmpreg2 : tregister;
+         so : tshifterop;
+         dir : integer;
+       begin
+         if (TCGSize2Size[FromSize] >= TCGSize2Size[ToSize]) then
+           FromSize := ToSize;
+         case FromSize of
+           { signed integer registers }
+           OS_8:
+             oppostfix:=PF_B;
+           OS_S8:
+             oppostfix:=PF_SB;
+           OS_16:
+             oppostfix:=PF_H;
+           OS_S16:
+             oppostfix:=PF_SH;
+           OS_32,
+           OS_S32:
+             oppostfix:=PF_None;
+           else
+             InternalError(200308297);
+         end;
+         handle_load_store(list,A_LDR,oppostfix,reg,ref);
+
+         if (fromsize=OS_S8) and (tosize = OS_16) then
+           a_load_reg_reg(list,OS_16,OS_32,reg,reg);
+       end;
+
+
      procedure tcgavr.a_load_ref_reg(list : TAsmList; fromsize, tosize : tcgsize;const Ref : treference;reg : tregister);
+       var
+         href : treference;
        begin
+         if (ref.base=R_NO) and (ref.index=R_NO) then
+
        end;
 
 

+ 2 - 2
compiler/avr/cpubase.pas

@@ -332,7 +332,7 @@ unit cpubase;
 
     { Returns the tcgsize corresponding with the size of reg.}
     function reg_cgsize(const reg: tregister) : tcgsize;
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
     procedure inverse_flags(var f: TResFlags);
     function flags_to_cond(const f: TResFlags) : TAsmCond;
     function findreg_by_number(r:Tregister):tregisterindex;
@@ -367,7 +367,7 @@ unit cpubase;
       );
 
 
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
       begin
         cgsize2subreg:=R_SUBWHOLE;
       end;

+ 1 - 0
compiler/avr/cpunode.pas

@@ -36,6 +36,7 @@ unit cpunode;
        }
        ,navradd
        ,navrmat
+       ,navrcnv
        ;
 
 

+ 13 - 1
compiler/avr/navradd.pas

@@ -196,7 +196,18 @@ interface
     function tavraddnode.pass_1 : tnode;
       begin
         result:=inherited pass_1;
-
+{
+        if not(assigned(result)) then
+          begin
+            unsigned:=not(is_signed(left.resultdef)) or
+              not(is_signed(right.resultdef));
+
+            if is_64bit(left.resultdef) and
+              ((nodetype in [equaln,unequaln]) or
+               (unsigned and (nodetype in [ltn,lten,gtn,gten]))
+              ) then
+              expectloc:=LOC_FLAGS;
+          end;
         { handling boolean expressions }
         if not(assigned(result)) and
            (
@@ -205,6 +216,7 @@ interface
              is_dynamic_array(left.resultdef)
            ) then
           expectloc:=LOC_FLAGS;
+}
       end;
 
 

+ 180 - 0
compiler/avr/navrcnv.pas

@@ -0,0 +1,180 @@
+{
+    Copyright (c) 1998-2009 by Florian Klaempfl
+
+    Generate AVR assembler for type converting nodes
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+unit navrcnv;
+
+{$i fpcdefs.inc}
+
+interface
+
+    uses
+      node,ncnv,ncgcnv,defcmp;
+
+    type
+       tarmtypeconvnode = class(tcgtypeconvnode)
+         protected
+         { procedure second_int_to_int;override; }
+         { procedure second_string_to_string;override; }
+         { procedure second_cstring_to_pchar;override; }
+         { procedure second_string_to_chararray;override; }
+         { procedure second_array_to_pointer;override; }
+         { procedure second_pointer_to_array;override; }
+         { procedure second_chararray_to_string;override; }
+         { procedure second_char_to_string;override; }
+         { procedure second_int_to_real;override; }
+         { procedure second_real_to_real;override; }
+         { procedure second_cord_to_pointer;override; }
+         { procedure second_proc_to_procvar;override; }
+         { procedure second_bool_to_int;override; }
+           procedure second_int_to_bool;override;
+         { procedure second_load_smallset;override;  }
+         { procedure second_ansistring_to_pchar;override; }
+         { procedure second_pchar_to_string;override; }
+         { procedure second_class_to_intf;override; }
+         { procedure second_char_to_char;override; }
+       end;
+
+implementation
+
+   uses
+      verbose,globtype,globals,systems,
+      symconst,symdef,aasmbase,aasmtai,aasmdata,
+      defutil,
+      cgbase,cgutils,
+      pass_1,pass_2,procinfo,
+      ncon,ncal,
+      ncgutil,
+      cpubase,aasmcpu,
+      rgobj,tgobj,cgobj,cgcpu;
+
+
+    procedure tarmtypeconvnode.second_int_to_bool;
+      var
+        hregister : tregister;
+        href      : treference;
+        resflags  : tresflags;
+        hlabel,oldTrueLabel,oldFalseLabel : tasmlabel;
+        newsize   : tcgsize;
+      begin
+        {
+        oldTrueLabel:=current_procinfo.CurrTrueLabel;
+        oldFalseLabel:=current_procinfo.CurrFalseLabel;
+        current_asmdata.getjumplabel(current_procinfo.CurrTrueLabel);
+        current_asmdata.getjumplabel(current_procinfo.CurrFalseLabel);
+        secondpass(left);
+        if codegenerror then
+         exit;
+
+        { Explicit typecasts from any ordinal type to a boolean type }
+        { must not change the ordinal value                          }
+        if (nf_explicit in flags) and
+           not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then
+          begin
+             location_copy(location,left.location);
+             newsize:=def_cgsize(resultdef);
+             { change of size? change sign only if location is LOC_(C)REGISTER? Then we have to sign/zero-extend }
+             if (tcgsize2size[newsize]<>tcgsize2size[left.location.size]) or
+                ((newsize<>left.location.size) and (location.loc in [LOC_REGISTER,LOC_CREGISTER])) then
+               location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
+             else
+               location.size:=newsize;
+             current_procinfo.CurrTrueLabel:=oldTrueLabel;
+             current_procinfo.CurrFalseLabel:=oldFalseLabel;
+             exit;
+          end;
+
+        { Load left node into flag F_NE/F_E }
+        resflags:=F_NE;
+        case left.location.loc of
+          LOC_CREFERENCE,
+          LOC_REFERENCE :
+            begin
+              if left.location.size in [OS_64,OS_S64] then
+               begin
+                 hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
+                 cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_32,OS_32,left.location.reference,hregister);
+                 href:=left.location.reference;
+                 inc(href.offset,4);
+                 tcgarm(cg).cgsetflags:=true;
+                 cg.a_op_ref_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,href,hregister);
+                 tcgarm(cg).cgsetflags:=false;
+               end
+              else
+               begin
+                 location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true);
+                 tcgarm(cg).cgsetflags:=true;
+                 cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,left.location.size,left.location.register,left.location.register);
+                 tcgarm(cg).cgsetflags:=false;
+               end;
+            end;
+          LOC_FLAGS :
+            begin
+              resflags:=left.location.resflags;
+            end;
+          LOC_REGISTER,LOC_CREGISTER :
+            begin
+              if left.location.size in [OS_64,OS_S64] then
+               begin
+                 hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
+                 cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_32,OS_32,left.location.register64.reglo,hregister);
+                 tcgarm(cg).cgsetflags:=true;
+                 cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,left.location.register64.reghi,hregister);
+                 tcgarm(cg).cgsetflags:=false;
+               end
+              else
+               begin
+                 tcgarm(cg).cgsetflags:=true;
+                 cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,left.location.size,left.location.register,left.location.register);
+                 tcgarm(cg).cgsetflags:=false;
+               end;
+            end;
+          LOC_JUMP :
+            begin
+              hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
+              current_asmdata.getjumplabel(hlabel);
+              cg.a_label(current_asmdata.CurrAsmList,current_procinfo.CurrTrueLabel);
+              cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_INT,1,hregister);
+              cg.a_jmp_always(current_asmdata.CurrAsmList,hlabel);
+              cg.a_label(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
+              cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_INT,0,hregister);
+              cg.a_label(current_asmdata.CurrAsmList,hlabel);
+              tcgarm(cg).cgsetflags:=true;
+              cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_INT,hregister,hregister);
+              tcgarm(cg).cgsetflags:=false;
+            end;
+          else
+            internalerror(200311301);
+        end;
+        { load flags to register }
+        location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
+        location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
+        cg.g_flags2reg(current_asmdata.CurrAsmList,location.size,resflags,location.register);
+        if (is_cbool(resultdef)) then
+          cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,location.size,location.register,location.register);
+        current_procinfo.CurrTrueLabel:=oldTrueLabel;
+        current_procinfo.CurrFalseLabel:=oldFalseLabel;
+        }
+      end;
+
+
+begin
+  ctypeconvnode:=tarmtypeconvnode;
+end.

+ 4 - 3
compiler/cgbase.pas

@@ -289,8 +289,6 @@ interface
             'LOC_CONST',
             'LOC_JUMP',
             'LOC_FLAGS',
-            'LOC_CREF',
-            'LOC_REF',
             'LOC_REG',
             'LOC_CREG',
             'LOC_FPUREG',
@@ -302,7 +300,10 @@ interface
             'LOC_SSETREG',
             'LOC_CSSETREG',
             'LOC_SSETREF',
-            'LOC_CSSETREF');
+            'LOC_CSSETREF',
+            'LOC_CREF',
+            'LOC_REF'
+            );
 
     var
        mms_movescalar : pmmshuffle;

+ 4 - 4
compiler/cgobj.pas

@@ -638,7 +638,7 @@ implementation
       begin
         if not assigned(rg[R_INTREGISTER]) then
           internalerror(200312122);
-        result:=rg[R_INTREGISTER].getregister(list,cgsize2subreg(size));
+        result:=rg[R_INTREGISTER].getregister(list,cgsize2subreg(R_INTREGISTER,size));
       end;
 
 
@@ -646,7 +646,7 @@ implementation
       begin
         if not assigned(rg[R_FPUREGISTER]) then
           internalerror(200312123);
-        result:=rg[R_FPUREGISTER].getregister(list,cgsize2subreg(size));
+        result:=rg[R_FPUREGISTER].getregister(list,cgsize2subreg(R_FPUREGISTER,size));
       end;
 
 
@@ -654,7 +654,7 @@ implementation
       begin
         if not assigned(rg[R_MMREGISTER]) then
           internalerror(2003121214);
-        result:=rg[R_MMREGISTER].getregister(list,cgsize2subreg(size));
+        result:=rg[R_MMREGISTER].getregister(list,cgsize2subreg(R_MMREGISTER,size));
       end;
 
 
@@ -675,7 +675,7 @@ implementation
       var
         subreg:Tsubregister;
       begin
-        subreg:=cgsize2subreg(size);
+        subreg:=cgsize2subreg(getregtype(reg),size);
         result:=reg;
         setsubreg(result,subreg);
         { notify RA }

+ 2 - 0
compiler/cgutils.pas

@@ -39,7 +39,9 @@ unit cgutils;
          offset      : aint;
          symbol,
          relsymbol   : tasmsymbol;
+{$if defined(x86) or defined(m68k)}
          segment,
+{$endif defined(x86) or defined(m68k)}
          base,
          index       : tregister;
          refaddr     : trefaddr;

+ 49 - 57
compiler/dbgdwarf.pas

@@ -1611,50 +1611,53 @@ implementation
         else
           current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
 
-        if (target_info.system in systems_darwin) then
+        { On Darwin, dwarf info is not linked in the final binary,
+          but kept in the individual object files. This allows for
+          faster linking, but means that you have to keep the object
+          files for debugging and also that gdb only loads in the
+          debug info of a particular object file once you step into
+          or over a procedure in it.
+
+          To solve this, there is a tool called dsymutil which can
+          extract all the dwarf info from a program's object files.
+          This utility however performs "smart linking" on the dwarf
+          info and throws away all unreferenced dwarf entries. Since
+          variables' types always point to the dwarfino for a tdef
+          and never to that for a typesym, this means all debug
+          entries generated for typesyms are thrown away.
+
+          The problem with that is that we translate typesyms into
+          DW_TAG_typedef, and gdb's dwarf-2 reader only makes types
+          globally visibly if they are defined using a DW_TAG_typedef.
+          So as a result, before running dsymutil types only become
+          available once you stepped into/over a function in the object
+          file where they are declared, and after running dsymutil they
+          are all gone (printng variables still works because the
+          tdef dwarf info is still available, but you cannot typecast
+          anything outside the declaring units because the type names
+          are not known there).
+
+          The solution: if a tdef has an associated typesym, let the
+          debug label for the tdef point to a DW_TAG_typedef instead
+          of directly to the tdef itself. And don't write anything
+          special for the typesym itself.
+
+          Update: we now also do this for other platforms, because
+          otherwise if you compile unit A without debug info and
+          use one of its types in unit B, then no typedef will be
+          generated and hence gdb will not be able to give a definition
+          of the type.
+        }
+        if assigned(def.typesym) and
+           not(df_generic in def.defoptions) then
           begin
-            { On Darwin, dwarf info is not linked in the final binary,
-              but kept in the individual object files. This allows for
-              faster linking, but means that you have to keep the object
-              files for debugging and also that gdb only loads in the
-              debug info of a particular object file once you step into
-              or over a procedure in it.
-
-              To solve this, there is a tool called dsymutil which can
-              extract all the dwarf info from a program's object files.
-              This utility however performs "smart linking" on the dwarf
-              info and throws away all unreferenced dwarf entries. Since
-              variables' types always point to the dwarfino for a tdef
-              and never to that for a typesym, this means all debug
-              entries generated for typesyms are thrown away.
-
-              The problem with that is that we translate typesyms into
-              DW_TAG_typedef, and gdb's dwarf-2 reader only makes types
-              globally visibly if they are defined using a DW_TAG_typedef.
-              So as a result, before running dsymutil types only become
-              available once you stepped into/over a function in the object
-              file where they are declared, and after running dsymutil they
-              are all gone (printng variables still works because the
-              tdef dwarf info is still available, but you cannot typecast
-              anything outside the declaring units because the type names
-              are not known there).
-
-              The solution: if a tdef has an associated typesym, let the
-              debug label for the tdef point to a DW_TAG_typedef instead
-              of directly to the tdef itself. And don't write anything
-              special for the typesym itself.
-            }
-          if assigned(def.typesym) and
-             not(df_generic in def.defoptions) then
-            begin
-              current_asmdata.getaddrlabel(TAsmLabel(pointer(labsym)));
-              append_entry(DW_TAG_typedef,false,[
-                DW_AT_name,DW_FORM_string,symname(def.typesym)+#0
-              ]);
-              append_labelentry_ref(DW_AT_type,labsym);
-              finish_entry;
-              current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
-            end;
+            current_asmdata.getaddrlabel(TAsmLabel(pointer(labsym)));
+            append_entry(DW_TAG_typedef,false,[
+              DW_AT_name,DW_FORM_string,symname(def.typesym)+#0
+            ]);
+            append_labelentry_ref(DW_AT_type,labsym);
+            finish_entry;
+            current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
           end;
       end;
 
@@ -2260,20 +2263,9 @@ implementation
 
     procedure TDebugInfoDwarf.appendsym_type(list:TAsmList;sym: ttypesym);
       begin
-        if not (target_info.system in systems_darwin) then
-          begin
-            if not(df_generic in sym.typedef.defoptions) then
-              begin
-                append_entry(DW_TAG_typedef,false,[
-                  DW_AT_name,DW_FORM_string,symname(sym)+#0
-                ]);
-                append_labelentry_ref(DW_AT_type,def_dwarf_lab(sym.typedef));
-              end;
-            finish_entry;
-          end
-        else
-          { just queue the def if needed }
-          def_dwarf_lab(sym.typedef);
+        { just queue the def if needed, beforeappenddef will
+          emit the typedef if necessary }
+        def_dwarf_lab(sym.typedef);
       end;
 
 

+ 12 - 9
compiler/gendef.pas

@@ -111,7 +111,6 @@ begin
   {$I-}
   if ioresult<>0 then
    exit;
-{$ifdef i386}
   case target_info.system of
     system_i386_Os2, system_i386_emx:
       begin
@@ -125,15 +124,19 @@ begin
         writeln(t,'STACKSIZE'#9+tostr(stacksize));
         writeln(t,'HEAPSIZE'#9+tostr(heapsize));
       end;
-  system_i386_win32, system_i386_wdosx :
-    begin
-      if description<>'' then
-        writeln(t,'DESCRIPTION '+''''+description+'''');
-      if dllversion<>'' then
-        writeln(t,'VERSION '+dllversion);
-    end;
+    system_i386_win32,
+    system_x86_64_win64,
+    system_ia64_win64,
+    system_arm_wince,
+    system_i386_wince,
+    system_i386_wdosx :
+      begin
+        if description<>'' then
+          writeln(t,'DESCRIPTION '+''''+description+'''');
+        if dllversion<>'' then
+          writeln(t,'VERSION '+dllversion);
+      end;
   end;
-{$endif}
 
 {write imports}
   if not importlist.empty then

+ 2 - 1
compiler/htypechk.pas

@@ -122,7 +122,8 @@ interface
         (tok:_ASSIGNMENT;nod:assignn;op_overloading_supported:true), { unary overloading supported }
         (tok:_UNEQUAL ;nod:unequaln;op_overloading_supported:false)   { binary overloading NOT supported  overload = instead }
       );
-    const
+
+      { true, if we are parsing stuff which allows array constructors }
       allow_array_constructor : boolean = false;
 
     function node2opstr(nt:tnodetype):string;

+ 3 - 3
compiler/i386/cpupara.pas

@@ -360,9 +360,9 @@ unit cpupara;
                p.funcretloc[side].loc:=LOC_REGISTER;
                p.funcretloc[side].size:=retcgsize;
                if side=callerside then
-                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(retcgsize))
+                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(R_INTREGISTER,retcgsize))
                else
-                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(retcgsize));
+                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(R_INTREGISTER,retcgsize));
              end;
           end;
       end;
@@ -576,7 +576,7 @@ unit cpupara;
                             paraloc:=hp.paraloc[side].add_location;
                             paraloc^.size:=paracgsize;
                             paraloc^.loc:=LOC_REGISTER;
-                            paraloc^.register:=newreg(R_INTREGISTER,parasupregs[parareg],cgsize2subreg(paracgsize));
+                            paraloc^.register:=newreg(R_INTREGISTER,parasupregs[parareg],cgsize2subreg(R_INTREGISTER,paracgsize));
                             inc(parareg);
                           end;
                       end

+ 2 - 2
compiler/m68k/cpubase.pas

@@ -328,7 +328,7 @@ unit cpubase;
 
     procedure inverse_flags(var r : TResFlags);
     function  flags_to_cond(const f: TResFlags) : TAsmCond;
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
     function reg_cgsize(const reg: tregister): tcgsize;
 
     function findreg_by_number(r:Tregister):tregisterindex;
@@ -407,7 +407,7 @@ implementation
         flags_to_cond := flags2cond[f];
       end;
 
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
       var p: pointer;
       begin
         case s of

+ 2 - 2
compiler/m68k/cpupara.pas

@@ -247,9 +247,9 @@ unit cpupara;
                p.funcretloc[side].loc:=LOC_REGISTER;
                p.funcretloc[side].size:=retcgsize;
                if side=callerside then
-                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(retcgsize))
+                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(R_INTREGISTER,retcgsize))
                else
-                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(retcgsize));
+                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(R_INTREGISTER,retcgsize));
              end;
           end;
       end;

+ 22 - 14
compiler/msg/errore.msg

@@ -366,7 +366,7 @@ scan_w_multiple_main_name_overrides=02086_W_Overriding name of "main" procedure
 #
 # Parser
 #
-# 03261 is the last used one
+# 03262 is the last used one
 #
 % \section{Parser messages}
 % This section lists all parser messages. The parser takes care of the
@@ -1181,43 +1181,51 @@ parser_e_field_not_allowed_here=03251_E_Fields cannot appear after a method or p
 % without starting a new visibility section (such as \var{public}, \var{private}, etc.). The reason is
 % that otherwise the source code can appear ambiguous to the compiler, since it is possible to use modifiers
 % such as \var{default} and \var{register} also as field names.
-parser_e_objc_requires_msgstr=03252_E_Objective-C messages require their Objective-C selector name to be specified using the "message" directive.
+parser_e_no_local_para_def=03252_E_Parameters cannot contain local type definitions. Use a separate type definition in a type block.
+% In Pascal, types are not considered to be identical simply because they are semantically equivalent.
+% Two variables or parameters are only considered to be of the same type if they refer to the
+% same type definition.
+% As a result, it is not allowed to define new types inside parameter lists, because then it is impossible to
+% refer to the same type definition in the procedure headers of the interface and implementation of a unit
+% (both procedure headers would define a separate type). Keep in mind that expressions such as
+% ``file of byte'' or ``string[50]'' also define a new type.
+parser_e_objc_requires_msgstr=03253_E_Objective-C messages require their Objective-C selector name to be specified using the "message" directive.
 % Objective-C messages require their Objective-C name (selector name) to be specified using the \var{message `someName:'} procedure directive.
 % While bindings to other languages automatically generate such names based on the identifier you use (by replacing
 % all underscores with colons), this is unsafe since nothing prevents an Objective-C method name to contain actual
 % colons.
-parser_e_objc_no_constructor_destructor=03253_E_Objective-C does not have formal constructors nor destructors. Use the alloc, initXXX and dealloc messages.
+parser_e_objc_no_constructor_destructor=03254_E_Objective-C does not have formal constructors nor destructors. Use the alloc, initXXX and dealloc messages.
 % The Objective-C language does not have any constructors or destructors. While there are some messages with a similar
 % purpose (such as \var{init} and \var{dealloc}), these cannot be identified using automatic parsers and do not
 % guarantee anything like Pascal constructors/destructors (e.g., you have to take care of only calling ``designated''
 % inherited ``constructors''). For these reasons, we have opted to follow the standard Objective-C patterns for
 % instance creation/destruction.
-parser_e_message_string_too_long=03254_E_Message name is too long (max. 255 characters)
+parser_e_message_string_too_long=03255_E_Message name is too long (max. 255 characters)
 % Due to compiler implementation reasons, message names are currently limited to 255 characters.
-parser_e_objc_message_name_too_long=03255_E_Objective-C message symbol name for "$1" is too long
+parser_e_objc_message_name_too_long=03256_E_Objective-C message symbol name for "$1" is too long
 % Due to compiler implementation reasons, mangled message names (i.e., the symbol names used in the assembler
 % code) are currently limited to 255 characters.
-parser_h_no_objc_parent=03256_H_Defining a new Objective-C root class. To derive from another root class (e.g., NSObject), specify it as the parent class.
+parser_h_no_objc_parent=03257_H_Defining a new Objective-C root class. To derive from another root class (e.g., NSObject), specify it as the parent class.
 % If no parent class is specified for an Object Pascal class, then it automatically derives from TObject.
 % Objective-C classes however do not automatically derive from NSObject, because one can have multiple
 % root classes in Objective-C. For example, in the Cocoa framework both NSObject and NSProxy are root classes.
 % Therefore, you have to explicitly define a parent class (such as NSObject) if you want to derive your
 % Objective-C class from it.
-parser_e_no_objc_published=03257_E_Objective-C classes cannot have published sections.
+parser_e_no_objc_published=03258_E_Objective-C classes cannot have published sections.
 % In Object Pascal, ``published'' determines whether or not RTTI is generated. Since the Objective-C runtime always needs
 % RTTI for everything, this specified does not make sense for Objective-C classes.
-parser_f_need_objc=03258_F_This module requires an Objective-C mode switch to be compiled
+parser_f_need_objc=03259_F_This module requires an Objective-C mode switch to be compiled
 % This error indicates the use of Objective-C language features without an Objective-C mode switch
 % active. Enable one via the -M command line switch, or the {\$modeswitch x} directive.
-parser_e_must_use_override_objc=03259_E_Inherited methods can only be overridden in Objective-C, add ``override''.
-parser_h_should_use_override_objc=03260_H_Inherited methods can only be overridden in Objective-C, add ``override''.
+parser_e_must_use_override_objc=03260_E_Inherited methods can only be overridden in Objective-C, add ``override''.
+parser_h_should_use_override_objc=03261_H_Inherited methods can only be overridden in Objective-C, add ``override''.
 % It is not possible to ``reintroduce'' methods in Objective-C like in Object Pascal. Methods with the same
 % name always map to the same virtual method entry. In order to make this clear in the source code,
 % the compiler always requires the ``override'' directive to be specified when implementing overriding
 % Objective-C methods in Pascal. If the implementation is external, this rule is relaxed because Objective-C
 % does not have any ``override''-style keyword (since it's the default and only behaviour in that language),
 % which makes it hard for automated header conversion tools to include it everywhere.
-parser_e_objc_message_name_changed=03261_E_Message name "$1" in inherited class is different from message name "$2" in current class.
+parser_e_objc_message_name_changed=03262_E_Message name "$1" in inherited class is different from message name "$2" in current class.
 % An overriding Objective-C method cannot have a different message name than an inherited method. The reason
 % is that these message names uniquely define the message to the Objective-C runtime, which means that
 % giving them a different message name breaks the ``override'' semantics.
@@ -2476,8 +2484,8 @@ option_usage=11000_O_$1 [options] <inputfile> [options]
 % This section lists errors that occur when the compiler is processing the
 % command line or handling the configuration files.
 % \begin{description}
-option_only_one_source_support=11001_W_Only one source file supported
-% You can specify only one source file on the command line. The first
+option_only_one_source_support=11001_W_Only one source file supported, changing source file to compile from "$1" into "$2"
+% You can specify only one source file on the command line. The last
 % one will be compiled, others will be ignored. This may indicate that
 % you forgot a \var{'-'} sign.
 option_def_only_for_os2=11002_W_DEF file can be created only for OS/2
@@ -2988,7 +2996,7 @@ P*2WX_Enable executable stack (Linux)
 **2Xm_Generate link map
 **2XM<x>_Set the name of the 'main' program routine (default is 'main')
 **2XP<x>_Prepend the binutils names with the prefix <x>
-**2Xr<x>_Set library search path to <x> (needed for cross compile) (BeOS, Linux)
+**2Xr<x>_Set the linker's rlink-path to <x> (needed for cross compile, see the ld manual for more information) (BeOS, Linux)
 **2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD, Linux, Mac OS, Solaris)
 **2Xs_Strip all symbols from executable
 **2XS_Try to link units statically (default, defines FPC_LINK_STATIC)

+ 13 - 12
compiler/msgidx.inc

@@ -339,16 +339,17 @@ const
   parser_e_forward_mismatch=03249;
   parser_n_ignore_lower_visibility=03250;
   parser_e_field_not_allowed_here=03251;
-  parser_e_objc_requires_msgstr=03252;
-  parser_e_objc_no_constructor_destructor=03253;
-  parser_e_message_string_too_long=03254;
-  parser_e_objc_message_name_too_long=03255;
-  parser_h_no_objc_parent=03256;
-  parser_e_no_objc_published=03257;
-  parser_f_need_objc=03258;
-  parser_e_must_use_override_objc=03259;
-  parser_h_should_use_override_objc=03260;
-  parser_e_objc_message_name_changed=03261;
+  parser_e_no_local_para_def=03252;
+  parser_e_objc_requires_msgstr=03253;
+  parser_e_objc_no_constructor_destructor=03254;
+  parser_e_message_string_too_long=03255;
+  parser_e_objc_message_name_too_long=03256;
+  parser_h_no_objc_parent=03257;
+  parser_e_no_objc_published=03258;
+  parser_f_need_objc=03259;
+  parser_e_must_use_override_objc=03260;
+  parser_h_should_use_override_objc=03261;
+  parser_e_objc_message_name_changed=03262;
   type_e_mismatch=04000;
   type_e_incompatible_types=04001;
   type_e_not_equal_types=04002;
@@ -800,9 +801,9 @@ const
   option_info=11024;
   option_help_pages=11025;
 
-  MsgTxtSize = 52451;
+  MsgTxtSize = 52654;
 
   MsgIdxMax : array[1..20] of longint=(
-    24,87,262,89,65,51,108,22,202,62,
+    24,87,263,89,65,51,108,22,202,62,
     47,20,1,1,1,1,1,1,1,1
   );

+ 354 - 354
compiler/msgtxt.inc

@@ -1,7 +1,7 @@
 {$ifdef Delphi}
-const msgtxt : array[0..000218] of string[240]=(
+const msgtxt : array[0..000219] of string[240]=(
 {$else Delphi}
-const msgtxt : array[0..000218,1..240] of char=(
+const msgtxt : array[0..000219,1..240] of char=(
 {$endif Delphi}
   '01000_T_Compiler: $1'#000+
   '01001_D_Compiler OS: $1'#000+
@@ -391,548 +391,550 @@ const msgtxt : array[0..000218,1..240] of char=(
   'ass $3 ($4)'#000+
   '03251','_E_Fields cannot appear after a method or property definition, '+
   'start a new visibility section first'#000+
-  '03252_E_Objective-C messages require their Objective-C selector name t'+
-  'o be specified using the "message" directive.'#000+
-  '03253_E_Objective-C does',' not have formal constructors nor destructor'+
-  's. Use the alloc, initXXX and dealloc messages.'#000+
-  '03254_E_Message name is too long (max. 255 characters)'#000+
-  '03255_E_Objective-C message symbol name for "$1" is too long'#000+
-  '03256_H_Defining a new Objective','-C root class. To derive from anothe'+
-  'r root class (e.g., NSObject), specify it as the parent class.'#000+
-  '03257_E_Objective-C classes cannot have published sections.'#000+
-  '03258_F_This module requires an Objective-C mode switch to be compiled'+
+  '03252_E_Parameters cannot contain local type definitions. Use a separa'+
+  'te type definition in a type block.'#000+
+  '03253_E_Objective-C messages requi','re their Objective-C selector name'+
+  ' to be specified using the "message" directive.'#000+
+  '03254_E_Objective-C does not have formal constructors nor destructors.'+
+  ' Use the alloc, initXXX and dealloc messages.'#000+
+  '03255_E_Message name is too long (max. 255',' characters)'#000+
+  '03256_E_Objective-C message symbol name for "$1" is too long'#000+
+  '03257_H_Defining a new Objective-C root class. To derive from another '+
+  'root class (e.g., NSObject), specify it as the parent class.'#000+
+  '03258_E_Objective-C classes cannot ','have published sections.'#000+
+  '03259_F_This module requires an Objective-C mode switch to be compiled'+
   #000+
-  '03259_E_In','herited methods can only be overridden in Objective-C, add'+
-  ' ``override'#039#039'.'#000+
-  '03260_H_Inherited methods can only be overridden in Objective-C, add `'+
+  '03260_E_Inherited methods can only be overridden in Objective-C, add `'+
   '`override'#039#039'.'#000+
-  '03261_E_Message name "$1" in inherited class is different from message'+
-  ' name "$2" in ','current class.'#000+
+  '03261_H_Inherited methods can only be overridden in Objective','-C, add'+
+  ' ``override'#039#039'.'#000+
+  '03262_E_Message name "$1" in inherited class is different from message'+
+  ' name "$2" in current class.'#000+
   '04000_E_Type mismatch'#000+
   '04001_E_Incompatible types: got "$1" expected "$2"'#000+
   '04002_E_Type mismatch between "$1" and "$2"'#000+
-  '04003_E_Type identifier expected'#000+
+  '04','003_E_Type identifier expected'#000+
   '04004_E_Variable identifier expected'#000+
-  '04005_E_Integer expression expected, b','ut got "$1"'#000+
+  '04005_E_Integer expression expected, but got "$1"'#000+
   '04006_E_Boolean expression expected, but got "$1"'#000+
   '04007_E_Ordinal expression expected'#000+
-  '04008_E_pointer type expected, but got "$1"'#000+
+  '04008_E_pointer type expected, but g','ot "$1"'#000+
   '04009_E_class type expected, but got "$1"'#000+
   '04011_E_Can'#039't evaluate constant expression'#000+
-  '04012_E_Set e','lements are not compatible'#000+
+  '04012_E_Set elements are not compatible'#000+
   '04013_E_Operation not implemented for sets'#000+
-  '04014_W_Automatic type conversion from floating type to COMP which is '+
-  'an integer type'#000+
+  '04014_W_Automatic type conversion from floating type to COMP whi','ch i'+
+  's an integer type'#000+
   '04015_H_use DIV instead to get an integer result'#000+
-  '04016_E_string types doesn'#039't match,',' because of $V+ mode'#000+
+  '04016_E_string types doesn'#039't match, because of $V+ mode'#000+
   '04017_E_succ or pred on enums with assignments not possible'#000+
   '04018_E_Can'#039't read or write variables of this type'#000+
-  '04019_E_Can'#039't use readln or writeln on typed file'#000+
+  '04','019_E_Can'#039't use readln or writeln on typed file'#000+
   '04020_E_Can'#039't use read or write on untyped file.'#000+
-  '04021_E_T','ype conflict between set elements'#000+
+  '04021_E_Type conflict between set elements'#000+
   '04022_W_lo/hi(dword/qword) returns the upper/lower word/dword'#000+
-  '04023_E_Integer or real expression expected'#000+
+  '04023_E_Integer or real expression exp','ected'#000+
   '04024_E_Wrong type "$1" in array constructor'#000+
-  '04025_E_Incompatible type for arg no. $1: Got "$2", exp','ected "$3"'#000+
+  '04025_E_Incompatible type for arg no. $1: Got "$2", expected "$3"'#000+
   '04026_E_Method (variable) and Procedure (variable) are not compatible'#000+
-  '04027_E_Illegal constant passed to internal math function'#000+
+  '04027_E_Illegal constant passed to internal math func','tion'#000+
   '04028_E_Can'#039't take the address of constant expressions'#000+
   '04029_E_Argument can'#039't be assigned to'#000+
-  '04030_E_','Can'#039't assign local procedure/function to procedure varia'+
-  'ble'#000+
+  '04030_E_Can'#039't assign local procedure/function to procedure variabl'+
+  'e'#000+
   '04031_E_Can'#039't assign values to an address'#000+
-  '04032_E_Can'#039't assign values to const variable'#000+
+  '04032_E_Can'#039't assign values to c','onst variable'#000+
   '04033_E_Array type required'#000+
   '04034_E_interface type expected, but got "$1"'#000+
-  '04035_H_Mixing sig','ned expressions and longwords gives a 64bit result'+
-  #000+
+  '04035_H_Mixing signed expressions and longwords gives a 64bit result'#000+
   '04036_W_Mixing signed expressions and cardinals here may cause a range'+
-  ' check error'#000+
+  ' check error'#000,
   '04037_E_Typecast has different size ($1 -> $2) in assignment'#000+
-  '04038_E_enums with assignments can'#039't be used ','as array index'#000+
+  '04038_E_enums with assignments can'#039't be used as array index'#000+
   '04039_E_Class or Object types "$1" and "$2" are not related'#000+
   '04040_W_Class types "$1" and "$2" are not related'#000+
-  '04041_E_Class or interface type expected, but got "$1"'#000+
+  '04041_E_C','lass or interface type expected, but got "$1"'#000+
   '04042_E_Type "$1" is not completely defined'#000+
-  '04043_W_String l','iteral has more characters than short string length'#000+
+  '04043_W_String literal has more characters than short string length'#000+
   '04044_W_Comparison is always false due to range of values'#000+
-  '04045_W_Comparison is always true due to range of values'#000+
+  '04045_W_Comparison is al','ways true due to range of values'#000+
   '04046_W_Constructing a class "$1" with abstract method "$2"'#000+
-  '04047_H_The l','eft operand of the IN operator should be byte sized'#000+
+  '04047_H_The left operand of the IN operator should be byte sized'#000+
   '04048_W_Type size mismatch, possible loss of data / range check error'#000+
-  '04049_H_Type size mismatch, possible loss of data / range check error'#000+
-  '04050_E_The address of an abstract method can'#039't ','be taken'#000+
+  '04049_H_Type',' size mismatch, possible loss of data / range check erro'+
+  'r'#000+
+  '04050_E_The address of an abstract method can'#039't be taken'#000+
   '04051_E_Assignments to formal parameters and open arrays are not possi'+
   'ble'#000+
   '04052_E_Constant Expression expected'#000+
-  '04053_E_Operation "$1" not supported for types "$2" and "$3"'#000+
+  '04053_E_Operat','ion "$1" not supported for types "$2" and "$3"'#000+
   '04054_E_Illegal type conversion: "$1" to "$2"'#000+
-  '04055_H_Conve','rsion between ordinals and pointers is not portable'#000+
+  '04055_H_Conversion between ordinals and pointers is not portable'#000+
   '04056_W_Conversion between ordinals and pointers is not portable'#000+
-  '04057_E_Can'#039't determine which overloaded function to call'#000+
+  '04057_E_Can'#039't det','ermine which overloaded function to call'#000+
   '04058_E_Illegal counter variable'#000+
-  '04059_W_Converting constant real',' value to double for C variable argu'+
-  'ment, add explicit typecast to prevent this.'#000+
-  '04060_E_Class or COM interface type expected, but got "$1"'#000+
+  '04059_W_Converting constant real value to double for C variable argume'+
+  'nt, add explicit typecast to prevent this.'#000+
+  '04060_E_Class or COM interface type expected, but got',' "$1"'#000+
   '04061_E_Constant packed arrays are not yet supported'#000+
-  '04062_E_Incompatible type for arg no. $1: Got "','$2" expected "(Bit)Pa'+
-  'cked Array"'#000+
+  '04062_E_Incompatible type for arg no. $1: Got "$2" expected "(Bit)Pack'+
+  'ed Array"'#000+
   '04063_E_Incompatible type for arg no. $1: Got "$2" expected "(not pack'+
   'ed) Array"'#000+
-  '04064_E_Elements of packed arrays cannot be of a type which need to be'+
-  ' initialised'#000+
-  '04065_E_Constant packed records and objects',' are not yet supported'#000+
+  '04064_E_Elements of ','packed arrays cannot be of a type which need to '+
+  'be initialised'#000+
+  '04065_E_Constant packed records and objects are not yet supported'#000+
   '04066_W_Arithmetic "$1" on untyped pointer is unportable to {$T+}, sug'+
   'gest typecast'#000+
-  '04076_E_Can'#039't take address of a subroutine marked as local'#000+
+  '04076_E_Can'#039't take address ','of a subroutine marked as local'#000+
   '04077_E_Can'#039't export subroutine marked as local from a unit'#000+
-  '04078_E_Type i','s not automatable: "$1"'#000+
+  '04078_E_Type is not automatable: "$1"'#000+
   '04079_H_Converting the operands to "$1" before doing the add could pre'+
   'vent overflow errors.'#000+
-  '04080_H_Converting the operands to "$1" before doing the subtract coul'+
-  'd prevent overflow errors.'#000+
-  '04081_H_Converting the oper','ands to "$1" before doing the multiply co'+
+  '04080_H_Converting',' the operands to "$1" before doing the subtract co'+
   'uld prevent overflow errors.'#000+
-  '04082_W_Converting pointers to signed integers may result in wrong com'+
-  'parison results and range errors, use an unsigned type instead.'#000+
-  '04083_E_Interface type $1 has no val','id GUID'#000+
+  '04081_H_Converting the operands to "$1" before doing the multiply coul'+
+  'd prevent overflow errors.'#000+
+  '04082_W_Converting pointers to signed integers may result in wro','ng c'+
+  'omparison results and range errors, use an unsigned type instead.'#000+
+  '04083_E_Interface type $1 has no valid GUID'#000+
   '04084_E_Invalid selector name'#000+
   '04085_E_Expected Objective-C method, but got $1'#000+
-  '04086_E_Expected Objective-C method or constant method name'#000+
+  '04086_E_Expected Objective-C method or constant ','method name'#000+
   '04087_E_No type info available for this type'#000+
-  '04088_E_Objective-C protocol type expected, but g','ot "$1"'#000+
+  '04088_E_Objective-C protocol type expected, but got "$1"'#000+
   '05000_E_Identifier not found "$1"'#000+
   '05001_F_Internal Error in SymTableStack()'#000+
   '05002_E_Duplicate identifier "$1"'#000+
-  '05003_H_Identifier already defined in $1 at line $2'#000+
+  '05003_H_Identifi','er already defined in $1 at line $2'#000+
   '05004_E_Unknown identifier "$1"'#000+
-  '05005_E_Forward declaration not solved',' "$1"'#000+
+  '05005_E_Forward declaration not solved "$1"'#000+
   '05007_E_Error in type definition'#000+
   '05009_E_Forward type not resolved "$1"'#000+
-  '05010_E_Only static variables can be used in static methods or outside'+
-  ' methods'#000+
+  '05010_E_Only static variables can be used in static meth','ods or outsi'+
+  'de methods'#000+
   '05012_F_record or class type expected'#000+
-  '05013_E_Instances of classes or objects with ','an abstract method are '+
-  'not allowed'#000+
+  '05013_E_Instances of classes or objects with an abstract method are no'+
+  't allowed'#000+
   '05014_W_Label not defined "$1"'#000+
   '05015_E_Label used but not defined "$1"'#000+
-  '05016_E_Illegal label declaration'#000+
+  '05016_E_Illegal label declar','ation'#000+
   '05017_E_GOTO and LABEL are not supported (use switch -Sg)'#000+
   '05018_E_Label not found'#000+
-  '05019_E_identifier',' isn'#039't a label'#000+
+  '05019_E_identifier isn'#039't a label'#000+
   '05020_E_label already defined'#000+
   '05021_E_illegal type declaration of set elements'#000+
-  '05022_E_Forward class definition not resolved "$1"'#000+
+  '05022_E_Forward class definition not res','olved "$1"'#000+
   '05023_H_Unit "$1" not used in $2'#000+
   '05024_H_Parameter "$1" not used'#000+
-  '05025_N_Local variable "$1" no','t used'#000+
+  '05025_N_Local variable "$1" not used'#000+
   '05026_H_Value parameter "$1" is assigned but never used'#000+
   '05027_N_Local variable "$1" is assigned but never used'#000+
-  '05028_H_Local $1 "$2" is not used'#000+
+  '05028_H_Local $1',' "$2" is not used'#000+
   '05029_N_Private field "$1.$2" is never used'#000+
-  '05030_N_Private field "$1.$2" is assigned bu','t never used'#000+
+  '05030_N_Private field "$1.$2" is assigned but never used'#000+
   '05031_N_Private method "$1.$2" never used'#000+
   '05032_E_Set type expected'#000+
   '05033_W_Function result does not seem to be set'#000+
-  '05034_W_Type "$1" is not aligned correctly in current record for C'#000+
-  '05035_E_Unknown record field identifier "$1"',#000+
+  '05034','_W_Type "$1" is not aligned correctly in current record for C'#000+
+  '05035_E_Unknown record field identifier "$1"'#000+
   '05036_W_Local variable "$1" does not seem to be initialized'#000+
   '05037_W_Variable "$1" does not seem to be initialized'#000+
-  '05038_E_identifier idents no member "$1"'#000+
+  '05038_E_identifier ','idents no member "$1"'#000+
   '05039_H_Found declaration: $1'#000+
   '05040_E_Data element too large'#000+
-  '05042_E_No matching imp','lementation for interface method "$1" found'#000+
+  '05042_E_No matching implementation for interface method "$1" found'#000+
   '05043_W_Symbol "$1" is deprecated'#000+
   '05044_W_Symbol "$1" is not portable'#000+
-  '05055_W_Symbol "$1" is not implemented'#000+
+  '05055_W_Symbol "$1" ','is not implemented'#000+
   '05056_E_Can'#039't create unique type from this type'#000+
-  '05057_H_Local variable "$1" does not se','em to be initialized'#000+
+  '05057_H_Local variable "$1" does not seem to be initialized'#000+
   '05058_H_Variable "$1" does not seem to be initialized'#000+
-  '05059_W_Function result variable does not seem to initialized'#000+
+  '05059_W_Function result variable does not seem to initializ','ed'#000+
   '05060_H_Function result variable does not seem to be initialized'#000+
-  '05061_W_Variable "$1" read but nowhere',' assigned'#000+
+  '05061_W_Variable "$1" read but nowhere assigned'#000+
   '05062_H_Found abstract method: $1'#000+
   '05063_W_Symbol "$1" is experimental'#000+
-  '05064_W_Forward declaration "$1" not resolved, assumed external'#000+
+  '05064_W_Forward declaration "$1" not resolved, assumed',' external'#000+
   '06009_E_Parameter list size exceeds 65535 bytes'#000+
   '06012_E_File types must be var parameters'#000+
-  '06013_','E_The use of a far pointer isn'#039't allowed there'#000+
+  '06013_E_The use of a far pointer isn'#039't allowed there'#000+
   '06015_E_EXPORT declared functions can'#039't be called'#000+
-  '06016_W_Possible illegal call of constructor or destructor'#000+
+  '06016_W_Possible illegal call of cons','tructor or destructor'#000+
   '06017_N_Inefficient code'#000+
   '06018_W_unreachable code'#000+
-  '06020_E_Abstract methods can'#039't be ','called directly'#000+
+  '06020_E_Abstract methods can'#039't be called directly'#000+
   '06027_DL_Register $1 weight $2 $3'#000+
   '06029_DL_Stack frame is omitted'#000+
   '06031_E_Object or class methods can'#039't be inline.'#000+
-  '06032_E_Procvar calls cannot be inline.'#000+
+  '060','32_E_Procvar calls cannot be inline.'#000+
   '06033_E_No code for inline procedure stored'#000+
-  '06035_E_Element zero of a','n ansi/wide- or longstring can'#039't be acc'+
-  'essed, use (set)length instead'#000+
-  '06037_E_Constructors or destructors can not be called inside a '#039'wi'+
-  'th'#039' clause'#000+
+  '06035_E_Element zero of an ansi/wide- or longstring can'#039't be acces'+
+  'sed, use (set)length instead'#000+
+  '06037_E_Constructors or destructors can not be called inside a '#039,'w'+
+  'ith'#039' clause'#000+
   '06038_E_Cannot call message handler methods directly'#000+
-  '06039_E_Jump in or outside of an excepti','on block'#000+
+  '06039_E_Jump in or outside of an exception block'#000+
   '06040_E_Control flow statements aren'#039't allowed in a finally block'#000+
   '06041_W_Parameters size exceeds limit for certain cpu'#039's'#000+
-  '06042_W_Local variable size exceed limit for certain cpu'#039's'#000+
-  '06043_E_Local variables size exceeds supported lim','it'#000+
+  '060','42_W_Local variable size exceed limit for certain cpu'#039's'#000+
+  '06043_E_Local variables size exceeds supported limit'#000+
   '06044_E_BREAK not allowed'#000+
   '06045_E_CONTINUE not allowed'#000+
   '06046_F_Unknown compilerproc "$1". Check if you use the correct run ti'+
-  'me library.'#000+
+  'me lib','rary.'#000+
   '06047_F_Cannot find system type "$1". Check if you use the correct run'+
   ' time library.'#000+
-  '06048_H_Inherit','ed call to abstract method ignored'#000+
+  '06048_H_Inherited call to abstract method ignored'#000+
   '06049_E_Goto label "$1" not defined or optimized away'#000+
-  '06050_F_Cannot find type "$1" in unit "$2". Check if you use the corre'+
-  'ct run time library.'#000+
+  '06050_F_Cannot find type "$1" in unit "$2". C','heck if you use the cor'+
+  'rect run time library.'#000+
   '07000_DL_Starting $1 styled assembler parsing'#000+
-  '07001_DL_Finis','hed $1 styled assembler parsing'#000+
+  '07001_DL_Finished $1 styled assembler parsing'#000+
   '07002_E_Non-label pattern contains @'#000+
   '07004_E_Error building record offset'#000+
-  '07005_E_OFFSET used without identifier'#000+
+  '07005_E_OFFSET used without ','identifier'#000+
   '07006_E_TYPE used without identifier'#000+
   '07007_E_Cannot use local variable or parameters here'#000+
-  '07008','_E_need to use OFFSET here'#000+
+  '07008_E_need to use OFFSET here'#000+
   '07009_E_need to use $ here'#000+
   '07010_E_Cannot use multiple relocatable symbols'#000+
-  '07011_E_Relocatable symbol can only be added'#000+
+  '07011_E_Relocatable symbol can o','nly be added'#000+
   '07012_E_Invalid constant expression'#000+
   '07013_E_Relocatable symbol is not allowed'#000+
-  '07014_E_Invalid',' reference syntax'#000+
+  '07014_E_Invalid reference syntax'#000+
   '07015_E_You can not reach $1 from that code'#000+
   '07016_E_Local symbols/labels aren'#039't allowed as references'#000+
-  '07017_E_Invalid base and index register usage'#000+
+  '07017_E_Invali','d base and index register usage'#000+
   '07018_W_Possible error in object field handling'#000+
-  '07019_E_Wrong scale factor',' specified'#000+
+  '07019_E_Wrong scale factor specified'#000+
   '07020_E_Multiple index register usage'#000+
   '07021_E_Invalid operand type'#000+
   '07022_E_Invalid string as opcode operand: $1'#000+
-  '07023_W_@CODE and @DATA not supported'#000+
+  '07023_W_@CO','DE and @DATA not supported'#000+
   '07024_E_Null label references are not allowed'#000+
-  '07025_E_Divide by zero in asm eva','luator'#000+
+  '07025_E_Divide by zero in asm evaluator'#000+
   '07026_E_Illegal expression'#000+
   '07027_E_escape sequence ignored: $1'#000+
   '07028_E_Invalid symbol reference'#000+
-  '07029_W_Fwait can cause emulation problems with emu387'#000+
+  '07029_W_Fwait can cause emulati','on problems with emu387'#000+
   '07030_W_$1 without operand translated into $1P'#000+
-  '07031_W_ENTER instruction is not su','pported by Linux kernel'#000+
+  '07031_W_ENTER instruction is not supported by Linux kernel'#000+
   '07032_W_Calling an overload function in assembler'#000+
   '07033_E_Unsupported symbol type for operand'#000+
-  '07034_E_Constant value out of bounds'#000+
+  '07034_E_Constant',' value out of bounds'#000+
   '07035_E_Error converting decimal $1'#000+
   '07036_E_Error converting octal $1'#000+
-  '07037_E_Error c','onverting binary $1'#000+
+  '07037_E_Error converting binary $1'#000+
   '07038_E_Error converting hexadecimal $1'#000+
   '07039_H_$1 translated to $2'#000+
-  '07040_W_$1 is associated to an overloaded function'#000+
+  '07040_W_$1 is associated to an overloaded func','tion'#000+
   '07041_E_Cannot use SELF outside a method'#000+
   '07042_E_Cannot use OLDEBP outside a nested procedure'#000+
-  '07043_W','_Procedures can'#039't return any value in asm code'#000+
+  '07043_W_Procedures can'#039't return any value in asm code'#000+
   '07044_E_SEG not supported'#000+
-  '07045_E_Size suffix and destination or source size do not match'#000+
+  '07045_E_Size suffix and destination or source size do not mat','ch'#000+
   '07046_W_Size suffix and destination or source size do not match'#000+
   '07047_E_Assembler syntax error'#000+
-  '07048_E_','Invalid combination of opcode and operands'#000+
+  '07048_E_Invalid combination of opcode and operands'#000+
   '07049_E_Assembler syntax error in operand'#000+
   '07050_E_Assembler syntax error in constant'#000+
-  '07051_E_Invalid String expression'#000+
+  '07051_','E_Invalid String expression'#000+
   '07052_W_constant with symbol $1 for address which is not on a pointer'#000+
-  '07053_E_','Unrecognized opcode $1'#000+
+  '07053_E_Unrecognized opcode $1'#000+
   '07054_E_Invalid or missing opcode'#000+
   '07055_E_Invalid combination of prefix and opcode: $1'#000+
-  '07056_E_Invalid combination of override and opcode: $1'#000+
+  '07056_E_Invalid combinat','ion of override and opcode: $1'#000+
   '07057_E_Too many operands on line'#000+
   '07058_W_NEAR ignored'#000+
-  '07059_W_FAR ignored'#000,
+  '07059_W_FAR ignored'#000+
   '07060_E_Duplicate local symbol $1'#000+
   '07061_E_Undefined local symbol $1'#000+
   '07062_E_Unknown label identifier $1'#000+
-  '07063_E_Invalid register name'#000+
+  '07063_E_Invalid register name'#000,
   '07064_E_Invalid floating point register name'#000+
   '07066_W_Modulo not supported'#000+
-  '07067_E_Invalid floating point c','onstant $1'#000+
+  '07067_E_Invalid floating point constant $1'#000+
   '07068_E_Invalid floating point expression'#000+
   '07069_E_Wrong symbol type'#000+
-  '07070_E_Cannot index a local var or parameter with a register'#000+
+  '07070_E_Cannot index a local var or parameter with a re','gister'#000+
   '07071_E_Invalid segment override expression'#000+
   '07072_W_Identifier $1 supposed external'#000+
-  '07073_E_Strings',' not allowed as constants'#000+
+  '07073_E_Strings not allowed as constants'#000+
   '07074_No type of variable specified'#000+
   '07075_E_assembler code not returned to text section'#000+
-  '07076_E_Not a directive or local symbol $1'#000+
+  '07076_E_Not a direct','ive or local symbol $1'#000+
   '07077_E_Using a defined name as a local label'#000+
-  '07078_E_Dollar token is used without ','an identifier'#000+
+  '07078_E_Dollar token is used without an identifier'#000+
   '07079_W_32bit constant created for address'#000+
   '07080_N_.align is target specific, use .balign or .p2align'#000+
-  '07081_E_Can'#039't access fields directly for parameters'#000+
+  '07081_E_Can'#039't acce','ss fields directly for parameters'#000+
   '07082_E_Can'#039't access fields of objects/classes directly'#000+
-  '07083_E_No size ','specified and unable to determine the size of the op'+
-  'erands'#000+
+  '07083_E_No size specified and unable to determine the size of the oper'+
+  'ands'#000+
   '07084_E_Cannot use RESULT in this function'#000+
-  '07086_W_"$1" without operand translated into "$1 %st,%st(1)"'#000+
+  '07086_W_"$1" without operand tra','nslated into "$1 %st,%st(1)"'#000+
   '07087_W_"$1 %st(n)" translated into "$1 %st,%st(n)"'#000+
-  '07088_W_"$1 %st(n)" trans','lated into "$1 %st(n),%st"'#000+
+  '07088_W_"$1 %st(n)" translated into "$1 %st(n),%st"'#000+
   '07089_E_Char < not allowed here'#000+
   '07090_E_Char > not allowed here'#000+
   '07093_W_ALIGN not supported'#000+
-  '07094_E_Inc and Dec cannot be together'#000+
+  '07094_E_Inc and',' Dec cannot be together'#000+
   '07095_E_Invalid reglist for movem'#000+
   '07096_E_Reglist invalid for opcode'#000+
-  '07097_E_Highe','r cpu mode required ($1)'#000+
+  '07097_E_Higher cpu mode required ($1)'#000+
   '07098_W_No size specified and unable to determine the size of the oper'+
   'ands, using DWORD as default'#000+
-  '07099_E_Syntax error while trying to parse a shifter operand'#000+
-  '07100_E_Address of packed component is not at a byte bo','undary'#000+
+  '07099_E_Sy','ntax error while trying to parse a shifter operand'#000+
+  '07100_E_Address of packed component is not at a byte boundary'#000+
   '07101_W_No size specified and unable to determine the size of the oper'+
   'ands, using BYTE as default'#000+
-  '07102_W_Use of +offset(%ebp) for parameters invalid here'#000+
+  '07102_W_Use of +offset(%ebp) ','for parameters invalid here'#000+
   '07103_W_Use of +offset(%ebp) is not compatible with regcall convention'+
   #000+
-  '07104_W','_Use of -offset(%ebp) is not recommended for local variable a'+
-  'ccess'#000+
-  '07105_W_Use of -offset(%esp), access may cause a crash or value may be'+
-  ' lost'#000+
+  '07104_W_Use of -offset(%ebp) is not recommended for local variable acc'+
+  'ess'#000+
+  '07105_W_Use of -offset(%esp), access may cause a crash or value may',' '+
+  'be lost'#000+
   '07106_E_VMTOffset must be used in combination with a virtual method, a'+
   'nd "$1" is not virtual'#000+
-  '0710','7_E_Generating PIC, but reference is not PIC-safe'#000+
+  '07107_E_Generating PIC, but reference is not PIC-safe'#000+
   '08000_F_Too many assembler files'#000+
   '08001_F_Selected assembler output not supported'#000+
-  '08002_F_Comp not supported'#000+
+  '080','02_F_Comp not supported'#000+
   '08003_F_Direct not support for binary writers'#000+
-  '08004_E_Allocating of data is only a','llowed in bss section'#000+
+  '08004_E_Allocating of data is only allowed in bss section'#000+
   '08005_F_No binary writer selected'#000+
   '08006_E_Asm: Opcode $1 not in table'#000+
-  '08007_E_Asm: $1 invalid combination of opcode and operands'#000+
+  '08007_E_Asm: $1 invalid combination of opc','ode and operands'#000+
   '08008_E_Asm: 16 Bit references not supported'#000+
   '08009_E_Asm: Invalid effective address'#000+
-  '08010','_E_Asm: Immediate or reference expected'#000+
+  '08010_E_Asm: Immediate or reference expected'#000+
   '08011_E_Asm: $1 value exceeds bounds $2'#000+
   '08012_E_Asm: Short jump is out of range $1'#000+
-  '08013_E_Asm: Undefined label $1'#000+
+  '08013_E_Asm',': Undefined label $1'#000+
   '08014_E_Asm: Comp type not supported for this target'#000+
-  '08015_E_Asm: Extended type not s','upported for this target'#000+
+  '08015_E_Asm: Extended type not supported for this target'#000+
   '08016_E_Asm: Duplicate label $1'#000+
   '08017_E_Asm: Redefined label $1'#000+
   '08018_E_Asm: First defined here'#000+
-  '08019_E_Asm: Invalid register $1'#000+
+  '08019_E_Asm: ','Invalid register $1'#000+
   '08020_E_Asm: 16 or 32 Bit references not supported'#000+
-  '08021_E_Asm: 64 Bit operands not su','pported'#000+
+  '08021_E_Asm: 64 Bit operands not supported'#000+
   '09000_W_Source operating system redefined'#000+
   '09001_I_Assembling (pipe) $1'#000+
   '09002_E_Can'#039't create assembler file: $1'#000+
-  '09003_E_Can'#039't create object file: $1'#000+
+  '09003_E_Can'#039't c','reate object file: $1'#000+
   '09004_E_Can'#039't create archive file: $1'#000+
-  '09005_E_Assembler $1 not found, switching to e','xternal assembling'#000+
+  '09005_E_Assembler $1 not found, switching to external assembling'#000+
   '09006_T_Using assembler: $1'#000+
   '09007_E_Error while assembling exitcode $1'#000+
-  '09008_E_Can'#039't call the assembler, error $1 switching to external a'+
-  'ssembling'#000+
+  '09008_E_Can'#039't call the assembler, error $1 s','witching to external'+
+  ' assembling'#000+
   '09009_I_Assembling $1'#000+
   '09010_I_Assembling with smartlinking $1'#000+
-  '09011_W_Obje','ct $1 not found, Linking may fail !'#000+
+  '09011_W_Object $1 not found, Linking may fail !'#000+
   '09012_W_Library $1 not found, Linking may fail !'#000+
   '09013_E_Error while linking'#000+
-  '09014_E_Can'#039't call the linker, switching to external linking'#000+
+  '09014_E_Can'#039't call th','e linker, switching to external linking'#000+
   '09015_I_Linking $1'#000+
-  '09016_E_Util $1 not found, switching to externa','l linking'#000+
+  '09016_E_Util $1 not found, switching to external linking'#000+
   '09017_T_Using util $1'#000+
   '09018_E_Creation of Executables not supported'#000+
-  '09019_E_Creation of Dynamic/Shared Libraries not supported'#000+
+  '09019_E_Creation of Dynamic/Shared Libraries not support','ed'#000+
   '09020_I_Closing script $1'#000+
   '09021_E_resource compiler "$1" not found, switching to external mode'#000+
-  '09022_I_','Compiling resource $1'#000+
+  '09022_I_Compiling resource $1'#000+
   '09023_T_unit $1 can'#039't be statically linked, switching to smart lin'+
   'king'#000+
-  '09024_T_unit $1 can'#039't be smart linked, switching to static linking'+
-  #000+
+  '09024_T_unit $1 can'#039't be smart linked, sw','itching to static linki'+
+  'ng'#000+
   '09025_T_unit $1 can'#039't be shared linked, switching to static linkin'+
   'g'#000+
-  '09026_E_unit',' $1 can'#039't be smart or static linked'#000+
+  '09026_E_unit $1 can'#039't be smart or static linked'#000+
   '09027_E_unit $1 can'#039't be shared or static linked'#000+
-  '09028_D_Calling resource compiler "$1" with "$2" as command line'#000+
+  '09028_D_Calling resource compiler "$1" with "$2" ','as command line'#000+
   '09029_E_Error while compiling resources'#000+
-  '09030_E_Can'#039't call the resource compiler "$1", swi','tching to exte'+
-  'rnal mode'#000+
+  '09030_E_Can'#039't call the resource compiler "$1", switching to extern'+
+  'al mode'#000+
   '09031_E_Can'#039't open resource file "$1"'#000+
   '09032_E_Can'#039't write resource file "$1"'#000+
-  '09128_F_Can'#039't post process executable $1'#000+
+  '09128_F_Can'#039't post process execut','able $1'#000+
   '09129_F_Can'#039't open executable $1'#000+
   '09130_X_Size of Code: $1 bytes'#000+
-  '09131_X_Size of initialized data: ','$1 bytes'#000+
+  '09131_X_Size of initialized data: $1 bytes'#000+
   '09132_X_Size of uninitialized data: $1 bytes'#000+
   '09133_X_Stack space reserved: $1 bytes'#000+
   '09134_X_Stack space committed: $1 bytes'#000+
-  '09200_F_Executable image size is too big for $1 target.'#000+
-  '09201_W_Object file "$1" contains 32-bit absolute r','elocation to symb'+
-  'ol "$2".'#000+
+  '0','9200_F_Executable image size is too big for $1 target.'#000+
+  '09201_W_Object file "$1" contains 32-bit absolute relocation to symbol'+
+  ' "$2".'#000+
   '10000_T_Unitsearch: $1'#000+
   '10001_T_PPU Loading $1'#000+
   '10002_U_PPU Name: $1'#000+
   '10003_U_PPU Flags: $1'#000+
-  '10004_U_PPU Crc: $1'#000+
+  '10004_U_PPU Crc: $1',#000+
   '10005_U_PPU Time: $1'#000+
   '10006_U_PPU File too short'#000+
   '10007_U_PPU Invalid Header (no PPU at the begin)'#000+
-  '10008_U_','PPU Invalid Version $1'#000+
+  '10008_U_PPU Invalid Version $1'#000+
   '10009_U_PPU is compiled for another processor'#000+
   '10010_U_PPU is compiled for an other target'#000+
-  '10011_U_PPU Source: $1'#000+
+  '10011_U_PPU Source: $','1'#000+
   '10012_U_Writing $1'#000+
   '10013_F_Can'#039't Write PPU-File'#000+
   '10014_F_Error reading PPU-File'#000+
-  '10015_F_unexpected end of',' PPU-File'#000+
+  '10015_F_unexpected end of PPU-File'#000+
   '10016_F_Invalid PPU-File entry: $1'#000+
   '10017_F_PPU Dbx count problem'#000+
   '10018_E_Illegal unit name: $1'#000+
   '10019_F_Too much units'#000+
-  '10020_F_Circular unit reference between $1 and $2'#000+
+  '10020_','F_Circular unit reference between $1 and $2'#000+
   '10021_F_Can'#039't compile unit $1, no sources available'#000+
-  '10022_F_Ca','n'#039't find unit $1 used by $2'#000+
+  '10022_F_Can'#039't find unit $1 used by $2'#000+
   '10023_W_Unit $1 was not found but $2 exists'#000+
   '10024_F_Unit $1 searched but $2 found'#000+
-  '10025_W_Compiling the system unit requires the -Us switch'#000+
+  '10025_W_Compiling the sy','stem unit requires the -Us switch'#000+
   '10026_F_There were $1 errors compiling module, stopping'#000+
-  '10027_U_Load fro','m $1 ($2) unit $3'#000+
+  '10027_U_Load from $1 ($2) unit $3'#000+
   '10028_U_Recompiling $1, checksum changed for $2'#000+
   '10029_U_Recompiling $1, source found only'#000+
-  '10030_U_Recompiling unit, static lib is older than ppufile'#000+
+  '10030_U_Recompiling unit, ','static lib is older than ppufile'#000+
   '10031_U_Recompiling unit, shared lib is older than ppufile'#000+
-  '10032_U_Recomp','iling unit, obj and asm are older than ppufile'#000+
+  '10032_U_Recompiling unit, obj and asm are older than ppufile'#000+
   '10033_U_Recompiling unit, obj is older than asm'#000+
   '10034_U_Parsing interface of $1'#000+
-  '10035_U_Parsing implementation of $1'#000+
+  '10035_U','_Parsing implementation of $1'#000+
   '10036_U_Second load for unit $1'#000+
   '10037_U_PPU Check file $1 time $2'#000+
-  '10040_W_Ca','n'#039't recompile unit $1, but found modifed include files'+
-  #000+
+  '10040_W_Can'#039't recompile unit $1, but found modifed include files'#000+
   '10041_U_File $1 is newer than PPU file $2'#000+
-  '10042_U_Trying to use a unit which was compiled with a different FPU m'+
-  'ode'#000+
+  '10042_U_Trying to use a unit which wa','s compiled with a different FPU'+
+  ' mode'#000+
   '10043_U_Loading interface units from $1'#000+
-  '10044_U_Loading implementatio','n units from $1'#000+
+  '10044_U_Loading implementation units from $1'#000+
   '10045_U_Interface CRC changed for unit $1'#000+
   '10046_U_Implementation CRC changed for unit $1'#000+
-  '10047_U_Finished compiling unit $1'#000+
+  '10047_U_Finished compiling un','it $1'#000+
   '10048_U_Add dependency of $1 to $2'#000+
   '10049_U_No reload, is caller: $1'#000+
-  '10050_U_No reload, already in se','cond compile: $1'#000+
+  '10050_U_No reload, already in second compile: $1'#000+
   '10051_U_Flag for reload: $1'#000+
   '10052_U_Forced reloading'#000+
   '10053_U_Previous state of $1: $2'#000+
-  '10054_U_Already compiling $1, setting second compile'#000+
+  '10054_U_Already compiling $1, s','etting second compile'#000+
   '10055_U_Loading unit $1'#000+
   '10056_U_Finished loading unit $1'#000+
-  '10057_U_Registering new uni','t $1'#000+
+  '10057_U_Registering new unit $1'#000+
   '10058_U_Re-resolving unit $1'#000+
   '10059_U_Skipping re-resolving unit $1, still loading used units'#000+
-  '10060_U_Unloading resource unit $1 (not needed)'#000+
+  '10060_U_Unloading resource unit $1 (','not needed)'#000+
   '10061_E_Unit $1 was compiled using a different whole program optimizat'+
-  'ion feedback input ($2, ','$3); recompile it without wpo or use the sam'+
-  'e wpo feedback input file for this compilation invocation'#000+
-  '11000_O_$1 [options] <inputfile> [options]'#000+
-  '11001_W_Only one source file supported'#000+
+  'ion feedback input ($2, $3); recompile it without wpo or use the same '+
+  'wpo feedback input file for this compilation invocation'#000+
+  '11000_O_$1 [options] <inputfile>',' [options]'#000+
+  '11001_W_Only one source file supported, changing source file to compil'+
+  'e from "$1" into "$2"'#000+
   '11002_W_DEF file can be created only for OS/2'#000+
-  '11003_E_ne','sted response files are not supported'#000+
-  '11004_F_No source file name in command line'#000+
+  '11003_E_nested response files are not supported'#000+
+  '11004_F_No source file name in command line',#000+
   '11005_N_No option inside $1 config file'#000+
   '11006_E_Illegal parameter: $1'#000+
   '11007_H_-? writes help pages'#000+
   '11008_F_Too many config files nested'#000+
-  '11009_F_Unable to open',' file $1'#000+
+  '11009_F_Unable to open file $1'#000+
   '11010_D_Reading further options from $1'#000+
-  '11011_W_Target is already set to: $1'#000+
+  '11011_W_Target is already set to',': $1'#000+
   '11012_W_Shared libs not supported on DOS platform, reverting to static'+
   #000+
   '11013_F_In options file $1 at line $2 too many \var{\#IF(N)DEFs} encou'+
   'ntered'#000+
-  '11014_','F_In options file $1 at line $2 unexpected \var{\#ENDIFs} enco'+
-  'untered'#000+
-  '11015_F_Open conditional at the end of the options file'#000+
+  '11014_F_In options file $1 at line $2 unexpected \var{\#ENDIFs} encoun'+
+  'tered'#000+
+  '11015_F_Ope','n conditional at the end of the options file'#000+
   '11016_W_Debug information generation is not supported by this executab'+
   'le'#000+
   '11017_H_Try recompiling with -dGDB'#000+
-  '11018_','W_You are using the obsolete switch $1'#000+
-  '11019_W_You are using the obsolete switch $1, please use $2'#000+
+  '11018_W_You are using the obsolete switch $1'#000+
+  '11019_W_You are using the obsolete switch ','$1, please use $2'#000+
   '11020_N_Switching assembler to default source writing assembler'#000+
   '11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+
-  '11022_W_"$','1" assembler use forced'#000+
+  '11022_W_"$1" assembler use forced'#000+
   '11026_T_Reading options from file $1'#000+
-  '11027_T_Reading options from environment $1'#000+
+  '11027_T_Reading opti','ons from environment $1'#000+
   '11028_D_Handling option "$1"'#000+
   '11029_O_*** press enter ***'#000+
   '11030_H_Start of reading config file $1'#000+
-  '11031_H_End of reading config file $1'#000,
+  '11031_H_End of reading config file $1'#000+
   '11032_D_interpreting option "$1"'#000+
   '11036_D_interpreting firstpass option "$1"'#000+
-  '11033_D_interpreting file option "$1"'#000+
+  '11033','_D_interpreting file option "$1"'#000+
   '11034_D_Reading config file "$1"'#000+
   '11035_D_found source file name "$1"'#000+
   '11039_E_Unknown code page'#000+
-  '11040_F_Config file $1 is a dir','ectory'#000+
+  '11040_F_Config file $1 is a directory'#000+
   '11041_W_Assembler output selected "$1" cannot generate debug info, deb'+
-  'ugging disabled'#000+
+  'uggi','ng disabled'#000+
   '11042_W_Use of ppc386.cfg is deprecated, please use fpc.cfg instead'#000+
   '11043_F_In options file $1 at line $2 \var{\#ELSE} directive without \'+
-  'var{\#IF(','N)DEF} found'#000+
-  '11044_F_Option "$1" is not, or not yet, supported on the current targe'+
-  't platform'#000+
+  'var{\#IF(N)DEF} found'#000+
+  '11044_F_Option "$1" is not, or not yet, supported on the current tar','g'+
+  'et platform'#000+
   '11045_F_The feature "$1" is not, or not yet, supported on the selected'+
   ' target platform'#000+
-  '11046_N_DWARF debug information cannot be used with smart l','inking on'+
-  ' this target, switching to static linking'#000+
-  '12000_F_Cannot open whole program optimization feedback file "$1"'#000+
+  '11046_N_DWARF debug information cannot be used with smart linking on t'+
+  'his target, switching to static linking'#000+
+  '12000_F_Cannot open whole prog','ram optimization feedback file "$1"'#000+
   '12001_D_Processing whole program optimization information in wpo feedb'+
   'ack file "$1"'#000+
-  '12002_D_Finished processing the whole p','rogram optimization informati'+
-  'on in wpo feedback file "$1"'#000+
-  '12003_E_Expected section header, but got "$2" at line $1 of wpo feedba'+
-  'ck file'#000+
+  '12002_D_Finished processing the whole program optimization information'+
+  ' in wpo feedback file "$1"'#000+
+  '12003_E_Expected sectio','n header, but got "$2" at line $1 of wpo feed'+
+  'back file'#000+
   '12004_W_No handler registered for whole program optimization section "'+
-  '$2" at line $1 of wpo feedback fil','e, ignoring'#000+
-  '12005_D_Found whole program optimization section "$1" with information'+
-  ' about "$2"'#000+
+  '$2" at line $1 of wpo feedback file, ignoring'#000+
+  '12005_D_Found whole program optimization section "$1" with informatio',
+  'n about "$2"'#000+
   '12006_F_The selected whole program optimizations require a previously '+
   'generated feedback file (use -Fw to specify)'#000+
-  '12007_E_No collected informatio','n necessary to perform "$1" whole pro'+
-  'gram optimization found'#000+
-  '12008_F_Specify a whole program optimization feedback file to store th'+
-  'e generated info in (using -FW)'#000+
+  '12007_E_No collected information necessary to perform "$1" whole progr'+
+  'am optimization found'#000+
+  '12008_F_Specify a wh','ole program optimization feedback file to store '+
+  'the generated info in (using -FW)'#000+
   '12009_E_Not generating any whole program optimization information, yet'+
-  ' a feed','back file was specified (using -FW)'#000+
-  '12010_E_Not performing any whole program optimizations, yet an input f'+
-  'eedback file was specified (using -Fw)'#000+
+  ' a feedback file was specified (using -FW)'#000+
+  '12010_E_Not performing any whole program opti','mizations, yet an input'+
+  ' feedback file was specified (using -Fw)'#000+
   '12011_D_Skipping whole program optimization section "$1", because not '+
-  'needed by the requested o','ptimizations'#000+
-  '12012_W_Overriding previously read information for "$1" from feedback '+
-  'input file using information in section "$2"'#000+
+  'needed by the requested optimizations'#000+
+  '12012_W_Overriding previously read information for "$1" from feedbac','k'+
+  ' input file using information in section "$2"'#000+
   '12013_E_Cannot extract symbol liveness information from program when s'+
   'tripping symbols, use -Xs-'#000+
-  '12014_E_Cannot ','extract symbol liveness information from program when'+
-  ' when not linking'#000+
-  '12015_F_Cannot find "$1" or "$2" to extract symbol liveness informatio'+
-  'n from linked program'#000+
+  '12014_E_Cannot extract symbol liveness information from program when w'+
+  'hen not linking'#000+
+  '12015_F_Ca','nnot find "$1" or "$2" to extract symbol liveness informat'+
+  'ion from linked program'#000+
   '12016_E_Error during reading symbol liveness information produced by "'+
   '$1"'#000+
-  '120','17_F_Error executing "$1" (exitcode: $2) to extract symbol inform'+
-  'ation from linked program'#000+
+  '12017_F_Error executing "$1" (exitcode: $2) to extract symbol informat'+
+  'ion from linke','d program'#000+
   '12018_E_Collection of symbol liveness information can only help when u'+
   'sing smart linking, use -CX -XX'#000+
-  '12019_E_Cannot create specified whole program o','ptimisation feedback '+
-  'file "$1"'#000+
-  '11023_Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPC'+
-  'CPU'#010+
+  '12019_E_Cannot create specified whole program optimisation feedback fi'+
+  'le "$1"'#000+
+  '11023_Free Pascal Compiler version $FPCFULLVERSION',' [$FPCDATE] for $F'+
+  'PCCPU'#010+
   'Copyright (c) 1993-2009 by Florian Klaempfl'#000+
   '11024_Free Pascal Compiler version $FPCVERSION'#010+
   #010+
   'Compiler Date      : $FPCDATE'#010+
-  'Compiler CPU ','Target: $FPCCPU'#010+
+  'Compiler CPU Target: $FPCCPU'#010+
   #010+
   'Supported targets:'#010+
   '  $OSTARGETS'#010+
   #010+
-  'Supported CPU instruction sets:'#010+
+  'Supported CPU instruction sets:',#010+
   '  $INSTRUCTIONSETS'#010+
   #010+
   'Supported FPU instruction sets:'#010+
@@ -944,298 +946,296 @@ const msgtxt : array[0..000218,1..240] of char=(
   'Supported Optimizations:'#010+
   '  $OPTIMIZATIONS'#010+
   #010+
-  'Su','pported Whole Program Optimizations:'#010+
+  'Supported Whole Program Optimizations:'#010+
   '  All'#010+
   '  $WPOPTIMIZATIONS'#010+
   #010+
-  'Supported Microcontroller types:'#010+
+  'Supported Microcon','troller types:'#010+
   '  $CONTROLLERTYPES'#010+
   #010+
   'This program comes under the GNU General Public Licence'#010+
   'For more information read COPYING.FPC'#010+
   #010+
-  'Report bugs, suggestions, etc','. to:'#010+
+  'Report bugs, suggestions, etc. to:'#010+
   '                 http://bugs.freepascal.org'#010+
   'or'#010+
-  '                 [email protected]'#000+
+  '                 bugs@freepa','scal.org'#000+
   '11025_**0*_Put + after a boolean switch option to enable it, - to disa'+
   'ble it'#010+
   '**1a_The compiler doesn'#039't delete the generated assembler file'#010+
-  '**2al_List ','sourcecode lines in assembler file'#010+
+  '**2al_List sourcecode lines in assembler file'#010+
   '**2an_List node info in assembler file'#010+
-  '*L2ap_Use pipes instead of creating temporary assembler files'#010+
+  '*L2ap_U','se pipes instead of creating temporary assembler files'#010+
   '**2ar_List register allocation/release info in assembler file'#010+
-  '**2at_List temp allocation/release info in',' assembler file'#010+
+  '**2at_List temp allocation/release info in assembler file'#010+
   '**1A<x>_Output format:'#010+
   '**2Adefault_Use default assembler'#010+
-  '3*2Aas_Assemble using GNU AS'#010+
+  '3*2Aas_A','ssemble using GNU AS'#010+
   '3*2Anasmcoff_COFF (Go32v2) file using Nasm'#010+
   '3*2Anasmelf_ELF32 (Linux) file using Nasm'#010+
   '3*2Anasmwin32_Win32 object file using Nasm'#010+
-  '3*2Anasmwd','osx_Win32/WDOSX object file using Nasm'#010+
+  '3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+
   '3*2Awasm_Obj file using Wasm (Watcom)'#010+
-  '3*2Anasmobj_Obj file using Nasm'#010+
+  '3*2A','nasmobj_Obj file using Nasm'#010+
   '3*2Amasm_Obj file using Masm (Microsoft)'#010+
   '3*2Atasm_Obj file using Tasm (Borland)'#010+
   '3*2Aelf_ELF (Linux) using internal writer'#010+
-  '3*2Acoff_','COFF (Go32v2) using internal writer'#010+
-  '3*2Apecoff_PE-COFF (Win32) using internal writer'#010+
+  '3*2Acoff_COFF (Go32v2) using internal writer'#010+
+  '3*2Apecoff_PE-COFF (Win32) using internal wri','ter'#010+
   '4*2Aas_Assemble using GNU AS'#010+
   '6*2Aas_Unix o-file using GNU AS'#010+
   '6*2Agas_GNU Motorola assembler'#010+
   '6*2Amit_MIT Syntax (old GAS)'#010+
-  '6*2Amot_Standard Motorola assemble','r'#010+
+  '6*2Amot_Standard Motorola assembler'#010+
   'A*2Aas_Assemble using GNU AS'#010+
   'P*2Aas_Assemble using GNU AS'#010+
-  'S*2Aas_Assemble using GNU AS'#010+
+  'S*2Aas_Assemble using',' GNU AS'#010+
   '**1b_Generate browser info'#010+
   '**2bl_Generate local symbol info'#010+
   '**1B_Build all modules'#010+
   '**1C<x>_Code generation options:'#010+
-  '**2Ca<x>_Select ABI, see fpc -i for',' possible values'#010+
+  '**2Ca<x>_Select ABI, see fpc -i for possible values'#010+
   '**2Cb_Generate big-endian code'#010+
-  '**2Cc<x>_Set default calling convention to <x>'#010+
+  '**2Cc<x>_Set default calling conv','ention to <x>'#010+
   '**2CD_Create also dynamic library (not supported)'#010+
   '**2Ce_Compilation with emulated floating point opcodes'#010+
-  '**2Cf<x>_Select fpu instruction set to u','se, see fpc -i for possible '+
-  'values'#010+
-  '**2CF<x>_Minimal floating point constant precision (default, 32, 64)'#010+
+  '**2Cf<x>_Select fpu instruction set to use, see fpc -i for possible va'+
+  'lues'#010+
+  '**2CF<x>_Minimal floating point constant preci','sion (default, 32, 64)'+
+  #010+
   '**2Cg_Generate PIC code'#010+
   '**2Ch<n>_<n> bytes heap (between 1023 and 67107840)'#010+
   '**2Ci_IO-checking'#010+
   '**2Cn_Omit linking stage'#010+
-  '**2Co_Check overf','low of integer operations'#010+
-  '**2CO_Check for possible overflow of integer operations'#010+
+  '**2Co_Check overflow of integer operations'#010+
+  '**2CO_Check for possible overflow of integer operations',#010+
   '**2Cp<x>_Select instruction set, see fpc -i for possible values'#010+
   '**2CP<x>=<y>_ packing settings'#010+
-  '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL',', 2, '+
-  '4 and 8'#010+
+  '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 '+
+  'and 8'#010+
   '**2Cr_Range checking'#010+
   '**2CR_Verify object method call validity'#010+
-  '**2Cs<n>_Set stack checking size to <n>'#010+
+  '**2Cs<','n>_Set stack checking size to <n>'#010+
   '**2Ct_Stack checking (for testing only, see manual)'#010+
   '**2CX_Create also smartlinked library'#010+
   '**1d<x>_Defines the symbol <x>'#010+
-  '**1D','_Generate a DEF file'#010+
+  '**1D_Generate a DEF file'#010+
   '**2Dd<x>_Set description to <x>'#010+
-  '**2Dv<x>_Set DLL version to <x>'#010+
+  '**2Dv<x>_Set DLL version to ','<x>'#010+
   '*O2Dw_PM application'#010+
   '**1e<x>_Set path to executable'#010+
   '**1E_Same as -Cn'#010+
   '**1fPIC_Same as -Cg'#010+
   '**1F<x>_Set file names and paths:'#010+
-  '**2Fa<x>[,y]_(for a program) loa','d units <x> and [y] before uses is p'+
-  'arsed'#010+
+  '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+
+  'sed'#010+
   '**2Fc<x>_Set input codepage to <x>'#010+
-  '**2FC<x>_Set RC compiler binary name to <x>'#010+
+  '**2F','C<x>_Set RC compiler binary name to <x>'#010+
   '**2Fd_Disable the compiler'#039's internal directory cache'#010+
-  '**2FD<x>_Set the directory where to search for compiler utilities',#010+
+  '**2FD<x>_Set the directory where to search for compiler utilities'#010+
   '**2Fe<x>_Redirect error output to <x>'#010+
-  '**2Ff<x>_Add <x> to framework path (Darwin only)'#010+
+  '**2Ff<x>_Add <x> to framework path (Darwin',' only)'#010+
   '**2FE<x>_Set exe/unit output path to <x>'#010+
   '**2Fi<x>_Add <x> to include path'#010+
   '**2Fl<x>_Add <x> to library path'#010+
   '**2FL<x>_Use <x> as dynamic linker'#010+
-  '**2Fm<x>_L','oad unicode conversion table from <x>.txt in the compiler '+
-  'dir'#010+
-  '**2Fo<x>_Add <x> to object path'#010+
+  '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+
+  'r'#010+
+  '**2Fo<x>_Add <x> to',' object path'#010+
   '**2Fr<x>_Load error message file <x>'#010+
   '**2FR<x>_Set resource (.res) linker to <x>'#010+
   '**2Fu<x>_Add <x> to unit path'#010+
-  '**2FU<x>_Set unit output path to <x>',', overrides -FE'#010+
-  '**2FW<x>_Store generated whole-program optimization feedback in <x>'#010+
+  '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+
+  '**2FW<x>_Store generated whole-program optimization feedback in <','x>'#010+
   '**2Fw<x>_Load previously stored whole-program optimization feedback fr'+
   'om <x>'#010+
   '*g1g_Generate debug information (default format for target)'#010+
-  '*g2gc_Generate chec','ks for pointers'#010+
+  '*g2gc_Generate checks for pointers'#010+
   '*g2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+
-  '*g2gl_Use line info unit (show more info with backtraces)'#010+
+  '*','g2gl_Use line info unit (show more info with backtraces)'#010+
   '*g2go<x>_Set debug information options'#010+
-  '*g3godwarfsets_ Enable DWARF set debug information (breaks gdb ','< 6.5'+
-  ')'#010+
+  '*g3godwarfsets_ Enable DWARF set debug information (breaks gdb < 6.5)'#010+
   '*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs'+
   #010+
-  '*g2gp_Preserve case in stabs symbol names'#010+
+  '*g2','gp_Preserve case in stabs symbol names'#010+
   '*g2gs_Generate Stabs debug information'#010+
   '*g2gt_Trash local variables (to detect uninitialized uses)'#010+
-  '*g2gv_Generates progra','ms traceable with Valgrind'#010+
-  '*g2gw_Generate DWARFv2 debug information (same as -gw2)'#010+
+  '*g2gv_Generates programs traceable with Valgrind'#010+
+  '*g2gw_Generate DWARFv2 debug information (same as -gw2',')'#010+
   '*g2gw2_Generate DWARFv2 debug information'#010+
   '*g2gw3_Generate DWARFv3 debug information'#010+
   '**1i_Information'#010+
   '**2iD_Return compiler date'#010+
-  '**2iV_Return short compiler v','ersion'#010+
+  '**2iV_Return short compiler version'#010+
   '**2iW_Return full compiler version'#010+
   '**2iSO_Return compiler OS'#010+
-  '**2iSP_Return compiler host processor'#010+
+  '**2iSP_Return',' compiler host processor'#010+
   '**2iTO_Return target OS'#010+
   '**2iTP_Return target processor'#010+
   '**1I<x>_Add <x> to include path'#010+
   '**1k<x>_Pass <x> to the linker'#010+
-  '**1l_Write logo'#010,
+  '**1l_Write logo'#010+
   '**1M<x>_Set language mode to <x>'#010+
   '**2Mfpc_Free Pascal dialect (default)'#010+
-  '**2Mobjfpc_FPC mode with Object Pascal support'#010+
+  '**2Mobjfpc','_FPC mode with Object Pascal support'#010+
   '**2Mdelphi_Delphi 7 compatibility mode'#010+
   '**2Mtp_TP/BP 7.0 compatibility mode'#010+
-  '**2Mmacpas_Macintosh Pascal dialects compatibil','ity mode'#010+
+  '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
   '**1n_Do not read the default config files'#010+
-  '**1N<x>_Node tree optimizations'#010+
+  '**1N<x>_Node tree optimization','s'#010+
   '**2Nu_Unroll loops'#010+
   '**1o<x>_Change the name of the executable produced to <x>'#010+
   '**1O<x>_Optimizations:'#010+
   '**2O-_Disable optimizations'#010+
-  '**2O1_Level 1 optimizations (','quick and debugger friendly)'#010+
-  '**2O2_Level 2 optimizations (-O1 + quick optimizations)'#010+
+  '**2O1_Level 1 optimizations (quick and debugger friendly)'#010+
+  '**2O2_Level 2 optimizations (-O1 + quick optimizatio','ns)'#010+
   '**2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+
   '**2Oa<x>=<y>_Set alignment'#010+
   '**2Oo[NO]<x>_Enable or disable optimizations, see fpc -i for possible '+
-  'val','ues'#010+
+  'values'#010+
   '**2Op<x>_Set target cpu for optimizing, see fpc -i for possible values'+
   #010+
-  '**2OW<x>_Generate whole-program optimization feedback for optimization'+
-  ' <x>, see fpc -i for possible values'#010+
-  '**2Ow<x>_Perform whole-program optimization <x>, see fpc -','i for poss'+
-  'ible values'#010+
+  '**2OW<','x>_Generate whole-program optimization feedback for optimizati'+
+  'on <x>, see fpc -i for possible values'#010+
+  '**2Ow<x>_Perform whole-program optimization <x>, see fpc -i for possib'+
+  'le values'#010+
   '**2Os_Optimize for size rather than speed'#010+
-  '**1pg_Generate profile code for gprof (defines FPC_PROFILE)'#010+
+  '**1pg_Generate pr','ofile code for gprof (defines FPC_PROFILE)'#010+
   '**1R<x>_Assembler reading style:'#010+
   '**2Rdefault_Use default assembler for target'#010+
   '3*2Ratt_Read AT&T style assembler'#010+
-  '3*2R','intel_Read Intel style assembler'#010+
+  '3*2Rintel_Read Intel style assembler'#010+
   '6*2RMOT_Read motorola style assembler'#010+
-  '**1S<x>_Syntax options:'#010+
+  '**1S<x>_Sy','ntax options:'#010+
   '**2S2_Same as -Mobjfpc'#010+
   '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+
   '**2Sa_Turn on assertions'#010+
   '**2Sd_Same as -Mdelphi'#010+
-  '**2Se<x>_Error options. <','x> is a combination of the following:'#010+
-  '**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
+  '**2Se<x>_Error options. <x> is a combination of the following:'#010+
+  '**3*_<n> : Compiler halts after the <n> err','ors (default is 1)'#010+
   '**3*_w : Compiler also halts after warnings'#010+
   '**3*_n : Compiler also halts after notes'#010+
   '**3*_h : Compiler also halts after hints'#010+
-  '**2Sg_Enable L','ABEL and GOTO (default in -Mtp and -Mdelphi)'#010+
-  '**2Sh_Use ansistrings by default instead of shortstrings'#010+
+  '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)'#010+
+  '**2Sh_Use ansistrings by default ins','tead of shortstrings'#010+
   '**2Si_Turn on inlining of procedures/functions declared as "inline"'#010+
   '**2Sk_Load fpcylix unit'#010+
   '**2SI<x>_Set interface style to <x>'#010+
-  '**3SIcom_C','OM compatible interface (default)'#010+
+  '**3SIcom_COM compatible interface (default)'#010+
   '**3SIcorba_CORBA compatible interface'#010+
-  '**2Sm_Support macros like C (global)'#010+
+  '**2Sm_Sup','port macros like C (global)'#010+
   '**2So_Same as -Mtp'#010+
   '**2Ss_Constructor name must be init (destructor must be done)'#010+
   '**2St_Allow static keyword in objects'#010+
-  '**2Sx_Enable',' exception keywords (default in Delphi/ObjFPC modes)'#010+
-  '**1s_Do not call assembler and linker'#010+
+  '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
+  '**1s_Do not call assembler a','nd linker'#010+
   '**2sh_Generate script to link on host'#010+
   '**2st_Generate script to link on target'#010+
   '**2sr_Skip register allocation phase (use with -alr)'#010+
-  '**1T<x>_Target ope','rating system:'#010+
+  '**1T<x>_Target operating system:'#010+
   '3*2Temx_OS/2 via EMX (including EMX/RSX extender)'#010+
-  '3*2Tfreebsd_FreeBSD'#010+
+  '3*2Tfreebsd_Free','BSD'#010+
   '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+
   '3*2Tlinux_Linux'#010+
   '3*2Tnetbsd_NetBSD'#010+
   '3*2Tnetware_Novell Netware Module (clib)'#010+
-  '3*2Tnetwlibc_Novell Netware Modu','le (libc)'#010+
+  '3*2Tnetwlibc_Novell Netware Module (libc)'#010+
   '3*2Topenbsd_OpenBSD'#010+
   '3*2Tos2_OS/2 / eComStation'#010+
-  '3*2Tsunos_SunOS/Solaris'#010+
+  '3*2Tsunos_SunOS/Solaris'#010,
   '3*2Tsymbian_Symbian OS'#010+
   '3*2Twatcom_Watcom compatible DOS extender'#010+
   '3*2Twdosx_WDOSX DOS extender'#010+
   '3*2Twin32_Windows 32 Bit'#010+
   '3*2Twince_Windows CE'#010+
   '4*2Tlinux_Linux'#010+
-  '6*2','Tamiga_Commodore Amiga'#010+
+  '6*2Tamiga_Commodore Amiga'#010+
   '6*2Tatari_Atari ST/STe/TT'#010+
   '6*2Tlinux_Linux/m68k'#010+
-  '6*2Tmacos_Macintosh m68k (not supported)'#010+
+  '6*2Tmacos_M','acintosh m68k (not supported)'#010+
   '6*2Tpalmos_PalmOS'#010+
   'A*2Tlinux_Linux'#010+
   'A*2Twince_Windows CE'#010+
   'P*2Tamiga_AmigaOS on PowerPC'#010+
   'P*2Tdarwin_Darwin and Mac OS X on PowerPC'#010+
-  'P*2','Tlinux_Linux on PowerPC'#010+
+  'P*2Tlinux_Linux on PowerPC'#010+
   'P*2Tmacos_Mac OS (classic) on PowerPC'#010+
-  'P*2Tmorphos_MorphOS'#010+
+  'P*2Tmorphos_MorphOS',#010+
   'S*2Tlinux_Linux'#010+
   '**1u<x>_Undefines the symbol <x>'#010+
   '**1U_Unit options:'#010+
   '**2Un_Do not check where the unit name matches the file name'#010+
-  '**2Ur_Generate release unit f','iles (never automatically recompiled)'#010+
+  '**2Ur_Generate release unit files (never automatically recompiled)'#010+
   '**2Us_Compile a system unit'#010+
-  '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
+  '**1v<x>_Be verb','ose. <x> is a combination of the following letters:'#010+
   '**2*_e : Show errors (default)       0 : Show nothing (except errors)'#010+
-  '**2*_w : Show warnings               ','u : Show unit info'#010+
-  '**2*_n : Show notes                  t : Show tried/used files'#010+
+  '**2*_w : Show warnings               u : Show unit info'#010+
+  '**2*_n : Show notes                  t : Show tried/used files',#010+
   '**2*_h : Show hints                  c : Show conditionals'#010+
   '**2*_i : Show general info           d : Show debug info'#010+
-  '**2*_l : Show linenumbers            r : R','hide/GCC compatibility mod'+
-  'e'#010+
-  '**2*_s : Show time stamps            q : Show message numbers'#010+
+  '**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode'#010+
+  '**2*_s : Show time stamps            q : Show message',' numbers'#010+
   '**2*_a : Show everything             x : Executable info (Win32 only)'#010+
   '**2*_b : Write file names messages   p : Write tree.log with parse tre'+
   'e'#010+
-  '**2*_   ',' with full path              v : Write fpcdebug.txt with'#010+
-  '**2*_                                    lots of debugging info'#010+
+  '**2*_    with full path              v : Write fpcdebug.txt with'#010+
+  '**2*_                   ','                 lots of debugging info'#010+
   '**2*_m<x>,<y> : Don'#039't show messages numbered <x> and <y>'#010+
   '3*1W<x>_Target-specific options (targets)'#010+
-  'A*1W<x>_Target-speci','fic options (targets)'#010+
+  'A*1W<x>_Target-specific options (targets)'#010+
   'P*1W<x>_Target-specific options (targets)'#010+
-  'p*1W<x>_Target-specific options (targets)'#010+
+  'p*1W<x>_Target-sp','ecific options (targets)'#010+
   '3*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'P*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'p*2Wb_Create a bundle instead ','of a library (Darwin)'#010+
+  'p*2Wb_Create a bundle instead of a library (Darwin)'#010+
   '3*2WB_Create a relocatable image (Windows)'#010+
-  'A*2WB_Create a relocatable image (Windows, Symbian)'#010+
+  'A*2WB_Create a r','elocatable image (Windows, Symbian)'#010+
   '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
   'A*2WC_Specify console type application (Windows)'#010+
-  'P*2WC_Specify ','console type application (Classic Mac OS)'#010+
-  '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
+  'P*2WC_Specify console type application (Classic Mac OS)'#010+
+  '3*2WD_Use DEFFILE to export functions o','f DLL or EXE (Windows)'#010+
   'A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   '3*2We_Use external resources (Darwin)'#010+
-  'P*2We_Use external resources (Darwin',')'#010+
+  'P*2We_Use external resources (Darwin)'#010+
   'p*2We_Use external resources (Darwin)'#010+
-  '3*2WF_Specify full-screen type application (EMX, OS/2)'#010+
+  '3*2WF_Specify full-screen type applicatio','n (EMX, OS/2)'#010+
   '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
   'A*2WG_Specify graphic type application (Windows)'#010+
-  'P*2WG_Specify graphic type applicati','on (Classic Mac OS)'#010+
+  'P*2WG_Specify graphic type application (Classic Mac OS)'#010+
   '3*2Wi_Use internal resources (Darwin)'#010+
-  'P*2Wi_Use internal resources (Darwin)'#010+
+  'P*2Wi_Use internal reso','urces (Darwin)'#010+
   'p*2Wi_Use internal resources (Darwin)'#010+
   '3*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  'A*2WN_Do not generate relocation cod','e, needed for debugging (Windows'+
-  ')'#010+
+  'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   '3*2WR_Generate relocation code (Windows)'#010+
-  'A*2WR_Generate relocation code (Windows)'#010+
+  'A*2WR_','Generate relocation code (Windows)'#010+
   'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   '3*2WX_Enable executable stack (Linux)'#010+
-  'A*2WX_Enable executable stack',' (Linux)'#010+
+  'A*2WX_Enable executable stack (Linux)'#010+
   'p*2WX_Enable executable stack (Linux)'#010+
-  'P*2WX_Enable executable stack (Linux)'#010+
+  'P*2WX_Enable executable stack (Lin','ux)'#010+
   '**1X_Executable options:'#010+
   '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
   'ux)'#010+
-  '**2Xd_Do not use standard library search path (needed fo','r cross comp'+
-  'ile)'#010+
+  '**2Xd_Do not use standard library search path (needed for cross compil'+
+  'e)'#010+
   '**2Xe_Use external linker'#010+
-  '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
-  'to executable'#010+
+  '**2Xg_Create debuginfo in a separate f','ile and add a debuglink sectio'+
+  'n to executable'#010+
   '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
   '**2Xi_Use internal linker'#010+
-  '**2Xm_Generate link',' map'#010+
+  '**2Xm_Generate link map'#010+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   's '#039'main'#039')'#010+
-  '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
-  '**2Xr<x>_Set library search path to <x> (needed for cross compile) (Be'+
-  'OS, Linux)'#010+
-  '**2XR<x>_Prepend <x> to al','l linker search paths (BeOS, Darwin, FreeB'+
+  '**2X','P<x>_Prepend the binutils names with the prefix <x>'#010+
+  '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+
+  'ile, see the ld manual for more information) (BeOS, Linux)'#010+
+  '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, ','FreeB'+
   'SD, Linux, Mac OS, Solaris)'#010+
   '**2Xs_Strip all symbols from executable'#010+
   '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
-  '**2Xt_Link with static libraries (-static is passed to linke','r)'#010+
-  '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
+  '**2Xt_Link with static libraries (-static is passed to linker)'#010+
+  '**2XX_Try to smartlink units      ','       (defines FPC_LINK_SMART)'#010+
   '**1*_'#010+
   '**1?_Show this help'#010+
   '**1h_Shows this help without waiting'

+ 5 - 1
compiler/nadd.pas

@@ -666,7 +666,11 @@ implementation
           begin
              case nodetype of
                 addn :
-                  t:=cstringconstnode.createpchar(concatansistrings(s1,s2,l1,l2),l1+l2);
+                  begin
+                    t:=cstringconstnode.createpchar(concatansistrings(s1,s2,l1,l2),l1+l2);
+                    typecheckpass(t);
+                    tstringconstnode(t).changestringtype(resultdef);
+                  end;
                 ltn :
                   t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<0),booltype,true);
                 lten :

+ 18 - 0
compiler/ncal.pas

@@ -146,6 +146,7 @@ interface
           function  docompare(p: tnode): boolean; override;
           procedure printnodedata(var t:text);override;
           function  para_count:longint;
+          function  required_para_count:longint;
           { checks if there are any parameters which end up at the stack, i.e.
             which have LOC_REFERENCE and set pi_has_stackparameter if this applies }
           procedure check_stack_parameters;
@@ -1249,6 +1250,23 @@ implementation
       end;
 
 
+    function tcallnode.required_para_count: longint;
+      var
+        ppn : tcallparanode;
+      begin
+        result:=0;
+        ppn:=tcallparanode(left);
+        while assigned(ppn) do
+          begin
+            if not(assigned(ppn.parasym) and
+                   ((vo_is_hidden_para in ppn.parasym.varoptions) or
+                    assigned(ppn.parasym.defaultconstsym))) then
+              inc(result);
+            ppn:=tcallparanode(ppn.right);
+          end;
+      end;
+
+
     function tcallnode.is_simple_para_load(p:tnode; may_be_in_reg: boolean):boolean;
       var
         hp : tnode;

+ 1 - 1
compiler/ncgld.pas

@@ -706,7 +706,7 @@ implementation
                   end;
               end
             else
-              internalerror(200204249);
+              internalerror(2002042410);
           end
        { try to reuse memory locations instead of copying }
        { copy to a memory location ... }

+ 1 - 1
compiler/ncnv.pas

@@ -1716,7 +1716,7 @@ implementation
                     a procvar. Because isconvertable cannot check for procedures we
                     use an extra check for them.}
                   if (left.nodetype=calln) and
-                     (tcallnode(left).para_count=0) and
+                     (tcallnode(left).required_para_count=0) and
                      (resultdef.typ=procvardef) and
                      (
                       (m_tp_procvar in current_settings.modeswitches) or

+ 1 - 1
compiler/nld.pas

@@ -837,7 +837,7 @@ implementation
         Do this only if we didn't convert the arrayconstructor yet. This
         is needed for the cases where the resultdef is forced for a second
         run }
-        if (not allow_array_constructor) then
+        if not(allow_array_constructor) then
          begin
            hp:=tarrayconstructornode(getcopy);
            arrayconstructor_to_set(tnode(hp));

+ 1 - 1
compiler/nobj.pas

@@ -831,7 +831,7 @@ implementation
          len:=length(p^.data.messageinf.str^);
          current_asmdata.asmlists[al_globals].concat(tai_const.create_8bit(len));
          getmem(ca,len+1);
-         move(p^.data.messageinf.str[1],ca^,len);
+         move(p^.data.messageinf.str^[1],ca^,len);
          ca[len]:=#0;
          current_asmdata.asmlists[al_globals].concat(Tai_string.Create_pchar(ca,len));
          if assigned(p^.r) then

+ 3 - 1
compiler/options.pas

@@ -1716,6 +1716,8 @@ begin
                   inc(j);
                 end;
              end;
+           else
+             IllegalPara(opt);
          end;
        end;
 
@@ -1728,7 +1730,7 @@ begin
     else
       begin
         if (length(param_file)<>0) then
-          Message(option_only_one_source_support);
+          Message2(option_only_one_source_support,param_file,opt);
         param_file:=opt;
         Message1(option_found_file,opt);
       end;

+ 2 - 1
compiler/parser.pas

@@ -49,7 +49,7 @@ implementation
       script,gendef,
       comphook,
       scanner,scandir,
-      pbase,ptype,psystem,pmodules,psub,ncgrtti,
+      pbase,ptype,psystem,pmodules,psub,ncgrtti,htypechk,
       cresstr,cpuinfo,procinfo;
 
 
@@ -337,6 +337,7 @@ implementation
          named_args_allowed:=false;
          got_addrn:=false;
          getprocvardef:=nil;
+         allow_array_constructor:=false;
 
        { show info }
          Message1(parser_i_compiling,filename);

+ 1 - 1
compiler/pdecobj.pas

@@ -273,7 +273,7 @@ implementation
         if try_to_consume(_LKLAMMER) then
           begin
             { use single_type instead of id_type for specialize support }
-            single_type(hdef,false);
+            single_type(hdef,false,false);
             if (not assigned(hdef)) or
                (hdef.typ<>objectdef) then
               begin

+ 14 - 7
compiler/pdecsub.pas

@@ -480,7 +480,7 @@ implementation
               begin
                 block_type:=bt_var_type;
                 consume(_COLON);
-                single_type(pv.returndef,false);
+                single_type(pv.returndef,false,false);
                 block_type:=bt_var;
               end;
              hdef:=pv;
@@ -519,7 +519,7 @@ implementation
                 else
                  begin
                    { define field type }
-                   single_type(arrayelementdef,false);
+                   single_type(arrayelementdef,false,false);
                    tarraydef(hdef).elementdef:=arrayelementdef;
                  end;
               end
@@ -532,7 +532,7 @@ implementation
                 else
                   begin
                     block_type:=bt_var_type;
-                    single_type(hdef,false);
+                    single_type(hdef,false,false);
                     block_type:=bt_var;
                   end;
 
@@ -919,7 +919,7 @@ implementation
         isclassmethod : boolean;
         locationstr: string;
         old_parse_generic,
-        popclass : boolean;
+        popclass           : boolean;
       begin
         locationstr:='';
         pd:=nil;
@@ -960,7 +960,7 @@ implementation
                              popclass:=true;
                              parse_generic:=(df_generic in pd._class.defoptions);
                            end;
-                         single_type(pd.returndef,false);
+                         single_type(pd.returndef,false,false);
                          if popclass then
                            symtablestack.pop(pd._class.symtable);
                          dec(testcurobject);
@@ -1104,7 +1104,7 @@ implementation
                     end
                   else
                    begin
-                     single_type(pd.returndef,false);
+                     single_type(pd.returndef,false,false);
                      if (optoken in [_EQUAL,_GT,_LT,_GTE,_LTE]) and
                         ((pd.returndef.typ<>orddef) or
                          (torddef(pd.returndef).ordtype<>pasbool)) then
@@ -2349,7 +2349,14 @@ const
                   if assigned(pd._class) then
                    pd.aliasnames.insert(target_info.Cprefix+pd._class.objrealname^+'_'+pd.procsym.realname)
                   else
-                   pd.aliasnames.insert(target_info.Cprefix+pd.procsym.realname);
+                    begin
+                      { Export names are not mangled on Windows and OS/2, see also pexports.pas }
+                      if (target_info.system in (system_all_windows+[system_i386_emx, system_i386_os2])) and
+                        (po_exports in pd.procoptions) then
+                        pd.aliasnames.insert(pd.procsym.realname)
+                      else
+                        pd.aliasnames.insert(target_info.Cprefix+pd.procsym.realname);
+                    end;
                 end;
               pocall_cppdecl :
                 begin

+ 11 - 14
compiler/pdecvar.pas

@@ -324,11 +324,11 @@ implementation
                         { define range and type of range }
                         hdef:=tarraydef.create(0,-1,s32inttype);
                         { define field type }
-                        single_type(arraytype,false);
+                        single_type(arraytype,false,false);
                         tarraydef(hdef).elementdef:=arraytype;
                       end
                     else
-                      single_type(hdef,false);
+                      single_type(hdef,false,false);
                   end
                 else
                   hdef:=cformaltype;
@@ -358,7 +358,7 @@ implementation
          if (token=_COLON) or (paranr>0) or (aclass=nil) then
            begin
               consume(_COLON);
-              single_type(p.propdef,false);
+              single_type(p.propdef,false,false);
               if (idtoken=_INDEX) then
                 begin
                    consume(_INDEX);
@@ -674,7 +674,7 @@ implementation
          { Parse possible "implements" keyword }
          if try_to_consume(_IMPLEMENTS) then
            begin
-             single_type(def,false);
+             single_type(def,false,false);
 
              if not(is_interface(def)) then
                message(parser_e_class_implements_must_be_interface);
@@ -854,18 +854,15 @@ implementation
          try_to_consume(_EXTERNAL) then
         begin
           is_external_var:=true;
-          if not is_cdecl then
+          if (idtoken<>_NAME) and (token<>_SEMICOLON) then
             begin
-              if idtoken<>_NAME then
-                begin
-                  is_dll:=true;
-                  dll_name:=get_stringconst;
-                  if ExtractFileExt(dll_name)='' then
-                    dll_name:=ChangeFileExt(dll_name,target_info.sharedlibext);
-                end;
-              if try_to_consume(_NAME) then
-                C_name:=get_stringconst;
+              is_dll:=true;
+              dll_name:=get_stringconst;
+              if ExtractFileExt(dll_name)='' then
+                dll_name:=ChangeFileExt(dll_name,target_info.sharedlibext);
             end;
+          if not(is_cdecl) and try_to_consume(_NAME) then
+            C_name:=get_stringconst;
           consume(_SEMICOLON);
         end;
 

+ 7 - 4
compiler/pexpr.pas

@@ -39,7 +39,7 @@ interface
     { reads a single factor }
     function factor(getaddr : boolean) : tnode;
 
-    procedure string_dec(var def: tdef);
+    procedure string_dec(var def: tdef; allowtypedef: boolean);
 
     function parse_paras(__colon,__namedpara : boolean;end_of_paras : ttoken) : tnode;
 
@@ -87,7 +87,7 @@ implementation
        { last def found, only used by anon. inherited calls to insert proper type casts }
        srdef : tdef = nil;
 
-    procedure string_dec(var def:tdef);
+    procedure string_dec(var def:tdef; allowtypedef: boolean);
     { reads a string type with optional length }
     { and returns a pointer to the string      }
     { definition                               }
@@ -96,8 +96,11 @@ implementation
       begin
          def:=cshortstringtype;
          consume(_STRING);
-         if try_to_consume(_LECKKLAMMER) then
+         if (token=_LECKKLAMMER) then
            begin
+              if not(allowtypedef) then
+                Message(parser_e_no_local_para_def);
+              consume(_LECKKLAMMER);
               p:=comp_expr(true);
               if not is_constintnode(p) then
                 begin
@@ -2387,7 +2390,7 @@ implementation
 
            _STRING :
              begin
-               string_dec(hdef);
+               string_dec(hdef,true);
                { STRING can be also a type cast }
                if try_to_consume(_LKLAMMER) then
                 begin

+ 2 - 2
compiler/powerpc/cpubase.pas

@@ -395,7 +395,7 @@ uses
     procedure create_cond_imm(BO,BI:byte;var r : TAsmCond);
     procedure create_cond_norm(cond: TAsmCondFlag; cr: byte;var r : TasmCond);
 
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
     { Returns the tcgsize corresponding with the size of reg.}
     function reg_cgsize(const reg: tregister) : tcgsize;
 
@@ -535,7 +535,7 @@ implementation
       end;
 
 
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
       begin
         cgsize2subreg:=R_SUBWHOLE;
       end;

+ 2 - 2
compiler/powerpc/cpupara.pas

@@ -300,9 +300,9 @@ unit cpupara;
                p.funcretloc[side].loc:=LOC_REGISTER;
                p.funcretloc[side].size:=retcgsize;
                if side=callerside then
-                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(retcgsize))
+                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(R_INTREGISTER,retcgsize))
                else
-                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(retcgsize));
+                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(R_INTREGISTER,retcgsize));
              end;
           end;
       end;

+ 2 - 2
compiler/powerpc64/cpubase.pas

@@ -398,7 +398,7 @@ function flags_to_cond(const f: TResFlags): TAsmCond;
 procedure create_cond_imm(BO, BI: byte; var r: TAsmCond);
 procedure create_cond_norm(cond: TAsmCondFlag; cr: byte; var r: TasmCond);
 
-function cgsize2subreg(s: Tcgsize): Tsubregister;
+function cgsize2subreg(regtype: tregistertype; s: Tcgsize): Tsubregister;
 { Returns the tcgsize corresponding with the size of reg.}
 function reg_cgsize(const reg: tregister): tcgsize;
 
@@ -533,7 +533,7 @@ begin
   end;
 end;
 
-function cgsize2subreg(s: Tcgsize): Tsubregister;
+function cgsize2subreg(regtype: tregistertype; s: Tcgsize): Tsubregister;
 begin
   cgsize2subreg := R_SUBWHOLE;
 end;

+ 2 - 2
compiler/powerpc64/cpupara.pas

@@ -239,10 +239,10 @@ begin
       p.funcretloc[side].size := retcgsize;
       if side = callerside then
         p.funcretloc[side].register := newreg(R_INTREGISTER,
-          RS_FUNCTION_RESULT_REG, cgsize2subreg(retcgsize))
+          RS_FUNCTION_RESULT_REG, cgsize2subreg(R_INTREGISTER, retcgsize))
       else
         p.funcretloc[side].register := newreg(R_INTREGISTER,
-          RS_FUNCTION_RETURN_REG, cgsize2subreg(retcgsize));
+          RS_FUNCTION_RETURN_REG, cgsize2subreg(R_INTREGISTER, retcgsize));
     end;
 end;
 

+ 3 - 3
compiler/pp.lpi

@@ -2,16 +2,16 @@
 <CONFIG>
   <ProjectOptions>
     <PathDelim Value="\"/>
-    <Version Value="6"/>
+    <Version Value="7"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <LRSInOutputDirectory Value="False"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
-      <IconPath Value="./"/>
       <TargetFileExt Value=".exe"/>
       <Title Value="pp"/>
     </General>
@@ -23,7 +23,7 @@
     <RunParams>
       <local>
         <FormatVersion Value="1"/>
-        <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+        <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
       </local>
     </RunParams>
     <Units Count="2">

+ 10 - 10
compiler/ppc68k.lpi

@@ -1,17 +1,17 @@
 <?xml version="1.0"?>
 <CONFIG>
   <ProjectOptions>
-    <PathDelim Value="/"/>
-    <Version Value="5"/>
+    <PathDelim Value="\"/>
+    <Version Value="7"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <LRSInOutputDirectory Value="False"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
-      <IconPath Value="./"/>
       <TargetFileExt Value=".exe"/>
       <Title Value="pp"/>
     </General>
@@ -33,25 +33,25 @@
         <UnitName Value="pp"/>
       </Unit0>
       <Unit1>
-        <Filename Value="m68k/aasmcpu.pas"/>
+        <Filename Value="m68k\aasmcpu.pas"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="aasmcpu"/>
       </Unit1>
     </Units>
   </ProjectOptions>
   <CompilerOptions>
-    <Version Value="5"/>
+    <Version Value="8"/>
+    <PathDelim Value="\"/>
     <Target>
-      <Filename Value="m68k/pp"/>
+      <Filename Value="m68k\pp"/>
     </Target>
     <SearchPaths>
-      <IncludeFiles Value="m68k/"/>
-      <OtherUnitFiles Value="m68k/;systems/"/>
-      <UnitOutputDirectory Value="m68k/lazbuild"/>
+      <IncludeFiles Value="m68k\"/>
+      <OtherUnitFiles Value="m68k\;systems\"/>
+      <UnitOutputDirectory Value="m68k\lazbuild"/>
     </SearchPaths>
     <Parsing>
       <SyntaxOptions>
-        <D2Extensions Value="False"/>
         <CStyleOperator Value="False"/>
         <AllowLabel Value="False"/>
         <CPPInline Value="False"/>

+ 2 - 2
compiler/ppcarm.lpi

@@ -2,16 +2,16 @@
 <CONFIG>
   <ProjectOptions>
     <PathDelim Value="\"/>
-    <Version Value="6"/>
+    <Version Value="7"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <LRSInOutputDirectory Value="False"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
-      <IconPath Value="./"/>
       <TargetFileExt Value=".exe"/>
       <Title Value="pp"/>
     </General>

+ 3 - 4
compiler/ppcavr.lpi

@@ -2,16 +2,16 @@
 <CONFIG>
   <ProjectOptions>
     <PathDelim Value="\"/>
-    <Version Value="6"/>
+    <Version Value="7"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <LRSInOutputDirectory Value="False"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
-      <IconPath Value="./"/>
       <TargetFileExt Value=".exe"/>
       <Title Value="pp"/>
     </General>
@@ -40,7 +40,7 @@
     </Units>
   </ProjectOptions>
   <CompilerOptions>
-    <Version Value="5"/>
+    <Version Value="8"/>
     <PathDelim Value="\"/>
     <Target>
       <Filename Value="avr\pp"/>
@@ -52,7 +52,6 @@
     </SearchPaths>
     <Parsing>
       <SyntaxOptions>
-        <D2Extensions Value="False"/>
         <CStyleOperator Value="False"/>
         <AllowLabel Value="False"/>
         <CPPInline Value="False"/>

+ 3 - 4
compiler/ppcppc.lpi

@@ -2,16 +2,16 @@
 <CONFIG>
   <ProjectOptions>
     <PathDelim Value="\"/>
-    <Version Value="5"/>
+    <Version Value="7"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <LRSInOutputDirectory Value="False"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
-      <IconPath Value="./"/>
       <TargetFileExt Value=".exe"/>
       <Title Value="pp"/>
     </General>
@@ -40,7 +40,7 @@
     </Units>
   </ProjectOptions>
   <CompilerOptions>
-    <Version Value="5"/>
+    <Version Value="8"/>
     <PathDelim Value="\"/>
     <Target>
       <Filename Value="powerpc\pp"/>
@@ -52,7 +52,6 @@
     </SearchPaths>
     <Parsing>
       <SyntaxOptions>
-        <D2Extensions Value="False"/>
         <CStyleOperator Value="False"/>
         <AllowLabel Value="False"/>
         <CPPInline Value="False"/>

+ 3 - 4
compiler/ppcsparc.lpi

@@ -2,16 +2,16 @@
 <CONFIG>
   <ProjectOptions>
     <PathDelim Value="\"/>
-    <Version Value="5"/>
+    <Version Value="7"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <LRSInOutputDirectory Value="False"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
-      <IconPath Value="./"/>
       <TargetFileExt Value=".exe"/>
       <Title Value="pp"/>
     </General>
@@ -40,7 +40,7 @@
     </Units>
   </ProjectOptions>
   <CompilerOptions>
-    <Version Value="5"/>
+    <Version Value="8"/>
     <PathDelim Value="\"/>
     <Target>
       <Filename Value="sparc\pp"/>
@@ -52,7 +52,6 @@
     </SearchPaths>
     <Parsing>
       <SyntaxOptions>
-        <D2Extensions Value="False"/>
         <CStyleOperator Value="False"/>
         <AllowLabel Value="False"/>
         <CPPInline Value="False"/>

+ 11 - 10
compiler/ppx86_64.lpi

@@ -1,22 +1,23 @@
 <?xml version="1.0"?>
 <CONFIG>
   <ProjectOptions>
-    <PathDelim Value="/"/>
-    <Version Value="6"/>
+    <PathDelim Value="\"/>
+    <Version Value="7"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <LRSInOutputDirectory Value="False"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
-      <IconPath Value="./"/>
       <TargetFileExt Value=".exe"/>
       <Title Value="pp"/>
     </General>
     <PublishOptions>
       <Version Value="2"/>
+      <DestinationDirectory Value="$(TestDir)\publishedproject\"/>
       <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
       <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
     </PublishOptions>
@@ -33,25 +34,25 @@
         <UnitName Value="pp"/>
       </Unit0>
       <Unit1>
-        <Filename Value="x86/aasmcpu.pas"/>
+        <Filename Value="x86\aasmcpu.pas"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="aasmcpu"/>
       </Unit1>
     </Units>
   </ProjectOptions>
   <CompilerOptions>
-    <Version Value="5"/>
+    <Version Value="8"/>
+    <PathDelim Value="\"/>
     <Target>
-      <Filename Value="x86_64/pp"/>
+      <Filename Value="x86_64\pp"/>
     </Target>
     <SearchPaths>
-      <IncludeFiles Value="x86_64/"/>
-      <OtherUnitFiles Value="x86_64/;x86/;systems/"/>
-      <UnitOutputDirectory Value="x86_64/lazbuild"/>
+      <IncludeFiles Value="x86_64\"/>
+      <OtherUnitFiles Value="x86_64\;x86\;systems\"/>
+      <UnitOutputDirectory Value="x86_64\lazbuild"/>
     </SearchPaths>
     <Parsing>
       <SyntaxOptions>
-        <D2Extensions Value="False"/>
         <CStyleOperator Value="False"/>
         <AllowLabel Value="False"/>
         <CPPInline Value="False"/>

+ 1 - 1
compiler/psystem.pas

@@ -102,7 +102,7 @@ implementation
 {$ifdef SUPPORT_UNALIGNED}
         systemunit.insert(tsyssym.create('Unaligned',in_unaligned_x));
 {$endif SUPPORT_UNALIGNED}
-        systemunit.insert(tsyssym.create('Selector',in_objc_selector_x)); { objc only }
+        systemunit.insert(tsyssym.create('ObjCSelector',in_objc_selector_x)); { objc only }
       end;
 
 

+ 38 - 25
compiler/ptconst.pas

@@ -988,10 +988,9 @@ implementation
           n.free;
         end;
 
-        procedure parse_recorddef(list:tasmlist;def:trecorddef);
+      procedure parse_recorddef(list:tasmlist;def:trecorddef);
         var
           n       : tnode;
-          i,
           symidx  : longint;
           recsym,
           srsym   : tsym;
@@ -1003,35 +1002,40 @@ implementation
           bp   : tbitpackedval;
           error,
           is_packed: boolean;
+
+        procedure handle_stringconstn;
+          var
+            i       : longint;
+          begin
+            hs:=strpas(tstringconstnode(n).value_str);
+            if string2guid(hs,tmpguid) then
+              begin
+                list.concat(Tai_const.Create_32bit(longint(tmpguid.D1)));
+                list.concat(Tai_const.Create_16bit(tmpguid.D2));
+                list.concat(Tai_const.Create_16bit(tmpguid.D3));
+                for i:=Low(tmpguid.D4) to High(tmpguid.D4) do
+                  list.concat(Tai_const.Create_8bit(tmpguid.D4[i]));
+              end
+            else
+              Message(parser_e_improper_guid_syntax);
+          end;
+
+        var
+          i       : longint;
+
         begin
           { GUID }
           if (def=rec_tguid) and (token=_ID) then
             begin
               n:=comp_expr(true);
-              inserttypeconv(n,rec_tguid);
-              if n.nodetype=guidconstn then
-                begin
-                  tmpguid:=tguidconstnode(n).value;
-                  list.concat(Tai_const.Create_32bit(longint(tmpguid.D1)));
-                  list.concat(Tai_const.Create_16bit(tmpguid.D2));
-                  list.concat(Tai_const.Create_16bit(tmpguid.D3));
-                  for i:=Low(tmpguid.D4) to High(tmpguid.D4) do
-                    list.concat(Tai_const.Create_8bit(tmpguid.D4[i]));
-                end
-              else
-                Message(parser_e_illegal_expression);
-              n.free;
-              exit;
-            end;
-          if (def=rec_tguid) and ((token=_CSTRING) or (token=_CCHAR)) then
-            begin
-              n:=comp_expr(true);
-              inserttypeconv(n,cshortstringtype);
               if n.nodetype=stringconstn then
+                handle_stringconstn
+              else
                 begin
-                  hs:=strpas(tstringconstnode(n).value_str);
-                  if string2guid(hs,tmpguid) then
+                  inserttypeconv(n,rec_tguid);
+                  if n.nodetype=guidconstn then
                     begin
+                      tmpguid:=tguidconstnode(n).value;
                       list.concat(Tai_const.Create_32bit(longint(tmpguid.D1)));
                       list.concat(Tai_const.Create_16bit(tmpguid.D2));
                       list.concat(Tai_const.Create_16bit(tmpguid.D3));
@@ -1039,8 +1043,17 @@ implementation
                         list.concat(Tai_const.Create_8bit(tmpguid.D4[i]));
                     end
                   else
-                    Message(parser_e_improper_guid_syntax);
-                end
+                    Message(parser_e_illegal_expression);
+                end;
+              n.free;
+              exit;
+            end;
+          if (def=rec_tguid) and ((token=_CSTRING) or (token=_CCHAR)) then
+            begin
+              n:=comp_expr(true);
+              inserttypeconv(n,cshortstringtype);
+              if n.nodetype=stringconstn then
+                handle_stringconstn
               else
                 Message(parser_e_illegal_expression);
               n.free;

+ 12 - 9
compiler/ptype.pas

@@ -40,7 +40,7 @@ interface
     procedure id_type(var def : tdef;isforwarddef:boolean);
 
     { reads a string, file type or a type identifier }
-    procedure single_type(var def:tdef;isforwarddef:boolean);
+    procedure single_type(var def:tdef;isforwarddef,allowtypedef:boolean);
 
     { reads any type declaration, where the resulting type will get name as type identifier }
     procedure read_named_type(var def:tdef;const name : TIDString;genericdef:tstoreddef;genericlist:TFPObjectList;parseprocvardir:boolean);
@@ -414,7 +414,7 @@ implementation
       end;
 
 
-    procedure single_type(var def:tdef;isforwarddef:boolean);
+    procedure single_type(var def:tdef;isforwarddef,allowtypedef:boolean);
        var
          t2 : tdef;
          dospecialize,
@@ -425,14 +425,17 @@ implementation
            again:=false;
              case token of
                _STRING:
-                 string_dec(def);
+                 string_dec(def,allowtypedef);
 
                _FILE:
                  begin
                     consume(_FILE);
-                    if try_to_consume(_OF) then
+                    if (token=_OF) then
                       begin
-                         single_type(t2,false);
+                         if not(allowtypedef) then
+                           Message(parser_e_no_local_para_def);
+                         consume(_OF);
+                         single_type(t2,false,false);
                          def:=tfiledef.createtyped(t2);
                       end
                     else
@@ -829,7 +832,7 @@ implementation
          case token of
             _STRING,_FILE:
               begin
-                single_type(def,false);
+                single_type(def,false,true);
               end;
            _LKLAMMER:
               begin
@@ -902,7 +905,7 @@ implementation
            _CARET:
               begin
                 consume(_CARET);
-                single_type(tt2,(block_type=bt_type));
+                single_type(tt2,(block_type=bt_type),false);
                 def:=tpointerdef.create(tt2);
                 if tt2.typ=forwarddef then
                   current_module.checkforwarddefs.add(def);
@@ -967,7 +970,7 @@ implementation
                    ) then
                   begin
                     consume(_OF);
-                    single_type(hdef,(block_type=bt_type));
+                    single_type(hdef,(block_type=bt_type),false);
                     if is_class(hdef) then
                       def:=tclassrefdef.create(hdef)
                     else
@@ -1031,7 +1034,7 @@ implementation
                 if is_func then
                  begin
                    consume(_COLON);
-                   single_type(pd.returndef,false);
+                   single_type(pd.returndef,false,false);
                  end;
                 if token=_OF then
                   begin

+ 4 - 4
compiler/scandir.pas

@@ -312,8 +312,8 @@ unit scandir;
 
     procedure dir_description;
       begin
-        if not (target_info.system in [system_i386_os2,system_i386_emx,
-                 system_i386_win32,system_i386_netware,system_i386_wdosx,system_i386_netwlibc]) then
+        if not (target_info.system in system_all_windows+[system_i386_os2,system_i386_emx,
+                 system_i386_netware,system_i386_wdosx,system_i386_netwlibc]) then
           Message(scan_w_description_not_support);
         { change description global var in all cases }
         { it not used but in win32, os2 and netware }
@@ -1100,8 +1100,8 @@ unit scandir;
         major, minor, revision : longint;
         error : integer;
       begin
-        if not (target_info.system in [system_i386_os2,system_i386_emx,
-                 system_i386_win32,system_i386_netware,system_i386_wdosx,
+        if not (target_info.system in system_all_windows+[system_i386_os2,system_i386_emx,
+                 system_i386_netware,system_i386_wdosx,
                  system_i386_netwlibc]) then
           begin
             Message(scan_n_version_not_support);

+ 22 - 6
compiler/sparc/cpubase.pas

@@ -336,7 +336,7 @@ uses
     function conditions_equal(const c1, c2: TAsmCond): boolean; {$ifdef USEINLINE}inline;{$endif USEINLINE}
 
     function  flags_to_cond(const f: TResFlags) : TAsmCond;
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
     function reg_cgsize(const reg: tregister): tcgsize;
     function std_regname(r:Tregister):string;
     function std_regnum_search(const s:string):Tregister;
@@ -395,12 +395,28 @@ implementation
       end;
 
 
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
       begin
-        if s in [OS_64,OS_S64] then
-          cgsize2subreg:=R_SUBQ
-        else
-          cgsize2subreg:=R_SUBWHOLE;
+        case regtype of
+          R_FPUREGISTER:
+            case s of
+              OS_F32:
+                cgsize2subreg:=R_SUBFS;
+              OS_F64:
+                cgsize2subreg:=R_SUBFD;
+              OS_F128:
+                cgsize2subreg:=R_SUBFQ;
+              else
+                internalerror(2009071903);
+            end;
+          else
+            begin
+              if s in [OS_64,OS_S64] then
+                cgsize2subreg:=R_SUBQ
+              else
+                cgsize2subreg:=R_SUBWHOLE;
+            end;
+        end;
       end;
 
 

+ 2 - 2
compiler/sparc/cpupara.pas

@@ -196,9 +196,9 @@ implementation
                p.funcretloc[side].loc:=LOC_REGISTER;
                p.funcretloc[side].size:=retcgsize;
                if (side=callerside) then
-                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(retcgsize))
+                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(R_INTREGISTER,retcgsize))
                else
-                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(retcgsize));
+                 p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(R_INTREGISTER,retcgsize));
              end;
           end;
       end;

+ 1 - 1
compiler/symdef.pas

@@ -2389,7 +2389,7 @@ implementation
 
         { prevent overflow, return -1 to indicate overflow }
         { also make sure we don't need 64/128 bit arithmetic to calculate offsets }
-        if (cachedelecount > high(aint)) or
+        if (cachedelecount > aword(high(aint))) or
            ((high(aint) div cachedelesize) < aint(cachedelecount)) or
            { also lowrange*elesize must be < high(aint) to prevent overflow when
              accessing the array, see ncgmem (PFV) }

+ 2 - 2
compiler/systems/t_linux.pas

@@ -628,7 +628,7 @@ begin
           add('SECTIONS');
           add('{');
           add('  /* Read-only sections, merged into text segment: */');
-          add('  PROVIDE (__executable_start = 0x8000); . = 0x8000;');
+          add('  PROVIDE (__executable_start = 0x8000); . = 0x8000 + SIZEOF_HEADERS;');
           add('  .interp         : { *(.interp) }');
           add('  .note.gnu.build-id : { *(.note.gnu.build-id) }');
           add('  .hash           : { *(.hash) }');
@@ -847,7 +847,7 @@ begin
           add('SECTIONS');
           add('{');
           {Read-only sections, merged into text segment:}
-          add('  PROVIDE (__executable_start = 0x010000); . = 0x010000 +0x100;');
+          add('  PROVIDE (__executable_start = 0x010000); . = 0x010000 + SIZEOF_HEADERS;');
           add('  .interp         : { *(.interp) }');
           add('  .hash           : { *(.hash) }');
           add('  .dynsym         : { *(.dynsym) }');

+ 19 - 4
compiler/x86/cpubase.pas

@@ -244,7 +244,7 @@ uses
                                   Helpers
 *****************************************************************************}
 
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
     function reg2opsize(r:Tregister):topsize;
     function reg_cgsize(const reg: tregister): tcgsize;
     function is_calljmp(o:tasmop):boolean;
@@ -295,7 +295,7 @@ implementation
                                   Helpers
 *****************************************************************************}
 
-    function cgsize2subreg(s:Tcgsize):Tsubregister;
+    function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
       begin
         case s of
           OS_8,OS_S8:
@@ -308,9 +308,24 @@ implementation
             cgsize2subreg:=R_SUBQ;
           OS_M64:
             cgsize2subreg:=R_SUBNONE;
-          OS_F32,OS_F64,OS_C64,
+          OS_F32,OS_F64,OS_C64:
+            case regtype of
+              R_FPUREGISTER:
+                cgsize2subreg:=R_SUBWHOLE;
+              R_MMREGISTER:
+                case s of
+                  OS_F32:
+                    cgsize2subreg:=R_SUBMMS;
+                  OS_F64:
+                    cgsize2subreg:=R_SUBMMD;
+                  else
+                    internalerror(2009071901);
+                end;
+              else
+                internalerror(2009071902);
+            end;
           OS_M128,OS_MS128:
-            cgsize2subreg:=R_SUBWHOLE;
+            cgsize2subreg:=R_SUBMMWHOLE;
           else
             internalerror(200301231);
         end;

+ 2 - 0
compiler/x86/rax86int.pas

@@ -1587,6 +1587,8 @@ Unit Rax86int;
                             oper.opr.val:=toffset;
                           end;
                       end;
+                    OPR_REGISTER :
+                      Message(asmr_e_invalid_reference_syntax);
                     OPR_SYMBOL:
                       Message(asmr_e_invalid_symbol_ref);
                     else

+ 14 - 5
compiler/x86_64/cpupara.pas

@@ -472,9 +472,9 @@ unit cpupara;
               begin
                 p.funcretloc[side].size:=retcgsize;
                 if side=callerside then
-                  p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(retcgsize))
+                  p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RESULT_REG,cgsize2subreg(R_INTREGISTER,retcgsize))
                 else
-                  p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(retcgsize));
+                  p.funcretloc[side].register:=newreg(R_INTREGISTER,RS_FUNCTION_RETURN_REG,cgsize2subreg(R_INTREGISTER,retcgsize));
               end;
           end;
       end;
@@ -577,7 +577,7 @@ unit cpupara;
                               { s64comp is pushed in an int register }
                               if paraloc^.size=OS_C64 then
                                 paraloc^.size:=OS_64;
-                              subreg:=cgsize2subreg(paraloc^.size);
+                              subreg:=cgsize2subreg(R_INTREGISTER,paraloc^.size);
                             end;
 
                           { winx64 uses different registers }
@@ -598,11 +598,20 @@ unit cpupara;
                           paraloc:=hp.paraloc[side].add_location;
                           paraloc^.loc:=LOC_MMREGISTER;
 
+                          case paracgsize of
+                            OS_F32:
+                              subreg:=R_SUBMMS;
+                            OS_F64:
+                              subreg:=R_SUBMMD;
+                            else
+                              subreg:=R_SUBMMWHOLE;
+                          end;
+
                           { winx64 uses different registers }
                           if target_info.system=system_x86_64_win64 then
-                            paraloc^.register:=newreg(R_MMREGISTER,parammsupregs_winx64[mmparareg],R_SUBNONE)
+                            paraloc^.register:=newreg(R_MMREGISTER,parammsupregs_winx64[mmparareg],subreg)
                           else
-                            paraloc^.register:=newreg(R_MMREGISTER,parammsupregs[mmparareg],R_SUBNONE);
+                            paraloc^.register:=newreg(R_MMREGISTER,parammsupregs[mmparareg],subreg);
                           if paracgsize=OS_F128 then
                             paraloc^.size:=OS_F64
                           else

+ 121 - 43
packages/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/05/09]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/07/25]
 #
 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 m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
@@ -263,31 +263,31 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph libc unixutil graph pxlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph libc unixutil graph pxlib
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv graph unzip gdbint
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick gdbint libpng mad tcl opengl gtk1 gtk2 librsvg a52 cdrom fpgtk openal fftw lua oggvorbis sdl openssl graph pcap httpd13 httpd20 httpd22 pxlib numlib winceunits cairo libxml
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv winunits-base winunits-jedi fcl-web fastcgi ibase mysql zlib oracle odbc postgres sqlite imagemagick gdbint libpng mad tcl opengl gtk1 gtk2 librsvg a52 cdrom fpgtk openal fftw lua oggvorbis sdl openssl graph pcap httpd13 httpd20 httpd22 pxlib numlib winceunits cairo libxml
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv zlib libpng x11 tcl fpgtk rexx os2units gtk1 imlib
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib users iconvenc
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib users iconvenc
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib iconvenc
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib iconvenc
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib iconvenc
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib iconvenc
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 bfd svgalib imlib utmp  fpgtk xforms fftw pcap ggi  openssl gnome1 httpd13 httpd20 httpd22 numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 bfd svgalib imlib utmp  fpgtk xforms fftw pcap ggi  openssl gnome1 httpd13 httpd20 httpd22 numlib
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
@@ -296,13 +296,13 @@ ifeq ($(FULL_TARGET),i386-netware)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv zlib unzip
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc  postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc  postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc graph univint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms  gnome1 httpd13 httpd20 httpd22 imlib opengles objcrtl
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc graph univint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms  gnome1 httpd13 httpd20 httpd22 imlib opengles objcrtl
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv zlib libpng x11 tcl fpgtk rexx os2units gtk1 imlib
@@ -314,7 +314,7 @@ ifeq ($(FULL_TARGET),i386-netwlibc)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv zlib unzip
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  winceunits httpd22 fcl-web tcl fftw unzip zlib sqlite mysql ibase postgres oracle odbc sdl openssl oggvorbis numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  winceunits httpd22 fcl-web fastcgi tcl fftw unzip zlib sqlite mysql ibase postgres oracle odbc sdl openssl oggvorbis numlib
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
@@ -323,13 +323,13 @@ ifeq ($(FULL_TARGET),i386-symbian)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib users iconvenc
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib users iconvenc
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  amunits
@@ -338,7 +338,7 @@ ifeq ($(FULL_TARGET),m68k-atari)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc  postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc  postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  palmunits
@@ -347,10 +347,10 @@ ifeq ($(FULL_TARGET),m68k-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  amunits
@@ -359,7 +359,7 @@ ifeq ($(FULL_TARGET),powerpc-macos)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc graph univint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib objcrtl
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc graph univint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib objcrtl
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv opengl
@@ -368,43 +368,43 @@ ifeq ($(FULL_TARGET),powerpc-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 bfd svgalib imlib utmp  fpgtk xforms fftw pcap ggi  openssl gnome1 httpd13 httpd20 httpd22 numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 bfd svgalib imlib utmp  fpgtk xforms fftw pcap ggi  openssl gnome1 httpd13 httpd20 httpd22 numlib
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib users iconvenc
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib users iconvenc
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick tcl opengl gtk1 gtk2 librsvg fpgtk fftw sdl openssl cdrom httpd13 httpd20 httpd22 numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv winunits-base winunits-jedi fcl-web fastcgi ibase mysql zlib oracle odbc postgres sqlite imagemagick tcl opengl gtk1 fpgtk fftw sdl openssl cdrom httpd13 httpd20 httpd22 numlib
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  palmunits
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc httpd13 httpd20 httpd22 opengles objcrtl
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc httpd13 httpd20 httpd22 opengles objcrtl
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  winceunits httpd22 fcl-web tcl fftw unzip zlib sqlite mysql ibase postgres oracle odbc sdl openssl oggvorbis numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  winceunits httpd22 fcl-web fastcgi tcl fftw unzip zlib sqlite mysql ibase postgres oracle odbc sdl openssl oggvorbis numlib
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
@@ -419,10 +419,10 @@ ifeq ($(FULL_TARGET),arm-symbian)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib graph
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
@@ -431,7 +431,7 @@ ifeq ($(FULL_TARGET),avr-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
+override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic  fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-xml fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-fpcunit fcl-json  fcl-process unzip regexpr chm fcl-res libgd symbolic
@@ -1557,6 +1557,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -1672,6 +1673,7 @@ TARGET_DIRS_FV=1
 TARGET_DIRS_WINUNITS-BASE=1
 TARGET_DIRS_WINUNITS-JEDI=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
 TARGET_DIRS_ZLIB=1
@@ -1763,6 +1765,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -1831,6 +1834,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -1897,6 +1901,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -1963,6 +1968,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -2028,6 +2034,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -2134,6 +2141,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -2221,6 +2229,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -2367,6 +2376,7 @@ TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_WINCEUNITS=1
 TARGET_DIRS_HTTPD22=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_TCL=1
 TARGET_DIRS_FFTW=1
 TARGET_DIRS_UNZIP=1
@@ -2449,6 +2459,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -2532,6 +2543,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -2600,6 +2612,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -2710,6 +2723,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -2820,6 +2834,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -2903,6 +2918,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3013,6 +3029,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3124,6 +3141,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3207,6 +3225,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3272,6 +3291,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3353,6 +3373,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3436,6 +3457,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3504,6 +3526,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3567,6 +3590,7 @@ TARGET_DIRS_FV=1
 TARGET_DIRS_WINUNITS-BASE=1
 TARGET_DIRS_WINUNITS-JEDI=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
 TARGET_DIRS_ZLIB=1
@@ -3578,8 +3602,6 @@ TARGET_DIRS_IMAGEMAGICK=1
 TARGET_DIRS_TCL=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK1=1
-TARGET_DIRS_GTK2=1
-TARGET_DIRS_LIBRSVG=1
 TARGET_DIRS_FPGTK=1
 TARGET_DIRS_FFTW=1
 TARGET_DIRS_SDL=1
@@ -3635,6 +3657,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3741,6 +3764,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -3795,6 +3819,7 @@ TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_WINCEUNITS=1
 TARGET_DIRS_HTTPD22=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_TCL=1
 TARGET_DIRS_FFTW=1
 TARGET_DIRS_UNZIP=1
@@ -3921,6 +3946,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -4004,6 +4030,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -4109,6 +4136,7 @@ TARGET_DIRS_LIBGD=1
 TARGET_DIRS_SYMBOLIC=1
 TARGET_DIRS_FV=1
 TARGET_DIRS_FCL-WEB=1
+TARGET_DIRS_FASTCGI=1
 TARGET_DIRS_FCL-ASYNC=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_MYSQL=1
@@ -5180,6 +5208,51 @@ fcl-web:
 	$(MAKE) -C fcl-web all
 .PHONY: fcl-web_all fcl-web_debug fcl-web_smart fcl-web_release fcl-web_units fcl-web_examples fcl-web_shared fcl-web_install fcl-web_sourceinstall fcl-web_exampleinstall fcl-web_distinstall fcl-web_zipinstall fcl-web_zipsourceinstall fcl-web_zipexampleinstall fcl-web_zipdistinstall fcl-web_clean fcl-web_distclean fcl-web_cleanall fcl-web_info fcl-web_makefiles fcl-web
 endif
+ifdef TARGET_DIRS_FASTCGI
+fastcgi_all:
+	$(MAKE) -C fastcgi all
+fastcgi_debug:
+	$(MAKE) -C fastcgi debug
+fastcgi_smart:
+	$(MAKE) -C fastcgi smart
+fastcgi_release:
+	$(MAKE) -C fastcgi release
+fastcgi_units:
+	$(MAKE) -C fastcgi units
+fastcgi_examples:
+	$(MAKE) -C fastcgi examples
+fastcgi_shared:
+	$(MAKE) -C fastcgi shared
+fastcgi_install:
+	$(MAKE) -C fastcgi install
+fastcgi_sourceinstall:
+	$(MAKE) -C fastcgi sourceinstall
+fastcgi_exampleinstall:
+	$(MAKE) -C fastcgi exampleinstall
+fastcgi_distinstall:
+	$(MAKE) -C fastcgi distinstall
+fastcgi_zipinstall:
+	$(MAKE) -C fastcgi zipinstall
+fastcgi_zipsourceinstall:
+	$(MAKE) -C fastcgi zipsourceinstall
+fastcgi_zipexampleinstall:
+	$(MAKE) -C fastcgi zipexampleinstall
+fastcgi_zipdistinstall:
+	$(MAKE) -C fastcgi zipdistinstall
+fastcgi_clean:
+	$(MAKE) -C fastcgi clean
+fastcgi_distclean:
+	$(MAKE) -C fastcgi distclean
+fastcgi_cleanall:
+	$(MAKE) -C fastcgi cleanall
+fastcgi_info:
+	$(MAKE) -C fastcgi info
+fastcgi_makefiles:
+	$(MAKE) -C fastcgi makefiles
+fastcgi:
+	$(MAKE) -C fastcgi all
+.PHONY: fastcgi_all fastcgi_debug fastcgi_smart fastcgi_release fastcgi_units fastcgi_examples fastcgi_shared fastcgi_install fastcgi_sourceinstall fastcgi_exampleinstall fastcgi_distinstall fastcgi_zipinstall fastcgi_zipsourceinstall fastcgi_zipexampleinstall fastcgi_zipdistinstall fastcgi_clean fastcgi_distclean fastcgi_cleanall fastcgi_info fastcgi_makefiles fastcgi
+endif
 ifdef TARGET_DIRS_FCL-ASYNC
 fcl-async_all:
 	$(MAKE) -C fcl-async all
@@ -8416,11 +8489,11 @@ fcl-net_smart: fcl-passrc_smart fcl-xml_smart fcl-async_smart
 fcl-net_release: fcl-passrc_release fcl-xml_release fcl-async_release
 fcl-net_shared: fcl-passrc_shared fcl-xml_shared fcl-async_shared
 endif
-fcl-web_all: fcl-db_all fcl-xml_all fcl-process_all httpd22_all
-fcl-web_debug: fcl-db_debug fcl-xml_debug fcl-process_debug httpd22_debug
-fcl-web_smart: fcl-db_smart fcl-xml_smart fcl-process_smart httpd22_smart
-fcl-web_release: fcl-db_release fcl-xml_release fcl-process_release httpd22_release
-fcl-web_shared: fcl-db_shared fcl-xml_shared fcl-process_shared httpd22_shared
+fcl-web_all: fcl-db_all fcl-xml_all fcl-process_all httpd22_all fastcgi_all
+fcl-web_debug: fcl-db_debug fcl-xml_debug fcl-process_debug httpd22_debug fastcgi_debug
+fcl-web_smart: fcl-db_smart fcl-xml_smart fcl-process_smart httpd22_smart fastcgi_smart
+fcl-web_release: fcl-db_release fcl-xml_release fcl-process_release httpd22_release fastcgi_release
+fcl-web_shared: fcl-db_shared fcl-xml_shared fcl-process_shared httpd22_shared fastcgi_shared
 ifneq ($(findstring $(OS_TARGET),linux freebsd openbsd netbsd win32 beos haiku),)
 fcl-db_all: fcl-xml_all mysql_all ibase_all oracle_all odbc_all postgres_all sqlite_all pxlib_all
 fcl-db_debug: fcl-xml_debug mysql_debug ibase_debug oracle_debug odbc_debug postgres_debug sqlite_debug pxlib_debug
@@ -8493,11 +8566,11 @@ gtk1_debug: x11_debug opengl_debug
 gtk1_smart: x11_smart opengl_smart
 gtk1_release: x11_release opengl_release
 gtk1_shared: x11_shared opengl_shared
-gtk2_all: x11_all
-gtk2_shared: x11_shared
-gtk2_smart: x11_smart
-gtk2_debug: x11_debug
-gtk2_release: x11_release
+gtk2_all: x11_all cairo_all
+gtk2_shared: x11_shared cairo_shared
+gtk2_smart: x11_smart cairo_smart
+gtk2_debug: x11_debug cairo_debug
+gtk2_release: x11_release cairo_release
 else
 ifeq ($(findstring $(OS_TARGET),os2 emx),)
 gtk1_all:  opengl_all
@@ -8506,6 +8579,11 @@ gtk1_smart:  opengl_smart
 gtk1_release:  opengl_release
 gtk1_shared:  opengl_shared
 endif
+gtk2_all: cairo_all
+gtk2_shared: cairo_shared
+gtk2_smart: cairo_smart
+gtk2_debug: cairo_debug
+gtk2_release: cairo_release
 endif
 imlib_all: gtk1_all x11_all
 imlib_shared: gtk1_shared x11_shared

+ 28 - 22
packages/Makefile.fpc

@@ -13,44 +13,44 @@ dirs_powerpc64_linux=graph
 dirs_sparc_linux=graph
 dirs_arm_linux=graph
 dirs_m68k_linux=graph
-dirs_beos=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
+dirs_beos=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
                gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib \
                imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib \
                iconvenc
-dirs_haiku=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
+dirs_haiku=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
                gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib \
                imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib \
                iconvenc
-dirs_freebsd=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
+dirs_freebsd=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
                gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib \
                imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg httpd13 httpd20 httpd22 pxlib numlib \
                users iconvenc
-dirs_darwin=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
+dirs_darwin=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
                 libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc
 dirs_i386_darwin=graph univint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms  gnome1 httpd13 httpd20 httpd22 imlib opengles objcrtl
 dirs_powerpc_darwin=graph univint sdl opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib objcrtl
 dirs_x86_64_darwin=opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
 dirs_powerpc64_darwin=opengl x11 cairo gtk1 gtk2 librsvg fpgtk xforms gnome1 httpd13 httpd20 httpd22 imlib
 dirs_arm_darwin= httpd13 httpd20 httpd22 opengles objcrtl
-dirs_solaris=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
+dirs_solaris=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
                libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 bfd svgalib \
                imlib utmp  fpgtk xforms fftw pcap ggi  openssl gnome1 httpd13 httpd20 httpd22 numlib
-dirs_netbsd=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
+dirs_netbsd=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
                gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib \
                imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
-dirs_openbsd=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc  postgres sqlite pthreads imagemagick \
+dirs_openbsd=fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc  postgres sqlite pthreads imagemagick \
                gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg bfd aspell svgalib \
                imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
-dirs_linux=fv fcl-web fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick \
+dirs_linux=fv fcl-web fastcgi fcl-async ibase mysql ncurses unzip zlib oracle dbus odbc postgres sqlite pthreads imagemagick \
                gdbint libpng x11 uuid ldap modplug dts mad  gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 librsvg \
                a52 bfd aspell svgalib newt cdrom users  iconvenc libxml proj4 \
                imlib utmp  fpgtk openal lua oggvorbis xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib
-dirs_win32=fv winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick \
+dirs_win32=fv winunits-base winunits-jedi fcl-web fastcgi ibase mysql zlib oracle odbc postgres sqlite imagemagick \
                gdbint libpng mad tcl opengl gtk1 gtk2 librsvg a52 cdrom fpgtk openal fftw lua \
                oggvorbis sdl openssl graph pcap httpd13 httpd20 httpd22 pxlib numlib winceunits cairo libxml
-dirs_win64=fv winunits-base winunits-jedi fcl-web ibase mysql zlib oracle odbc postgres sqlite imagemagick \
-                tcl opengl gtk1 gtk2 librsvg fpgtk fftw sdl openssl cdrom httpd13 httpd20 httpd22 numlib
-dirs_wince=winceunits httpd22 fcl-web tcl fftw unzip zlib sqlite mysql ibase postgres oracle odbc sdl openssl oggvorbis numlib
+dirs_win64=fv winunits-base winunits-jedi fcl-web fastcgi ibase mysql zlib oracle odbc postgres sqlite imagemagick \
+                tcl opengl gtk1 fpgtk fftw sdl openssl cdrom httpd13 httpd20 httpd22 numlib
+dirs_wince=winceunits httpd22 fcl-web fastcgi tcl fftw unzip zlib sqlite mysql ibase postgres oracle odbc sdl openssl oggvorbis numlib
 dirs_os2=fv zlib libpng x11 tcl fpgtk rexx os2units gtk1 imlib
 dirs_emx=fv zlib libpng x11 tcl fpgtk rexx os2units gtk1 imlib
 dirs_netware=fv zlib unzip
@@ -140,11 +140,11 @@ fcl-net_release: fcl-passrc_release fcl-xml_release fcl-async_release
 fcl-net_shared: fcl-passrc_shared fcl-xml_shared fcl-async_shared
 endif
 
-fcl-web_all: fcl-db_all fcl-xml_all fcl-process_all httpd22_all
-fcl-web_debug: fcl-db_debug fcl-xml_debug fcl-process_debug httpd22_debug
-fcl-web_smart: fcl-db_smart fcl-xml_smart fcl-process_smart httpd22_smart
-fcl-web_release: fcl-db_release fcl-xml_release fcl-process_release httpd22_release
-fcl-web_shared: fcl-db_shared fcl-xml_shared fcl-process_shared httpd22_shared
+fcl-web_all: fcl-db_all fcl-xml_all fcl-process_all httpd22_all fastcgi_all
+fcl-web_debug: fcl-db_debug fcl-xml_debug fcl-process_debug httpd22_debug fastcgi_debug
+fcl-web_smart: fcl-db_smart fcl-xml_smart fcl-process_smart httpd22_smart fastcgi_smart
+fcl-web_release: fcl-db_release fcl-xml_release fcl-process_release httpd22_release fastcgi_release
+fcl-web_shared: fcl-db_shared fcl-xml_shared fcl-process_shared httpd22_shared fastcgi_shared
 
 ifneq ($(findstring $(OS_TARGET),linux freebsd openbsd netbsd win32 beos haiku),)
 fcl-db_all: fcl-xml_all mysql_all ibase_all oracle_all odbc_all postgres_all sqlite_all pxlib_all
@@ -227,11 +227,11 @@ gtk1_smart: x11_smart opengl_smart
 gtk1_release: x11_release opengl_release
 gtk1_shared: x11_shared opengl_shared
 
-gtk2_all: x11_all
-gtk2_shared: x11_shared
-gtk2_smart: x11_smart
-gtk2_debug: x11_debug
-gtk2_release: x11_release
+gtk2_all: x11_all cairo_all
+gtk2_shared: x11_shared cairo_shared
+gtk2_smart: x11_smart cairo_smart
+gtk2_debug: x11_debug cairo_debug
+gtk2_release: x11_release cairo_release
 else
 ifeq ($(findstring $(OS_TARGET),os2 emx),)
 gtk1_all:  opengl_all
@@ -240,6 +240,12 @@ gtk1_smart:  opengl_smart
 gtk1_release:  opengl_release
 gtk1_shared:  opengl_shared
 endif
+
+gtk2_all: cairo_all
+gtk2_shared: cairo_shared
+gtk2_smart: cairo_smart
+gtk2_debug: cairo_debug
+gtk2_release: cairo_release
 endif
 
 imlib_all: gtk1_all x11_all

+ 73 - 59
packages/bzip2/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/10/22]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/06/27]
 #
 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 m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
@@ -265,178 +265,178 @@ PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(F
 override PACKAGE_NAME=bzip2
 override PACKAGE_VERSION=2.2.2
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_UNITS+=bzip2
+override TARGET_UNITS+=bzip2comn bzip2 bzip2stream
 endif
 override INSTALL_FPCPACKAGE=y
 ifeq ($(FULL_TARGET),i386-linux)
@@ -1007,6 +1007,7 @@ endif
 ifeq ($(OS_TARGET),go32v2)
 STATICLIBPREFIX=
 SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
 endif
 ifeq ($(OS_TARGET),watcom)
 STATICLIBPREFIX=
@@ -1014,6 +1015,7 @@ OEXT=.obj
 ASMEXT=.asm
 SHAREDLIBEXT=.dll
 SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
 endif
 ifeq ($(OS_TARGET),linux)
 BATCHEXT=.sh
@@ -1050,6 +1052,7 @@ STATICLIBPREFIX=
 SHAREDLIBEXT=.dll
 SHORTSUFFIX=os2
 ECHO=echo
+IMPORTLIBPREFIX=
 endif
 ifeq ($(OS_TARGET),emx)
 BATCHEXT=.cmd
@@ -1058,6 +1061,7 @@ STATICLIBPREFIX=
 SHAREDLIBEXT=.dll
 SHORTSUFFIX=emx
 ECHO=echo
+IMPORTLIBPREFIX=
 endif
 ifeq ($(OS_TARGET),amiga)
 EXEEXT=
@@ -1097,17 +1101,20 @@ ifeq ($(OS_TARGET),netware)
 EXEEXT=.nlm
 STATICLIBPREFIX=
 SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
 endif
 ifeq ($(OS_TARGET),netwlibc)
 EXEEXT=.nlm
 STATICLIBPREFIX=
 SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
 endif
 ifeq ($(OS_TARGET),macos)
 BATCHEXT=
 EXEEXT=
 DEBUGSYMEXT=.xcoff
 SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
 endif
 ifeq ($(OS_TARGET),darwin)
 BATCHEXT=.sh
@@ -1134,14 +1141,17 @@ STATICLIBEXT=.a1
 SHAREDLIBEXT=.so1
 STATICLIBPREFIX=
 SHORTSUFFIX=v1
+IMPORTLIBPREFIX=
 endif
 ifeq ($(OS_TARGET),go32v2)
 STATICLIBPREFIX=
 SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
 endif
 ifeq ($(OS_TARGET),watcom)
 STATICLIBPREFIX=
 SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
 endif
 ifeq ($(OS_TARGET),linux)
 BATCHEXT=.sh
@@ -1188,6 +1198,7 @@ STATICLIBEXT=.ao2
 SHAREDLIBEXT=.dll
 SHORTSUFFIX=os2
 ECHO=echo
+IMPORTLIBPREFIX=
 endif
 ifeq ($(OS_TARGET),amiga)
 EXEEXT=
@@ -1248,6 +1259,7 @@ STATICLIBEXT=.a
 SHAREDLIBEXT=.nlm
 EXEEXT=.nlm
 SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
 endif
 ifeq ($(OS_TARGET),netwlibc)
 STATICLIBPREFIX=
@@ -1259,6 +1271,7 @@ STATICLIBEXT=.a
 SHAREDLIBEXT=.nlm
 EXEEXT=.nlm
 SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
 endif
 ifeq ($(OS_TARGET),macos)
 BATCHEXT=
@@ -1270,6 +1283,7 @@ STATICLIBEXT=.a
 EXEEXT=
 DEBUGSYMEXT=.xcoff
 SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
 endif
 endif
 ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)

+ 1 - 1
packages/bzip2/Makefile.fpc

@@ -7,7 +7,7 @@ name=bzip2
 version=2.2.2
 
 [target]
-units=bzip2
+units=bzip2comn bzip2 bzip2stream
 
 [require]
 package=rtl

+ 2 - 61
packages/bzip2/src/bzip2.pas

@@ -26,25 +26,9 @@ interface
 
 {$goto on}
 
-uses objects;
-
-const max_groups=6;
-      max_alpha_size=258;
-      max_code_len=23;
-      group_size=50;
-      iter_count=4;
-      max_selectors=2+(900000 div group_size);
-
-const mtfa_size=4096;
-      mtfl_size=16;
-
-type  Tcardinal_array=array [0..899999] of cardinal;
-      Pcardinal_array=^Tcardinal_array;
-
-      Pcardinal=^cardinal;
-      Thuffarray=array[0..max_alpha_size] of cardinal;
-      Phuffarray=^Thuffarray;
+uses objects, bzip2comn;
 
+Type
       Tbzip2_decode_stream=object(Tstream)
         short:cardinal;
         readstream:Pstream;
@@ -100,14 +84,6 @@ type  Tcardinal_array=array [0..899999] of cardinal;
         destructor done;virtual;
       end;
 
-{A bzip2 stream starts with this:}
-const bzip2_stream_magic='BZh';
-
-{Error codes for stream errorinfo.}
-const bzip2_bad_header_magic        =1;
-      bzip2_bad_block_magic         =2;
-      bzip2_endoffile               =3;
-      bzip2_data_error              =4;
 
 implementation
 
@@ -115,41 +91,6 @@ implementation
   {$i bzip2i386.inc}
 {$endif}
 
-procedure hb_create_decode_tables(var limit,base,perm:array of cardinal;
-                                  var length:array of byte;
-                                  minlen,maxlen:byte;alphasize:cardinal);
-
-var pp,i,j,vec:cardinal;
-
-begin
-  pp:=0;
-  for i:=minlen to maxlen do
-    for j:=0 to alphasize-1 do
-      if length[j]=i then
-        begin
-          perm[pp]:=j;
-          inc(pp);
-        end;
-  for i:=0 to max_code_len-1 do
-    begin
-      base[i]:=0;
-      limit[i]:=0;
-    end;
-  for i:=0 to alphasize-1 do
-    inc(base[length[i]+1]);
-  for i:=1 to max_code_len-1 do
-    inc(base[i],base[i-1]);
-  vec:=0;
-  for i:=minlen to maxlen do
-    begin
-      inc(vec,base[i+1]-base[i]);
-      limit[i]:=vec-1;
-      vec:=vec shl 1;
-    end;
-  for i:=minlen+1 to maxlen do
-    base[i]:=((limit[i-1]+1) shl 1)-base[i];
-end;
-
 {*****************************************************************************
                              Tbzip2_decode_stream
 *****************************************************************************}

+ 76 - 0
packages/bzip2/src/bzip2comn.pp

@@ -0,0 +1,76 @@
+unit bzip2comn;
+
+interface
+
+const 
+  max_groups     = 6;
+  max_alpha_size = 258;
+  max_code_len   = 23;
+  group_size     = 50;
+  iter_count     = 4;
+  max_selectors  = 2+(900000 div group_size);
+
+  mtfa_size      = 4096;
+  mtfl_size      = 16;
+
+type
+  TCardinal_array = array [0..899999] of Cardinal;
+  PCardinal_array = ^TCardinal_array;
+
+  PCardinal  = ^Cardinal;
+  Thuffarray = array[0..max_alpha_size] of Cardinal;
+  Phuffarray = ^Thuffarray;
+
+{A bzip2 stream starts with this:}
+const bzip2_stream_magic='BZh';
+
+{Error codes for stream errorinfo.}
+const 
+  bzip2_bad_header_magic        = 1;
+  bzip2_bad_block_magic         = 2;
+  bzip2_endoffile               = 3;
+  bzip2_data_error              = 4;
+
+procedure hb_create_decode_tables(var limit,base,perm:array of cardinal;
+                                  var length:array of byte;
+                                  minlen,maxlen:byte;alphasize:cardinal);
+
+
+implementation
+
+procedure hb_create_decode_tables(var limit,base,perm:array of cardinal;
+                                  var length:array of byte;
+                                  minlen,maxlen:byte;alphasize:cardinal);
+
+var pp,i,j,vec:cardinal;
+
+begin
+  pp:=0;
+  for i:=minlen to maxlen do
+    for j:=0 to alphasize-1 do
+      if length[j]=i then
+        begin
+          perm[pp]:=j;
+          inc(pp);
+        end;
+  for i:=0 to max_code_len-1 do
+    begin
+      base[i]:=0;
+      limit[i]:=0;
+    end;
+  for i:=0 to alphasize-1 do
+    inc(base[length[i]+1]);
+  for i:=1 to max_code_len-1 do
+    inc(base[i],base[i-1]);
+  vec:=0;
+  for i:=minlen to maxlen do
+    begin
+      inc(vec,base[i+1]-base[i]);
+      limit[i]:=vec-1;
+      vec:=vec shl 1;
+    end;
+  for i:=minlen+1 to maxlen do
+    base[i]:=((limit[i-1]+1) shl 1)-base[i];
+end;
+
+end.

+ 31 - 0
packages/bzip2/src/bzip2si386.inc

@@ -0,0 +1,31 @@
+{$ASMMODE intel}
+
+{$define HAVE_DETRANSFORM}
+
+procedure TDecompressBzip2Stream.detransform;assembler;
+
+asm
+{  mov edx,offset c
+  call mcount}
+  xor edx,edx
+  lea ebx,[esi+TDecompressBzip2Stream.cftab]
+  mov ecx,[esi+TDecompressBzip2Stream.tt_count]
+  push esi
+  push ebp
+  mov esi,[esi+TDecompressBzip2Stream.tt]
+  mov edi,esi
+  lea ebp,[4*ecx+esi]
+  jmp @a2
+@a1:
+  movzx eax,byte [esi]
+  mov ecx,[ebx+4*eax]
+  inc dword [ebx+4*eax]
+  or [edi+4*ecx],edx
+  add edx,$100
+  add esi,4
+@a2:
+  cmp esi,ebp
+  jne @a1
+  pop ebp
+  pop esi
+end ['eax','ebx','ecx','edx','edi'];

+ 668 - 0
packages/bzip2/src/bzip2stream.pp

@@ -0,0 +1,668 @@
+{$mode objfpc}
+{$h+}
+unit bzip2stream;
+{****************************************************************************
+
+                             BZIP2 decompression unit
+
+                        Copyright (C) 2002 by Daniel Mantione
+                        Class port (C) 2009 by Michael Van Canneyt
+
+This unit provides a decompression stream to decode .bz2 files. It is
+inpired by Julian R. Seward's libbzip2 library and therefore you should
+send credits to him and bug reports to me :)
+
+This code is licensed under the same terms as the original libbz2 library,
+which is decsribed in the file LICENSE. If you don't have this file, look
+at http://www.freepascal.org for this bzip2 unit, the LICENSE file will
+be included. In case of problems, contact the author.
+
+E-mail addresses:
+
+Michael Van Canneyt <[email protected]>
+Daniel Mantione     <[email protected]>
+Julian R. Seward    <[email protected]>
+
+Please do not contact Julian about this Pascal library, he didn't wrote it.
+
+****************************************************************************}
+interface
+
+{$goto on}
+
+uses Classes,SysUtils, bzip2comn;
+
+Type
+  TDecompressBzip2Stream=Class(TOwnerStream)
+  Private
+    block_randomized:boolean;
+    blocksize:byte;
+    tt:Pcardinal_array;
+    tt_count:cardinal;
+    rle_run_left,rle_run_data:byte;
+    nextrle:Pbyte;
+    decode_available:cardinal;
+    block_origin:cardinal;
+    current_block:cardinal;
+    read_data,bits_available:byte;
+    inuse16:set of 0..15;
+    inuse:set of 0..255;
+    inuse_count:cardinal;
+    seq_to_unseq:array[0..255] of byte;
+    alphasize:cardinal;
+    group_count,group_pos,gsel,gminlen:byte;
+    group_no:cardinal;
+    glimit,gperm,gbase:Phuffarray;
+    selector_count:cardinal;
+    selector,selector_mtf:array[0..max_selectors] of byte;
+    len:array[0..max_groups,0..max_alpha_size] of byte;
+    limit:array[0..max_groups,0..max_alpha_size] of cardinal;
+    base:array[0..max_groups,0..max_alpha_size] of cardinal;
+    perm:array[0..max_groups,0..max_alpha_size] of cardinal;
+    minlens:array[0..max_groups] of byte;
+    cftab:array[0..257] of cardinal;
+    mtfbase:array[0..256 div mtfl_size-1] of cardinal;
+    mtfa:array[0..mtfa_size-1] of byte;
+    
+    function get_bits(n:byte):byte;
+    function get_boolean:boolean;
+    function get_byte:byte;
+    function get_cardinal24:cardinal;
+    function get_cardinal:cardinal;
+    procedure receive_mapping_table;
+    procedure receive_selectors;
+    procedure undo_mtf_values;
+    procedure receive_coding_tables;
+    procedure make_hufftab;
+    procedure init_mtf;
+    function get_mtf_value:cardinal;
+    procedure move_mtf_block;
+    procedure receive_mtf_values;
+    procedure detransform;
+    function decode_block : boolean;
+    Function new_block : boolean;
+    Function consume_rle : Boolean; inline;
+    Function rle_read(bufptr:Pbyte;count:Longint) : longint;
+    Procedure Error(Msg : String; ACode : Integer);
+  Public  
+    Constructor Create(ASource : TStream);
+    Destructor Destroy; override;
+    function Read(var Buffer; Count: Longint): Longint; override;
+  end;
+  
+  EBzip2 = Class(Exception)
+    ErrCode : Integer;
+  end;
+
+implementation
+
+{$ifdef i386}
+  {$i bzip2si386.inc}
+{$endif}
+
+{*****************************************************************************
+                             TDecompressBzip2Stream
+*****************************************************************************}
+
+Resourcestring
+  BZip2Initialize   = 'Invalid BZip2 stream: invalid header';
+  SDecodingError    = 'Decoding error';
+  SErrUnimplemented = 'Feature not implemented';
+  
+Constructor TDecompressBzip2Stream.Create(ASource: TStream);
+
+var magic:array[1..3] of char;
+    c:char;
+
+begin
+  Inherited Create(ASource);
+  {Read the magic.}
+  Source.ReadBuffer(magic,sizeof(magic));
+  if magic<>bzip2_stream_magic then
+    Error(BZip2Initialize,bzip2_bad_header_magic);
+  {Read the block size and allocate the working array.}
+  Source.ReadBuffer(c,1);
+  blocksize:=byte(c)-byte('0');
+  GetMem(tt,blocksize*100000*sizeof(cardinal));
+  decode_available:=high(decode_available);
+end;
+
+Procedure TDecompressBzip2Stream.Error(Msg : String; ACode : Integer);
+
+Var
+  BE : EBzip2;
+
+begin
+  BE:=EBzip2.Create(Msg);
+  BE.ErrCode:=ACode;
+  Raise BE;
+end;
+   
+function TDecompressBzip2Stream.get_bits(n:byte):byte;
+
+var data:byte;
+
+begin
+  if n>bits_available then
+    begin
+      Source.ReadBuffer(data,1);
+      get_bits:=(read_data shr (8-n)) or data shr (8-(n-bits_available));
+      read_data:=data shl (n-bits_available);
+      inc(bits_available,8);
+    end
+  else
+    begin
+      get_bits:=read_data shr (8-n);
+      read_data:=read_data shl n;
+    end;
+  dec(bits_available,n);
+end;
+
+function TDecompressBzip2Stream.get_boolean:boolean;
+
+begin
+  get_boolean:=boolean(get_bits(1));
+end;
+
+function TDecompressBzip2Stream.get_byte:byte;
+
+begin
+  get_byte:=get_bits(8);
+end;
+
+function TDecompressBzip2Stream.get_cardinal24:cardinal;
+
+begin
+  get_cardinal24:=get_bits(8) shl 16 or get_bits(8) shl 8 or get_bits(8);
+end;
+
+
+function TDecompressBzip2Stream.get_cardinal:cardinal;
+
+begin
+  get_cardinal:=get_bits(8) shl 24 or get_bits(8) shl 16 or get_bits(8) shl 8 or
+                get_bits(8);
+end;
+
+procedure TDecompressBzip2Stream.receive_mapping_table;
+
+{Receive the mapping table. To save space, the inuse set is stored in pieces
+ of 16 bits. First 16 bits are stored which pieces of 16 bits are used, then
+ the pieces follow.}
+
+var i,j:byte;
+
+begin
+  inuse16:=[];
+  {Receive the first 16 bits which tell which pieces are stored.}
+  for i:=0 to 15 do
+    if get_boolean then
+      include(inuse16,i);
+
+  {Receive the used pieces.}
+  inuse:=[];
+  inuse_count:=0;
+  for i:=0 to 15 do
+    if i in inuse16 then
+      for j:=0 to 15 do
+        if get_boolean then
+          begin
+            include(inuse,16*i+j);
+            seq_to_unseq[inuse_count]:=16*i+j;
+            inc(inuse_count);
+          end;
+{  system.write('Mapping table: ');
+  for i:=0 to 255 do
+    if i in inuse then
+      system.write(i,' ');
+  writeln;}
+end;
+
+procedure TDecompressBzip2Stream.receive_selectors;
+
+{Receives the selectors.}
+
+var i:cardinal;
+    j:byte;
+
+begin
+  group_count:=get_bits(3);
+  selector_count:=get_bits(8) shl 7 or get_bits(7);
+  for i:=0 to selector_count-1 do
+    begin
+      j:=0;
+      while get_boolean do
+        begin
+          inc(j);
+          if j>5 then
+            error(SDecodingError,bzip2_data_error);
+        end;
+      selector_mtf[i]:=j;
+    end;
+{  system.write('Selector_mtf: ');
+  for i:=0 to selector_count-1 do
+    system.write(selector_mtf[i],' ');
+  writeln;}
+end;
+
+procedure TDecompressBzip2Stream.undo_mtf_values;
+
+{Undo the MTF values for the selectors.}
+
+var pos:array[0..max_groups] of byte;
+    i:cardinal;
+    v,tmp:byte;
+
+begin
+  for v:=0 to group_count-1 do
+    pos[v]:=v;
+  for i:=0 to selector_count-1 do
+    begin
+      v:=selector_mtf[i];
+      tmp:=pos[v];
+      while v<>0 do
+        begin
+          pos[v]:=pos[v-1];
+          dec(v);
+        end;
+      pos[0]:=tmp;
+      selector[i]:=tmp;
+    end;
+end;
+
+procedure TDecompressBzip2Stream.receive_coding_tables;
+
+var t,curr:byte;
+    i:cardinal;
+
+begin
+  for t:=0 to group_count-1 do
+    begin
+      curr:=get_bits(5);
+      for i:=0 to alphasize-1 do
+        begin
+          repeat
+            if not(curr in [1..20]) then
+              error(SDecodingError,bzip2_data_error);
+            if not get_boolean then
+              break;
+            if get_boolean then
+              dec(curr)
+            else
+              inc(curr);
+          until false;
+          len[t,i]:=curr;
+        end;
+    end;
+end;
+
+procedure TDecompressBzip2Stream.make_hufftab;
+
+{Builds the Huffman tables.}
+
+var i:cardinal;
+    t,minlen,maxlen:byte;
+
+begin
+  for t:=0 to group_count-1 do
+    begin
+      minlen:=32;
+      maxlen:=0;
+      for i:=0 to alphasize-1 do
+        begin
+          if len[t,i]>maxlen then
+            maxlen:=len[t,i];
+          if len[t,i]<minlen then
+            minlen:=len[t,i];
+        end;
+      hb_create_decode_tables(limit[t],base[t],perm[t],len[t],
+                              minlen,maxlen,alphasize);
+      minlens[t]:=minlen;
+    end;
+end;
+
+procedure TDecompressBzip2Stream.init_mtf;
+
+var i,j:byte;
+    k:cardinal;
+
+begin
+  k:=mtfa_size-1;
+  for i:=256 div mtfl_size-1 downto 0 do
+    begin
+      for j:=mtfl_size-1 downto 0 do
+        begin
+          mtfa[k]:=i*mtfl_size+j;
+          dec(k);
+        end;
+      mtfbase[i]:=k+1;
+    end;
+end;
+
+function TDecompressBzip2Stream.get_mtf_value:cardinal;
+
+var zn:byte;
+    zvec:cardinal;
+
+begin
+  if group_pos=0 then
+    begin
+      inc(group_no);
+      group_pos:=group_size;
+      gsel:=selector[group_no];
+      gminlen:=minlens[gsel];
+      glimit:=@limit[gsel];
+      gperm:=@perm[gsel];
+      gbase:=@base[gsel];
+    end;
+  dec(group_pos);
+  zn:=gminlen;
+  zvec:=get_bits(zn);
+  while zvec>glimit^[zn] do
+    begin
+      inc(zn);
+      zvec:=zvec shl 1 or byte(get_boolean);
+    end;
+  get_mtf_value:=gperm^[zvec-gbase^[zn]];
+end;
+
+procedure TDecompressBzip2Stream.move_mtf_block;
+
+var i:byte;
+    j,k:cardinal;
+
+begin
+  k:=MTFA_SIZE;
+  for i:=256 div MTFL_SIZE-1 downto 0 do
+    begin
+      j:=mtfbase[i];
+      Pcardinal(@mtfa[k- 4])^:=Pcardinal(@mtfa[j+12])^;
+      Pcardinal(@mtfa[k- 8])^:=Pcardinal(@mtfa[j+ 8])^;
+      Pcardinal(@mtfa[k-12])^:=Pcardinal(@mtfa[j+ 4])^;
+      dec(k,16);
+      Pcardinal(@mtfa[k   ])^:=Pcardinal(@mtfa[j   ])^;
+      mtfbase[i]:=k;
+    end;
+end;
+
+procedure TDecompressBzip2Stream.receive_mtf_values;
+
+const run_a=0;
+      run_b=1;
+
+var t,next_sym:cardinal;
+    es:cardinal;
+    n:byte;
+    nn,i:cardinal;
+    p,q:Pbyte;
+    u,v:Pcardinal;
+    lno,off:cardinal;
+
+begin
+  group_no:=high(group_no);
+  group_pos:=0;
+  t:=0;
+  for i:=0 to 257 do
+    cftab[i]:=0;
+  init_mtf;
+  next_sym:=get_mtf_value;
+  while next_sym<>inuse_count+1 do
+    begin
+{      writeln(t,'   ',next_sym);
+      if t=22296 then
+        t:=t;                    }
+      if next_sym<=run_b then
+        begin
+          es:=0;
+          n:=0;
+          repeat
+            inc(es,(next_sym+1) shl n);
+            inc(n);
+            next_sym:=get_mtf_value;
+          until next_sym>run_b;
+          n:=seq_to_unseq[mtfa[mtfbase[0]]];
+          inc(cftab[n],es);
+          if t+es>100000*blocksize then
+            error(SDecodingError,bzip2_data_error);
+          while es>0 do
+            begin
+              tt^[t]:=n;
+              dec(es);
+              inc(t);
+            end;
+        end
+      else
+        begin
+          nn:=next_sym-1;
+          if nn<mtfl_size then
+            begin
+              {Avoid the costs of the general case.}
+              p:=@mtfa[mtfbase[0]];
+              q:=p+nn;
+              n:=q^;
+              repeat
+                q^:=(q-1)^;
+                dec(q);
+              until q=p;
+              q^:=n;
+            end
+          else
+            begin
+              {General case.}
+              lno:=nn div MTFL_SIZE;
+              off:=nn and (MTFL_SIZE-1);
+              p:=@mtfa[mtfbase[lno]];
+              q:=p+off;
+              n:=q^;
+              while(q<>p) do
+                begin
+                  q^:=(q-1)^;
+                  dec(q);
+                end;
+              u:=@mtfbase;
+              v:=u+lno;
+              repeat
+                mtfa[v^]:=mtfa[(v-1)^+MTFL_SIZE-1];
+                dec(v);
+                dec(v^);
+              until v=u;
+              mtfa[v^]:=n;
+              if v^=0 then
+                move_mtf_block;
+            end;
+          inc(cftab[seq_to_unseq[n]]);
+          tt^[t]:=cardinal(seq_to_unseq[n]);
+          inc(t);
+          if t>100000*blocksize then
+            error(SDecodingError,bzip2_data_error);
+          next_sym:=get_mtf_value;
+        end;
+    end;
+    tt_count:=t;
+  {Setup cftab to facilitate generation of T^(-1).}
+  t:=0;
+  for i:=0 to 256 do
+    begin
+      nn:=cftab[i];
+      cftab[i]:=t;
+{      writeln(i,' ',t);}
+      inc(t,nn);
+    end;
+end;
+
+{$ifndef HAVE_DETRANSFORM}
+
+procedure TDecompressBzip2Stream.detransform;
+
+var a:cardinal;
+    p,q,r:Pcardinal;
+
+begin
+  a:=0;
+  p:=@tt^[0];
+  q:=p+tt_count;
+  while p<>q do
+    begin
+      r:=@tt^[cftab[p^ and $ff]];
+      inc(cftab[p^ and $ff]);
+      r^:=r^ or a;
+      inc(a,256);
+      inc(p);
+    end;
+end;
+
+{$endif}
+
+function TDecompressBzip2Stream.decode_block:boolean;
+
+{Decode a new compressed block.}
+
+var magic:array[1..6] of char;
+    stored_blockcrc:cardinal;
+    i:byte;
+
+begin
+  for i:=1 to 6 do
+    magic[i]:=char(get_byte);
+  if magic='1AY&SY' then
+    begin
+      inc(current_block);
+      stored_blockcrc:=get_cardinal;
+      block_randomized:=get_boolean;
+      block_origin:=get_cardinal24;
+
+      {Receive the mapping table.}
+      receive_mapping_table;
+      alphasize:=cardinal(inuse_count)+2;
+      
+      {Receive the selectors. Raises exception}
+      receive_selectors;
+      {Undo the MTF values for the selectors.}
+      undo_mtf_values;
+      {Receive the coding tables.}
+      receive_coding_tables;
+      {Build the Huffman tables.}
+      make_hufftab;
+      {Receive the MTF values.}
+      receive_mtf_values;
+      {Undo the Burrows Wheeler transformation.}
+      detransform;
+      decode_available:=tt_count;
+      Result:=True;
+    end
+  else
+    begin
+      if magic<>#$17'rE8P'#$90 then
+        error(SDecodingError,bzip2_bad_block_magic);
+      Result:=false;
+    end;
+end;
+
+Function TDecompressBzip2Stream.new_block : Boolean;
+
+begin
+  Result:=decode_block;
+  If result then
+    nextrle:=@tt^[tt^[block_origin] shr 8]
+  else
+    nextrle:=nil;
+end;
+
+Function TDecompressBzip2Stream.consume_rle : Boolean;inline;
+
+{Make nextrle point to the next decoded byte. If nextrle did point to the last
+ byte in the current block, decode the next block.}
+
+begin
+{  Pcardinal(nextrle)^:=Pcardinal(nextrle)^ shr 8;}
+  nextrle:=@tt^[Pcardinal(nextrle)^ shr 8];
+  dec(decode_available);
+  if decode_available=0 then
+    Result:=new_block
+  else
+    Result:=True;  
+end;
+
+Function TDecompressBzip2Stream.rle_read(bufptr:Pbyte;Count:Longint) : LongInt;
+
+var rle_len:cardinal;
+    data:byte;
+
+label rle_write;
+
+begin
+  Result:=0;
+  rle_len:=rle_run_left;
+  data:=rle_run_data;
+  if block_randomized then
+    {Not yet implemented.}
+    Error(SErrUnimplemented,-1)
+  else
+    begin
+      if rle_len<>0 then
+        {Speed is important. Instead of an if statement within the
+         repeat loop use a goto outside the loop.}
+        goto rle_write;
+      repeat
+        if decode_available=0 then
+          break;
+        rle_len:=1;
+        data:=nextrle^;
+        if consume_rle and (decode_available>0) and (data=nextrle^) then
+          begin
+            inc(rle_len);
+            if consume_rle and (decode_available>0) and (data=nextrle^) then
+              begin
+                inc(rle_len);
+                if consume_rle and (decode_available>0) and (data=nextrle^) then
+                  begin
+                  if consume_rle then
+                    inc(rle_len,nextrle^+1);
+                  consume_rle;
+                  end;
+                end;
+            end;
+rle_write:
+        repeat
+            bufptr^:=data;
+            inc(bufptr);
+            dec(count);
+            dec(rle_len);
+            inc(Result);
+        until (rle_len=0) or (count=0);
+      until count=0;
+    end;
+  rle_run_data:=data;
+  rle_run_left:=rle_len;
+end;
+
+Function TDecompressBzip2Stream.Read(var Buffer; Count : Longint) : LongInt;
+
+var bufptr:Pbyte;
+
+begin
+  bufptr:=@buffer;
+  if decode_available=high(decode_available) then
+    begin
+      {Initialize the rle process:
+        - Decode a block
+        - Initialize pointer.}
+      if not decode_block then
+        begin
+        nextrle:=nil;
+        error(SDecodingError,bzip2_endoffile);
+        end;
+      nextrle:=@tt^[tt^[block_origin] shr 8];
+    end;
+  Result:=rle_read(bufptr,count);
+end;
+
+Destructor TDecompressBzip2Stream.Destroy;
+
+begin
+  if tt<>nil then
+    FreeMem(tt,blocksize*100000*sizeof(cardinal));
+  Inherited;
+end;
+
+end.

+ 14 - 1
packages/cairo/src/cairo.pp

@@ -55,7 +55,20 @@ interface
 Uses CTypes;
 
 const
-  LIB_CAIRO = 'cairo';
+{$ifdef win32}
+  LIB_CAIRO = 'libcairo-2.dll';
+  {$IFDEF FPC}
+    {$ifndef NO_SMART_LINK}
+      {$smartlink on}
+    {$endif}
+  {$ENDIF}
+{$else}
+  {$ifdef UseCustomLibs}
+  LIB_CAIRO = '';
+  {$else}
+  LIB_CAIRO = 'libcairo.so.2';
+  {$endif}
+{$endif}
 
 {$IFDEF FPC}
   {$PACKRECORDS C}

+ 2350 - 0
packages/fastcgi/Makefile

@@ -0,0 +1,2350 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/07/19]
+#
+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 m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx
+LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override DEFAULT_FPCDIR=../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
+FPC:=$(shell $(FPCPROG) -PB)
+endif
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+else
+ifeq ($(strip $(wildcard $(FPC))),)
+FPC:=$(firstword $(FPCPROG))
+endif
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifneq ($(words $(FPC_COMPILERINFO)),5)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifeq ($(CPU_TARGET),armeb)
+ARCH=arm
+override FPCOPT+=-Cb
+else
+ifeq ($(CPU_TARGET),armel)
+ARCH=arm
+override FPCOPT+=-CaEABI
+else
+ARCH=$(CPU_TARGET)
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifeq ($(OS_TARGET),darwin)
+ifeq ($(OS_SOURCE),darwin)
+DARWIN2DARWIN=1
+endif
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+ifndef DARWIN2DARWIN
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+override PACKAGE_NAME=fastcgi
+override PACKAGE_VERSION=2.2.2
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_UNITS+=fastcgi
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_UNITS+=fastcgi
+endif
+override INSTALL_FPCPACKAGE=y
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override COMPILER_OPTIONS+=-S2h
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),emx)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=emx
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),morphos)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=mos
+endif
+ifeq ($(OS_TARGET),atari)
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),haiku)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=hai
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),darwin)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=dwn
+endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+else
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+PPUEXT=.ppw
+OEXT=.ow
+ASMEXT=.sw
+SMARTEXT=.slw
+STATICLIBEXT=.aw
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+PPUEXT=.ppo
+ASMEXT=.so2
+OEXT=.oo2
+AOUTEXT=.out
+SMARTEXT=.sl2
+STATICLIBPREFIX=
+STATICLIBEXT=.ao2
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),atari)
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+FPCMADE=fpcmade.$(SHORTSUFFIX)
+ZIPSUFFIX=$(SHORTSUFFIX)
+ZIPCROSSPREFIX=
+ZIPSOURCESUFFIX=src
+ZIPEXAMPLESUFFIX=exm
+else
+FPCMADE=fpcmade.$(TARGETSUFFIX)
+ZIPSOURCESUFFIX=.source
+ZIPEXAMPLESUFFIX=.examples
+ifdef CROSSCOMPILE
+ZIPSUFFIX=.$(SOURCESUFFIX)
+ZIPCROSSPREFIX=$(TARGETSUFFIX)-
+else
+ZIPSUFFIX=.$(TARGETSUFFIX)
+ZIPCROSSPREFIX=
+endif
+endif
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO= __missing_command_ECHO
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE= __missing_command_DATE
+else
+DATE:=$(firstword $(DATE))
+endif
+else
+DATE:=$(firstword $(DATE))
+endif
+endif
+export DATE
+ifndef GINSTALL
+GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL= __missing_command_GINSTALL
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+endif
+export GINSTALL
+ifndef CPPROG
+CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(CPPROG),)
+CPPROG= __missing_command_CPPROG
+else
+CPPROG:=$(firstword $(CPPROG))
+endif
+endif
+export CPPROG
+ifndef RMPROG
+RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(RMPROG),)
+RMPROG= __missing_command_RMPROG
+else
+RMPROG:=$(firstword $(RMPROG))
+endif
+endif
+export RMPROG
+ifndef MVPROG
+MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MVPROG),)
+MVPROG= __missing_command_MVPROG
+else
+MVPROG:=$(firstword $(MVPROG))
+endif
+endif
+export MVPROG
+ifndef MKDIRPROG
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG= __missing_command_MKDIRPROG
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+endif
+export MKDIRPROG
+ifndef ECHOREDIR
+ifndef inUnix
+ECHOREDIR=echo
+else
+ECHOREDIR=$(ECHO)
+endif
+endif
+ifndef COPY
+COPY:=$(CPPROG) -fp
+endif
+ifndef COPYTREE
+COPYTREE:=$(CPPROG) -Rfp
+endif
+ifndef MKDIRTREE
+MKDIRTREE:=$(MKDIRPROG) -p
+endif
+ifndef MOVE
+MOVE:=$(MVPROG) -f
+endif
+ifndef DEL
+DEL:=$(RMPROG) -f
+endif
+ifndef DELTREE
+DELTREE:=$(RMPROG) -rf
+endif
+ifndef INSTALL
+ifdef inUnix
+INSTALL:=$(GINSTALL) -c -m 644
+else
+INSTALL:=$(COPY)
+endif
+endif
+ifndef INSTALLEXE
+ifdef inUnix
+INSTALLEXE:=$(GINSTALL) -c -m 755
+else
+INSTALLEXE:=$(COPY)
+endif
+endif
+ifndef MKDIR
+MKDIR:=$(GINSTALL) -m 755 -d
+endif
+export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE= __missing_command_PPUMOVE
+else
+PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+export PPUMOVE
+ifndef FPCMAKE
+FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(FPCMAKE),)
+FPCMAKE= __missing_command_FPCMAKE
+else
+FPCMAKE:=$(firstword $(FPCMAKE))
+endif
+endif
+export FPCMAKE
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG= __missing_command_ZIPPROG
+else
+ZIPPROG:=$(firstword $(ZIPPROG))
+endif
+endif
+export ZIPPROG
+ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG= __missing_command_TARPROG
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+endif
+export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),win32)
+ifeq ($(CROSSBINDIR),)
+ASNAME=asw
+LDNAME=ldw
+ARNAME=arw
+endif
+endif
+endif
+ifndef ASPROG
+ifdef CROSSBINDIR
+ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
+else
+ASPROG=$(ASNAME)
+endif
+endif
+ifndef LDPROG
+ifdef CROSSBINDIR
+LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
+else
+LDPROG=$(LDNAME)
+endif
+endif
+ifndef RCPROG
+ifdef CROSSBINDIR
+RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
+else
+RCPROG=$(RCNAME)
+endif
+endif
+ifndef ARPROG
+ifdef CROSSBINDIR
+ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
+else
+ARPROG=$(ARNAME)
+endif
+endif
+AS=$(ASPROG)
+LD=$(LDPROG)
+RC=$(RCPROG)
+AR=$(ARPROG)
+PPAS=ppas$(SRCBATCHEXT)
+ifdef inUnix
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+ifndef UPXPROG
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+export UPXPROG
+ZIPOPT=-9
+ZIPEXT=.zip
+ifeq ($(USETAR),bz2)
+TAROPT=vj
+TAREXT=.tar.bz2
+else
+TAROPT=vz
+TAREXT=.tar.gz
+endif
+override REQUIRE_PACKAGES=rtl 
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifdef REQUIRE_PACKAGES_RTL
+PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_RTL),)
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
+UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
+else
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_RTL)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_RTL=
+UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_RTL),)
+UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override COMPILER_UNITDIR+=$(UNITDIR_RTL)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(ARCH)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(ARCH)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX)
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O2
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),linux)
+ifeq ($(CPU_TARGET),x86_64)
+override FPCOPT+=-Cg
+endif
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
+EXECPPAS:=@$(PPAS)
+endif
+endif
+endif
+.PHONY: fpc_units
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
+override ALLTARGET+=fpc_units
+override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
+override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
+override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+endif
+fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+	@$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+	$(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+	$(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(PPUEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.lpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.inc $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_distinstall
+fpc_distinstall: install exampleinstall
+.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
+ifndef PACKDIR
+ifndef inUnix
+PACKDIR=$(BASEDIR)/../fpc-pack
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+ifndef ZIPNAME
+ifdef DIST_ZIPNAME
+ZIPNAME=$(DIST_ZIPNAME)
+else
+ZIPNAME=$(PACKAGE_NAME)
+endif
+endif
+ifndef FULLZIPNAME
+FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
+endif
+ifndef ZIPTARGET
+ifdef DIST_ZIPTARGET
+ZIPTARGET=DIST_ZIPTARGET
+else
+ZIPTARGET=install
+endif
+endif
+ifndef USEZIP
+ifdef inUnix
+USETAR=1
+endif
+endif
+ifndef inUnix
+USEZIPWRAPPER=1
+endif
+ifdef USEZIPWRAPPER
+ZIPPATHSEP=$(PATHSEP)
+ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
+else
+ZIPPATHSEP=/
+endif
+ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
+ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
+ifdef USETAR
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
+ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
+else
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
+ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
+endif
+fpc_zipinstall:
+	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
+	$(MKDIR) $(DIST_DESTDIR)
+	$(DEL) $(ZIPDESTFILE)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
+else
+	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
+	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
+	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
+endif
+ifdef inUnix
+	/bin/sh $(ZIPWRAPPER)
+else
+ifdef RUNBATCH
+	$(RUNBATCH) $(ZIPWRAPPER)
+else
+	$(ZIPWRAPPER)
+endif
+endif
+	$(DEL) $(ZIPWRAPPER)
+else
+	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
+endif
+	$(DELTREE) $(PACKDIR)
+fpc_zipsourceinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
+fpc_zipexampleinstall:
+ifdef HASEXAMPLES
+	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
+endif
+fpc_zipdistinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+endif
+ifdef CLEAN_UNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
+endif
+ifdef CLEANPPUFILES
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
+override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+	-$(DELTREE) units
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+	-$(DEL) *.o *.ppu *.a
+endif
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *_ppas$(BATCHEXT)
+ifdef AOUTEXT
+	-$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+	-$(DEL) *$(DEBUGSYMEXT)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+	@$(ECHO)
+	@$(ECHO)  == Package info ==
+	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
+	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC.......... $(FPC)
+	@$(ECHO)  FPC Version.. $(FPC_VERSION)
+	@$(ECHO)  Source CPU... $(CPU_SOURCE)
+	@$(ECHO)  Target CPU... $(CPU_TARGET)
+	@$(ECHO)  Source OS.... $(OS_SOURCE)
+	@$(ECHO)  Target OS.... $(OS_TARGET)
+	@$(ECHO)  Full Source.. $(FULL_SOURCE)
+	@$(ECHO)  Full Target.. $(FULL_TARGET)
+	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
+	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
+	@$(ECHO)
+	@$(ECHO)  == Directory info ==
+	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
+	@$(ECHO)  Basedir......... $(BASEDIR)
+	@$(ECHO)  FPCDir.......... $(FPCDIR)
+	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
+	@$(ECHO)  UnitsDir........ $(UNITSDIR)
+	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
+	@$(ECHO)
+	@$(ECHO)  GCC library..... $(GCCLIBDIR)
+	@$(ECHO)  Other library... $(OTHERLIBDIR)
+	@$(ECHO)
+	@$(ECHO)  == Tools info ==
+	@$(ECHO)
+	@$(ECHO)  As........ $(AS)
+	@$(ECHO)  Ld........ $(LD)
+	@$(ECHO)  Ar........ $(AR)
+	@$(ECHO)  Rc........ $(RC)
+	@$(ECHO)
+	@$(ECHO)  Mv........ $(MVPROG)
+	@$(ECHO)  Cp........ $(CPPROG)
+	@$(ECHO)  Rm........ $(RMPROG)
+	@$(ECHO)  GInstall.. $(GINSTALL)
+	@$(ECHO)  Echo...... $(ECHO)
+	@$(ECHO)  Shell..... $(SHELL)
+	@$(ECHO)  Date...... $(DATE)
+	@$(ECHO)  FPCMake... $(FPCMAKE)
+	@$(ECHO)  PPUMove... $(PPUMOVE)
+	@$(ECHO)  Upx....... $(UPXPROG)
+	@$(ECHO)  Zip....... $(ZIPPROG)
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)
+	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
+	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
+	@$(ECHO)
+	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
+	@$(ECHO)  Install Files....... $(INSTALL_FILES)
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+	@$(ECHO)  DateStr.............. $(DATESTR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
+	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
+	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
+	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
+	@$(ECHO)
+	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
+	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
+	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
+	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
+	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
+	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
+	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
+	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
+	@$(ECHO)
+	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
+	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
+	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+all: fpc_all
+debug: fpc_debug
+smart: fpc_smart
+release: fpc_release
+units: fpc_units
+examples:
+shared: fpc_shared
+install: fpc_install
+sourceinstall: fpc_sourceinstall
+exampleinstall: fpc_exampleinstall
+distinstall: fpc_distinstall
+zipinstall: fpc_zipinstall
+zipsourceinstall: fpc_zipsourceinstall
+zipexampleinstall: fpc_zipexampleinstall
+zipdistinstall: fpc_zipdistinstall
+clean: fpc_clean
+distclean: fpc_distclean
+cleanall: fpc_cleanall
+info: fpc_info
+makefiles: fpc_makefiles
+.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+.NOTPARALLEL:

+ 24 - 0
packages/fastcgi/Makefile.fpc

@@ -0,0 +1,24 @@
+#
+#   Makefile.fpc for FastCGI
+#
+
+[package]
+name=fastcgi
+version=2.2.2
+
+[target]
+units=fastcgi
+
+[compiler]
+options=-S2h
+sourcedir=src
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../..
+
+
+[rules]
+.NOTPARALLEL:

+ 35 - 0
packages/fastcgi/fpmake.pp

@@ -0,0 +1,35 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+
+Var
+  T : TTarget;
+  P : TPackage;
+begin
+  With Installer do
+    begin
+{$endif ALLPACKAGES}
+
+    P:=AddPackage('fastcgi');
+{$ifdef ALLPACKAGES}
+    P.Directory:='fastcgi';
+{$endif ALLPACKAGES}
+    P.Version:='2.2.2-0';
+
+    P.Author := 'FreePascal development team';
+    P.License := 'LGPL with modification, ';
+    P.HomepageURL := 'www.freepascal.org';
+    P.Email := '';
+    P.Description := 'FastCGI header translation to Pascal';
+    P.NeedLibC:= false;
+
+    P.SourcePath.Add('src');
+
+    T:=P.Targets.AddUnit('fastcgi.pp');
+{$ifndef ALLPACKAGES}
+    Run;
+    end;
+end.
+{$endif ALLPACKAGES}

+ 0 - 0
packages/fcl-web/src/fastcgi.pp → packages/fastcgi/src/fastcgi.pp


+ 146 - 0
packages/fcl-base/src/ascii85.pp

@@ -73,9 +73,155 @@ type
   end;
 
   // TODO encoder...
+  TASCII85EncoderStream = class(TOwnerStream)
+  private
+    FPos,
+    FCount,
+    FTuple : Cardinal;
+    FWidth : Integer;
+    FBoundary : Boolean;
+  protected  
+    Procedure WriteBoundary;
+    Procedure Flush;
+    procedure Encode;
+  public
+    Constructor Create(ADest: TStream; AWidth : Integer = 72; ABoundary : Boolean = False); 
+    Destructor Destroy; Override;
+    function Write(Const aBuffer; aCount : longint) : longint; override;
+    Property Width : Integer Read FWidth;
+    Property Boundary : Boolean Read FBoundary;
+  end;                      
+        
 
 implementation
 
+{ TASCII85EncoderStream }
+
+Procedure TASCII85EncoderStream.WriteBoundary;
+
+Const
+  SBoundary = '<~';
+
+begin
+  Source.Write(SBoundary[1],2);
+  FPos:=2;
+end;
+
+Procedure TASCII85EncoderStream.Encode;
+
+Var
+  S : String[7];
+  I,J : Integer;
+  Buf : Array[0..4] of Byte;
+  
+begin
+  If (FTuple=0) then
+    begin
+    // Write 'z'
+    S:='z';
+    Inc(FPos);
+    If (FPos>FWidth) then
+      begin
+      S:=S+sLineBreak;
+      FPos:=0;
+      end;
+    end
+  else
+    begin  
+    For I:=0 to 4 do
+      begin
+      Buf[i]:=FTuple mod 85;
+      FTuple:=FTuple div 85;
+      end;
+    J:=0;  
+    S:='';
+    For I:=FCount+1 downto 0 do
+      begin
+      Inc(j);
+      S[J]:=Char(Buf[i]+Ord('!'));
+      SetLength(S,J);
+      Inc(FPos);
+      If (FPos>FWidth) then
+        begin
+        FPos:=0;
+        S:=S+sLinebreak;
+        J:=Length(S);
+        end;
+      end;
+    end;
+  Source.Write(S[1],Length(S));
+  FTuple:=0;
+  FCount:=-1;
+end;
+
+
+Procedure TASCII85EncoderStream.Flush;
+
+Const 
+  Boundary1 = '~>'+slinebreak;
+  Boundary2 = slinebreak+Boundary1;
+  
+Var
+  S : String;
+
+begin
+  If FCount>0 then
+    Encode;
+  If FBoundary then
+    begin
+    If FPos+2>FWidth then
+      S:=Boundary2
+    else
+      S:=Boundary1;
+    Source.Write(S[1],Length(S));
+    FBoundary:=False;
+    end;
+end;
+
+Constructor TASCII85EncoderStream.Create(ADest: TStream; AWidth : Integer = 72; ABoundary : Boolean = False);
+
+begin
+  Inherited Create(ADest);
+  FWidth:=AWidth;
+  FBoundary:=ABoundary;
+  If FBoundary then
+    WriteBoundary;
+end;
+
+Destructor TASCII85EncoderStream.Destroy; 
+
+begin
+  Flush;
+  Inherited;
+end;
+
+function TASCII85EncoderStream.Write(Const aBuffer; aCount : longint) : longint;
+
+Var
+  P : PByte;
+  C : Byte;
+  
+begin
+  P:=@Abuffer;  
+  Result:=ACount;
+  While ACount>0 do
+    begin
+    C:=P^;
+    Case FCount of
+      0 : FTuple:=FTuple or (C shl 24);
+      1 : FTuple:=FTuple or (C shl 16);
+      2 : FTuple:=FTuple or (C shl 8);
+      3 : begin
+          FTuple:=FTuple or C;
+          encode;
+          end;
+     end;     
+     Inc(FCount);
+     Inc(P);
+     Dec(ACount);
+     end;
+end;
+                     
 { TRingBuffer }
 
 function TASCII85RingBuffer.GetBufferSize() : Cardinal; inline;

+ 28 - 32
packages/fcl-base/src/base64.pp

@@ -30,14 +30,13 @@ uses classes, sysutils;
 
 type
 
-  TBase64EncodingStream = class(TStream)
+  TBase64EncodingStream = class(TOwnerStream)
   protected
-    OutputStream: TStream;
     TotalBytesProcessed, BytesWritten: LongWord;
     Buf: array[0..2] of Byte;
     BufSize: Integer;    // # of bytes used in Buf
   public
-    constructor Create(AOutputStream: TStream);
+    constructor Create(ASource: TStream);
     destructor Destroy; override;
 
     function Write(const Buffer; Count: Longint): Longint; override;
@@ -60,23 +59,22 @@ type
 
   { TBase64DecodingStream }
 
-  TBase64DecodingStream = class(TStream)
+  TBase64DecodingStream = class(TOwnerStream)
   private
     FMode: TBase64DecodingMode;
     procedure SetMode(const AValue: TBase64DecodingMode);
     function  GetSize: Int64; override;
     function  GetPosition: Int64; override;
   protected
-    InputStream: TStream;
     CurPos,             // 0-based (decoded) position of this stream (nr. of decoded & Read bytes since last reset)
     DecodedSize: Int64; // length of decoded stream ((expected) decoded bytes since last Reset until Mode-dependent end of stream)
     ReadBase64ByteCount: Int64; // number of valid base64 bytes read from input stream since last Reset
     Buf: array[0..2] of Byte; // last 3 decoded bytes
-    BufPos: Integer;          // offset in Buf of byte which is to be read next; if >2, next block must be read from InputStream & decoded
+    BufPos: Integer;          // offset in Buf of byte which is to be read next; if >2, next block must be read from Source & decoded
     FEOF: Boolean;            // if true, all decoded bytes have been read
   public
-    constructor Create(AInputStream: TStream);
-    constructor Create(AInputStream: TStream; AMode: TBase64DecodingMode);
+    constructor Create(ASource: TStream);
+    constructor Create(ASource: TStream; AMode: TBase64DecodingMode);
     procedure Reset;
 
     function Read(var Buffer; Count: Longint): Longint; override;
@@ -126,10 +124,9 @@ const
 
   Alphabet = ['a'..'z','A'..'Z','0'..'9','+','/','=']; // all 65 chars that are in the base64 encoding alphabet
 
-constructor TBase64EncodingStream.Create(AOutputStream: TStream);
+constructor TBase64EncodingStream.Create(ASource: TStream);
 begin
-  inherited Create;
-  OutputStream := AOutputStream;
+  inherited Create(ASource);
 end;
 
 destructor TBase64EncodingStream.Destroy;
@@ -143,14 +140,14 @@ begin
         WriteBuf[1] := EncodingTable[(Buf[0] and 3) shl 4];
         WriteBuf[2] := '=';
         WriteBuf[3] := '=';
-        OutputStream.Write(WriteBuf, 4);
+        Source.Write(WriteBuf, 4);
       end;
     2: begin
         WriteBuf[0] := EncodingTable[Buf[0] shr 2];
         WriteBuf[1] := EncodingTable[(Buf[0] and 3) shl 4 or (Buf[1] shr 4)];
         WriteBuf[2] := EncodingTable[(Buf[1] and 15) shl 2];
         WriteBuf[3] := '=';
-        OutputStream.Write(WriteBuf, 4);
+        Source.Write(WriteBuf, 4);
       end;
   end;
   inherited Destroy;
@@ -179,7 +176,7 @@ begin
     WriteBuf[1] := EncodingTable[(Buf[0] and 3) shl 4 or (Buf[1] shr 4)];
     WriteBuf[2] := EncodingTable[(Buf[1] and 15) shl 2 or (Buf[2] shr 6)];
     WriteBuf[3] := EncodingTable[Buf[2] and 63];
-    OutputStream.Write(WriteBuf, 4);
+    Source.Write(WriteBuf, 4);
     Inc(BytesWritten, 4);
     BufSize := 0;
   end;
@@ -215,15 +212,15 @@ var
   i: Integer;
   c: Char;
 begin
-  // Note: this method only works on Seekable InputStreams (for bdmStrict we also get the Size property)
+  // Note: this method only works on Seekable Sources (for bdmStrict we also get the Size property)
   if DecodedSize<>-1 then Exit(DecodedSize);
-  ipos := InputStream.Position; // save position in input stream
+  ipos := Source.Position; // save position in input stream
   case Mode of
     bdmMIME:  begin
       // read until end of input stream or first occurence of a '='
       Result := ReadBase64ByteCount; // keep number of valid base64 bytes since last Reset in Result
       repeat
-        count := InputStream.Read(scanBuf, SizeOf(scanBuf));
+        count := Source.Read(scanBuf, SizeOf(scanBuf));
         for i := 0 to count-1 do begin
           c := scanBuf[i];
           if c in Alphabet-['='] then // base64 encoding characters except '='
@@ -244,13 +241,13 @@ begin
     end;
     bdmStrict:begin
       // seek to end of input stream, read last two bytes and determine size
-      //   from InputStream size and the number of leading '=' bytes
+      //   from Source size and the number of leading '=' bytes
       // NB we don't raise an exception here if the input does not contains an integer multiple of 4 bytes
-      ipos  := InputStream.Position;
-      isize := InputStream.Size;
+      ipos  := Source.Position;
+      isize := Source.Size;
       Result := ((ReadBase64ByteCount + (isize - ipos) + 3) div 4) * 3;
-      InputStream.Seek(-2, soFromEnd);
-      InputStream.Read(endBytes, 2);
+      Source.Seek(-2, soFromEnd);
+      Source.Read(endBytes, 2);
       if endBytes[1] = '=' then begin // last byte
         Dec(Result);
       if endBytes[0] = '=' then       // second to last byte
@@ -258,7 +255,7 @@ begin
       end;
     end;
   end;
-  InputStream.Position := ipos; // restore position in input stream
+  Source.Position := ipos; // restore position in input stream
   // store calculated DecodedSize
   DecodedSize := Result;
 end;
@@ -268,22 +265,21 @@ begin
   Result := CurPos;
 end;
 
-constructor TBase64DecodingStream.Create(AInputStream: TStream);
+constructor TBase64DecodingStream.Create(ASource: TStream);
 begin
-  Create(AInputStream, bdmMIME); // MIME mode is default
+  Create(ASource, bdmMIME); // MIME mode is default
 end;
 
-constructor TBase64DecodingStream.Create(AInputStream: TStream; AMode: TBase64DecodingMode);
+constructor TBase64DecodingStream.Create(ASource: TStream; AMode: TBase64DecodingMode);
 begin
-  inherited Create;
-  InputStream := AInputStream;
+  inherited Create(ASource);
   Mode := AMode;
   Reset;
 end;
 
 procedure TBase64DecodingStream.Reset;
 begin
-  ReadBase64ByteCount := 0; // number of bytes Read form InputStream since last call to Reset
+  ReadBase64ByteCount := 0; // number of bytes Read form Source since last call to Reset
   CurPos := 0; // position in decoded byte sequence since last Reset
   DecodedSize := -1; // indicates unknown; will be set after first call to GetSize or when reaching end of stream
   BufPos := 3; // signals we need to read & decode a new block of 4 bytes
@@ -324,7 +320,7 @@ begin
       ReadOK := 0; // number of base64 bytes already read into ReadBuf
       while ToRead > 0 do begin
         OrgToRead := ToRead;
-        HaveRead := InputStream.Read(ReadBuf[ReadOK], ToRead);
+        HaveRead := Source.Read(ReadBuf[ReadOK], ToRead);
         //WriteLn('ToRead = ', ToRead, ', HaveRead = ', HaveRead, ', ReadOK=', ReadOk);
         if HaveRead > 0 then begin // if any new bytes; in ReadBuf[ReadOK .. ReadOK + HaveRead-1]
           for i := ReadOK to ReadOK + HaveRead - 1 do begin
@@ -359,11 +355,11 @@ begin
           else if (ReadBuf[0] = PC) or (ReadBuf[1] = PC) then
             raise EBase64DecodingException.CreateFmt(SStrictMisplacedPadChar,[])   // =BBB or B=BB
           else if (ReadBuf[2] = PC) then begin
-            if (ReadBuf[3] <> PC) or (InputStream.Position < InputStream.Size) then
+            if (ReadBuf[3] <> PC) or (Source.Position < Source.Size) then
               raise EBase64DecodingException.CreateFmt(SStrictMisplacedPadChar,[]); // BB=B or BB==, but not at end of input stream
             DetectedEnd(CurPos + 1)  // only one byte left to read;  BB==, at end of input stream
           end else if (ReadBuf[3] = PC) then begin
-            if (InputStream.Position < InputStream.Size) then
+            if (Source.Position < Source.Size) then
               raise EBase64DecodingException.CreateFmt(SStrictMisplacedPadChar,[]); // BBB=, but not at end of input stream
             DetectedEnd(CurPos + 2); // only two bytes left to read; BBB=, at end of input stream
           end;

+ 21 - 1
packages/fcl-base/src/blowfish.pp

@@ -47,6 +47,8 @@ type
 Type
   EBlowFishError = Class(EStreamError);
 
+  { TBlowFishStream }
+
   TBlowFishStream = Class(TOwnerStream)
   Private
     FBF     : TBlowFish;
@@ -55,6 +57,7 @@ Type
     FPos    : Int64;
   Public
     Constructor Create(AKey : TBlowFishKey; AKeySize : Byte; Dest: TStream);
+    Constructor Create(Const KeyPhrase : String; Dest: TStream);
     Destructor Destroy; override;
     Property BlowFish : TBlowFish Read FBF;
   end;
@@ -77,6 +80,7 @@ Implementation
 
 ResourceString
   SNoSeekAllowed  = 'Seek not allowed on encryption streams';
+  SErrEmptyPassPhraseNotAllowed = 'Empty passphrase is not allowed in constructor';
 
 { Blowfish lookup tables }
 
@@ -544,6 +548,22 @@ begin
   FPos:=0;
 end;
 
+constructor TBlowFishStream.Create(const KeyPhrase: String; Dest: TStream);
+
+Var
+  KLen : Integer;
+  K : TBlowFishKey;
+
+begin
+  If (KeyPhrase='') then
+    Raise EBlowFishError.Create(SErrEmptyPassPhraseNotAllowed);
+  KLen:=Length(KeyPhrase);
+  If KLen>56 then
+    KLen:=56;
+  Move(KeyPhrase[1],K,Klen);
+  Create(K,KLen,Dest);
+end;
+
 Destructor TBlowFishStream.Destroy;
 
 begin
@@ -681,4 +701,4 @@ begin
     Raise EBlowFishError.Create(SNoSeekAllowed);
 end;
 
-end.
+end.

+ 1 - 0
packages/fcl-db/src/base/dataset.inc

@@ -38,6 +38,7 @@ begin
   FEOF := True;
   FBOF := True;
   FIsUniDirectional := False;
+  FAutoCalcFields := True;
 end;
 
 

+ 2 - 1
packages/fcl-db/src/base/db.pas

@@ -467,6 +467,7 @@ type
     procedure SetVarValue(const AValue: Variant); override;
   public
     constructor Create(AOwner: TComponent); override;
+    procedure SetFieldType(AValue: TFieldType); override;
     property FixedChar : Boolean read FFixedChar write FFixedChar;
     property Transliterate: Boolean read FTransliterate write FTransliterate;
     property Value: String read GetAsString write SetAsString;
@@ -1338,7 +1339,7 @@ type
     property Filtered: Boolean read FFiltered write SetFiltered default False;
     property FilterOptions: TFilterOptions read FFilterOptions write SetFilterOptions;
     property Active: Boolean read GetActive write SetActive default False;
-    property AutoCalcFields: Boolean read FAutoCalcFields write FAutoCalcFields;
+    property AutoCalcFields: Boolean read FAutoCalcFields write FAutoCalcFields default true;
     property BeforeOpen: TDataSetNotifyEvent read FBeforeOpen write FBeforeOpen;
     property AfterOpen: TDataSetNotifyEvent read FAfterOpen write FAfterOpen;
     property BeforeClose: TDataSetNotifyEvent read FBeforeClose write FBeforeClose;

+ 39 - 10
packages/fcl-db/src/base/fields.inc

@@ -1006,13 +1006,19 @@ begin
   FSize:=20;
 end;
 
+procedure TStringField.SetFieldType(AValue: TFieldType);
+begin
+  if avalue in [ftString, ftFixedChar] then
+    SetDataType(AValue);
+end;
+
 class procedure TStringField.CheckTypeSize(AValue: Longint);
 
 begin
 // A size of 0 is allowed, since for example Firebird allows
 // a query like: 'select '' as fieldname from table' which
 // results in a string with size 0.
-  If (AValue<0) or (AValue>dsMaxStringSize) Then
+  If (AValue<0) Then
     databaseErrorFmt(SInvalidFieldSize,[AValue])
 end;
 
@@ -1065,7 +1071,10 @@ end;
 function TStringField.GetDataSize: Integer;
 
 begin
-  Result:=Size+1;
+  if DataType=ftFixedChar then
+    Result:=Size
+  else
+    Result:=Size+1;
 end;
 
 function TStringField.GetDefaultWidth: Longint;
@@ -1083,19 +1092,39 @@ end;
 function TStringField.GetValue(var AValue: string): Boolean;
 
 Var Buf, TBuf : TStringFieldBuffer;
+    DynBuf, TDynBuf : Array of char;
 
 begin
-  Result:=GetData(@Buf);
-  If Result then
+  if DataSize <= dsMaxStringSize then
     begin
-    if transliterate then
+    Result:=GetData(@Buf);
+    If Result then
       begin
-      DataSet.Translate(Buf,TBuf,False);
-      AValue:=TBuf;
+      if transliterate then
+        begin
+        DataSet.Translate(Buf,TBuf,False);
+        AValue:=TBuf;
+        end
+      else
+        AValue:=Buf
       end
-    else
-      AValue:=Buf
     end
+  else
+    begin
+    SetLength(DynBuf,DataSize);
+    Result:=GetData(@DynBuf[0]);
+    If Result then
+      begin
+      if transliterate then
+        begin
+        SetLength(TDynBuf,DataSize);
+        DataSet.Translate(@DynBuf[0],@TDynBuf[0],False);
+        AValue:=pchar(TDynBuf);
+        end
+      else
+        AValue:=pchar(DynBuf);
+      end
+    end;
 end;
 
 procedure TStringField.SetAsBoolean(AValue: Boolean);
@@ -1166,7 +1195,7 @@ begin
 // A size of 0 is allowed, since for example Firebird allows
 // a query like: 'select '' as fieldname from table' which
 // results in a string with size 0.
-  If (AValue<0) or (AValue>(dsMaxStringSize div 2)) Then
+  If (AValue<0) Then
     databaseErrorFmt(SInvalidFieldSize,[AValue]);
 end;
 

+ 8 - 1
packages/fcl-db/src/base/sqlscript.pp

@@ -32,6 +32,7 @@ type
 
   TCustomSQLScript = class(TComponent)
   private
+    FAutoCommit: Boolean;
     FLine: Integer;
     FCol: Integer;
     FDefines: TStrings;
@@ -75,6 +76,7 @@ type
   protected
     property Aborted: Boolean read FAborted;
     property Line: Integer read GetLine;
+    Property AutoCommit : Boolean Read FAutoCommit Write FAutoCommit;
     property CommentsInSQL: Boolean read FCommentsInSQL write FCommentsInSQL;
     property UseSetTerm: Boolean read FUseSetTerm write FUseSetTerm;
     property UseCommit: Boolean read FUseCommit write FUseCommit;
@@ -401,7 +403,8 @@ begin
       end
     else If Not FIsSkipping then
       begin
-      if FUseCommit and (Directive = 'COMMIT') then
+      // If AutoCommit, skip any explicit commits.
+      if FUseCommit and (Directive = 'COMMIT') and not FAutoCommit then
         InternalCommit
       else if FUseSetTerm and (Directive = 'SET TERM') then
         FTerminator:=S
@@ -411,7 +414,11 @@ begin
     end
   else
     if (not FIsSkipping) then
+      begin
       InternalStatement(FCurrentStatement,FAborted);
+      If FAutoCommit and not FAborted then
+        InternalCommit;
+      end;
 end;
 
 procedure TCustomSQLScript.Execute;

+ 10 - 8
packages/fcl-db/src/sqldb/interbase/ibconnection.pp

@@ -300,6 +300,8 @@ begin
   pagesize := params.Values['PAGE_SIZE'];
   if pagesize <> '' then
     CreateSQL := CreateSQL + ' PAGE_SIZE '+pagesize;
+  if CharSet <> '' then
+    CreateSQL := CreateSQL + ' DEFAULT CHARACTER SET ' + CharSet;
 
   if isc_dsql_execute_immediate(@FStatus[0],@ASQLDatabaseHandle,@ASQLTransactionHandle,length(CreateSQL),@CreateSQL[1],Dialect,nil) <> 0 then
     CheckError('CreateDB', FStatus);
@@ -445,13 +447,15 @@ begin
       TrType := ftFMTBcd;
     end
   else case (SQLType and not 1) of
-    SQL_VARYING,SQL_TEXT :
+    SQL_VARYING :
       begin
         TrType := ftString;
-        if SQLLen > dsMaxStringSize then
-          TrLen := dsMaxStringSize
-        else
-          TrLen := SQLLen;
+        TrLen := SQLLen;
+      end;
+    SQL_TEXT :
+      begin
+        TrType := ftFixedChar;
+        TrLen := SQLLen;
       end;
     SQL_TYPE_DATE :
       TrType := ftDate{Time};
@@ -879,8 +883,6 @@ begin
         if ((SQLType and not 1) = SQL_VARYING) then
           begin
           Move(SQLData^, VarcharLen, 2);
-          if VarcharLen > dsMaxStringSize then
-            VarcharLen:=dsMaxStringSize;
           CurrBuff := SQLData + 2;
           end
         else
@@ -928,7 +930,7 @@ begin
           end;
         ftDate, ftTime, ftDateTime:
           GetDateTime(CurrBuff, Buffer, SQLDA^.SQLVar[x].SQLType);
-        ftString  :
+        ftString, ftFixedChar  :
           begin
             Move(CurrBuff^, Buffer^, VarCharLen);
             PChar(Buffer + VarCharLen)^ := #0;

+ 8 - 4
packages/fcl-db/src/sqldb/sqldb.pp

@@ -1026,9 +1026,12 @@ end;
 
 procedure TCustomSQLQuery.InternalClose;
 begin
-  if StatementType in [stSelect,stExecProcedure] then FreeFldBuffers;
-// Database and FCursor could be nil, for example if the database is not assigned, and .open is called
-  if (not IsPrepared) and (assigned(database)) and (assigned(FCursor)) then TSQLConnection(database).UnPrepareStatement(FCursor);
+  if not IsReadFromPacket then
+    begin
+    if StatementType in [stSelect,stExecProcedure] then FreeFldBuffers;
+    // Database and FCursor could be nil, for example if the database is not assigned, and .open is called
+    if (not IsPrepared) and (assigned(database)) and (assigned(FCursor)) then TSQLConnection(database).UnPrepareStatement(FCursor);
+    end;
   if DefaultFields then
     DestroyFields;
   FIsEOF := False;
@@ -1216,7 +1219,8 @@ begin
   ReadFromFile:=IsReadFromPacket;
   if ReadFromFile then
     begin
-    FCursor:=TSQLCursor.Create;
+    if not assigned(fcursor) then
+      FCursor := TSQLConnection(Database).AllocateCursorHandle;
     FCursor.FStatementType:=stSelect;
     FUpdateable:=True;
     end

+ 37 - 18
packages/fcl-db/src/sqlite/customsqliteds.pas

@@ -976,50 +976,66 @@ type
     CompFunction: TLocateCompareFunction;
   end;
 
-function CompInsensitivePartial(Value: PChar; const Key: String): Boolean;
+function CompInsensitivePartial(UTF8Value: PChar; const AnsiKey: String): Boolean;
+var
+  AnsiValue: AnsiString;
 begin
-  if Value <> nil then
-    Result := StrLIComp(Value, PChar(Key), Length(Key)) = 0
+  //see comments of CompInsensitive and CompInsensitiveWild functions
+  if UTF8Value <> nil then
+  begin
+    AnsiValue := UTF8Decode(UTF8Value);
+    Result := AnsiStrLIComp(PChar(AnsiValue), PChar(AnsiKey), Length(AnsiKey)) = 0;
+  end
   else
     Result := False;
 end;
 
-function CompSensitivePartial(Value: PChar; const Key: String): Boolean;
+function CompSensitivePartial(UTF8Value: PChar; const UTF8Key: String): Boolean;
 begin
-  if Value <> nil then
-    Result := StrLComp(Value, PChar(Key), Length(Key)) = 0
+  if UTF8Value <> nil then
+    Result := StrLComp(UTF8Value, PChar(UTF8Key), Length(UTF8Key)) = 0
   else
     Result := False;
 end;
 
-function CompInsensitive(Value: PChar; const Key: String): Boolean;
+function CompInsensitive(UTF8Value: PChar; const AnsiKey: String): Boolean;
 begin
-  if Value <> nil then
-    Result := StrIComp(Value, PChar(Key)) = 0
+  //fpc does not provide a function to compare UTF8 directly, so convert the
+  //UTF8Value string to ansi through a temporary widestring and compare with the
+  //AnsiKey (already encoded in the system ansi encoding).
+  //In unix systems where UTF8 is the system ansi encoding this would not be
+  //necessary but there's no direct way to check that
+  //todo: change this code when fpc has better support for unicode
+  if UTF8Value <> nil then
+    Result := AnsiCompareText(UTF8Decode(UTF8Value), AnsiKey) = 0
   else
     Result := False;
 end;
 
-function CompSensitive(Value: PChar; const Key: String): Boolean;
+function CompSensitive(UTF8Value: PChar; const UTF8Key: String): Boolean;
 begin
-  if Value <> nil then
-    Result := StrComp(Value, PChar(Key)) = 0
+  if UTF8Value <> nil then
+    Result := StrComp(UTF8Value, PChar(UTF8Key)) = 0
   else
     Result := False;
 end;
 
-function CompSensitiveWild(Value: PChar; const Key: String): Boolean;
+function CompSensitiveWild(UTF8Value: PChar; const UTF8Key: String): Boolean;
 begin
-  if Value <> nil then
-    Result := IsWild(String(Value), Key, False)
+  if UTF8Value <> nil then
+    Result := IsWild(String(UTF8Value), UTF8Key, False)
   else
     Result := False;
 end;
 
-function CompInsensitiveWild(Value: PChar; const Key: String): Boolean;
+function CompInsensitiveWild(UTF8Value: PChar; const AnsiKey: String): Boolean;
 begin
-  if Value <> nil then
-    Result := IsWild(String(Value), Key, True)
+  //IsWild does not work with UTF8 encoded strings for case insensitive searches,
+  //so convert UTF8Value to the system ansi encoding before passing to IsWild.
+  //AnsiKey is already encoded in ansi
+  //todo: change this code when fpc has better support for unicode
+  if UTF8Value <> nil then
+    Result := IsWild(UTF8Decode(UTF8Value), AnsiKey, True)
   else
     Result := False;
 end;
@@ -1092,6 +1108,9 @@ begin
             LocateFields[i].Key := VarToStr(KeyValues[i])
           else
             LocateFields[i].Key := VarToStr(KeyValues);
+          //store Key encoded as the system ansi encoding
+          if loCaseInsensitive in LocateOptions then
+            LocateFields[i].Key := UTF8Decode(LocateFields[i].Key);
         end
         else
         begin

+ 25 - 0
packages/fcl-db/tests/testfieldtypes.pas

@@ -84,6 +84,8 @@ type
     procedure TestBCDParamQuery;
     procedure TestAggregates;
 
+    procedure TestStringLargerThen8192;
+
     // SchemaType tests
     procedure TestTableNames;
     procedure TestFieldNames;
@@ -927,6 +929,29 @@ begin
   TSQLDBConnector(DBConnector).Connection.ExecuteDirect('update fpdev set name=''nothing'' where (1=0)');
 end;
 
+procedure TTestFieldTypes.TestStringLargerThen8192;
+
+var
+  s             : string;
+  i             : integer;
+
+begin
+  CreateTableWithFieldType(ftString,'VARCHAR(9000)');
+  TestFieldDeclaration(ftString,9001);
+
+  setlength(s,9000);
+  for i := 1 to 9000 do
+    s[i]:=chr((i mod 10)+ord('a'));
+  TSQLDBConnector(DBConnector).Connection.ExecuteDirect('insert into FPDEV2 (FT) values (''' + s + ''')');
+
+  with TSQLDBConnector(DBConnector).Query do
+    begin
+    Open;
+    AssertEquals(s,fields[0].AsString);
+    close;
+    end;
+end;
+
 procedure TTestFieldTypes.TestTableNames;
 var TableList : TStringList;
     i         : integer;

+ 231 - 2
packages/fcl-json/src/fpjson.pp

@@ -39,10 +39,12 @@ type
     function GetAsBoolean: Boolean; virtual; abstract;
     function GetAsFloat: TJSONFloat; virtual; abstract;
     function GetAsInteger: Integer; virtual; abstract;
+    function GetAsInt64: Int64; virtual; abstract;
     function GetIsNull: Boolean; virtual;
     procedure SetAsBoolean(const AValue: Boolean); virtual; abstract;
     procedure SetAsFloat(const AValue: TJSONFloat); virtual; abstract;
     procedure SetAsInteger(const AValue: Integer); virtual; abstract;
+    procedure SetAsInt64(const AValue: Int64); virtual; abstract;
     function GetAsJSON: TJSONStringType; virtual; abstract;
     function GetAsString: TJSONStringType; virtual; abstract;
     procedure SetAsString(const AValue: TJSONStringType); virtual; abstract;
@@ -61,13 +63,14 @@ type
     Property AsString : TJSONStringType Read GetAsString Write SetAsString;
     Property AsFloat : TJSONFloat Read GetAsFloat Write SetAsFloat;
     Property AsInteger : Integer Read GetAsInteger Write SetAsInteger;
+    Property AsInt64 : Int64 Read GetAsInt64 Write SetAsInt64;
     Property AsBoolean : Boolean Read GetAsBoolean Write SetAsBoolean;
     Property IsNull : Boolean Read GetIsNull;
     Property AsJSON : TJSONStringType Read GetAsJSON;
   end;
 
   TJSONDataClass = Class of TJSONData;
-  TJSONNumberType = (ntFloat,ntInteger);
+  TJSONNumberType = (ntFloat,ntInteger,ntInt64);
 
   TJSONNumber = class(TJSONData)
   protected
@@ -85,9 +88,11 @@ type
     function GetAsBoolean: Boolean; override;
     function GetAsFloat: TJSONFloat; override;
     function GetAsInteger: Integer; override;
+    function GetAsInt64: Int64; override;
     procedure SetAsBoolean(const AValue: Boolean); override;
     procedure SetAsFloat(const AValue: TJSONFloat); override;
     procedure SetAsInteger(const AValue: Integer); override;
+    procedure SetAsInt64(const AValue: Int64); override;
     function GetAsJSON: TJSONStringType; override;
     function GetAsString: TJSONStringType; override;
     procedure SetAsString(const AValue: TJSONStringType); override;
@@ -108,9 +113,11 @@ type
     function GetAsBoolean: Boolean; override;
     function GetAsFloat: TJSONFloat; override;
     function GetAsInteger: Integer; override;
+    function GetAsInt64: Int64; override;
     procedure SetAsBoolean(const AValue: Boolean); override;
     procedure SetAsFloat(const AValue: TJSONFloat); override;
     procedure SetAsInteger(const AValue: Integer); override;
+    procedure SetAsInt64(const AValue: Int64); override;
     function GetAsJSON: TJSONStringType; override;
     function GetAsString: TJSONStringType; override;
     procedure SetAsString(const AValue: TJSONStringType); override;
@@ -122,6 +129,31 @@ type
     Procedure Clear;  override;
   end;
 
+  { TJSONInt64Number }
+
+  TJSONInt64Number = class(TJSONNumber)
+  Private
+    FValue : Int64;
+  protected
+    function GetAsBoolean: Boolean; override;
+    function GetAsFloat: TJSONFloat; override;
+    function GetAsInteger: Integer; override;
+    function GetAsInt64: Int64; override;
+    procedure SetAsBoolean(const AValue: Boolean); override;
+    procedure SetAsFloat(const AValue: TJSONFloat); override;
+    procedure SetAsInteger(const AValue: Integer); override;
+    procedure SetAsInt64(const AValue: Int64); override;
+    function GetAsJSON: TJSONStringType; override;
+    function GetAsString: TJSONStringType; override;
+    procedure SetAsString(const AValue: TJSONStringType); override;
+    function GetValue: variant; override;
+    procedure SetValue(const AValue: variant); override;
+  public
+    Constructor Create(AValue : Int64); reintroduce;
+    class function NumberType : TJSONNumberType; override;
+    Procedure Clear;  override;
+  end;
+
   { TJSONString }
 
   TJSONString = class(TJSONData)
@@ -133,9 +165,11 @@ type
     function GetAsBoolean: Boolean; override;
     function GetAsFloat: TJSONFloat; override;
     function GetAsInteger: Integer; override;
+    function GetAsInt64: Int64; override;
     procedure SetAsBoolean(const AValue: Boolean); override;
     procedure SetAsFloat(const AValue: TJSONFloat); override;
     procedure SetAsInteger(const AValue: Integer); override;
+    procedure SetAsInt64(const AValue: Int64); override;
     function GetAsJSON: TJSONStringType; override;
     function GetAsString: TJSONStringType; override;
     procedure SetAsString(const AValue: TJSONStringType); override;
@@ -156,9 +190,11 @@ type
     function GetAsBoolean: Boolean; override;
     function GetAsFloat: TJSONFloat; override;
     function GetAsInteger: Integer; override;
+    function GetAsInt64: Int64; override;
     procedure SetAsBoolean(const AValue: Boolean); override;
     procedure SetAsFloat(const AValue: TJSONFloat); override;
     procedure SetAsInteger(const AValue: Integer); override;
+    procedure SetAsInt64(const AValue: Int64); override;
     function GetAsJSON: TJSONStringType; override;
     function GetAsString: TJSONStringType; override;
     procedure SetAsString(const AValue: TJSONStringType); override;
@@ -176,10 +212,12 @@ type
     function GetAsBoolean: Boolean; override;
     function GetAsFloat: TJSONFloat; override;
     function GetAsInteger: Integer; override;
+    function GetAsInt64: Int64; override;
     function GetIsNull: Boolean; override;
     procedure SetAsBoolean(const AValue: Boolean); override;
     procedure SetAsFloat(const AValue: TJSONFloat); override;
     procedure SetAsInteger(const AValue: Integer); override;
+    procedure SetAsInt64(const AValue: Int64); override;
     function GetAsJSON: TJSONStringType; override;
     function GetAsString: TJSONStringType; override;
     procedure SetAsString(const AValue: TJSONStringType); override;
@@ -202,6 +240,7 @@ type
     function GetBooleans(Index : Integer): Boolean;
     function GetFloats(Index : Integer): TJSONFloat;
     function GetIntegers(Index : Integer): Integer;
+    function GetInt64s(Index : Integer): Int64;
     function GetNulls(Index : Integer): Boolean;
     function GetObjects(Index : Integer): TJSONObject;
     function GetStrings(Index : Integer): TJSONStringType;
@@ -210,6 +249,7 @@ type
     procedure SetBooleans(Index : Integer; const AValue: Boolean);
     procedure SetFloats(Index : Integer; const AValue: TJSONFloat);
     procedure SetIntegers(Index : Integer; const AValue: Integer);
+    procedure SetInt64s(Index : Integer; const AValue: Int64);
     procedure SetObjects(Index : Integer; const AValue: TJSONObject);
     procedure SetStrings(Index : Integer; const AValue: TJSONStringType);
   protected
@@ -217,9 +257,11 @@ type
     function GetAsBoolean: Boolean; override;
     function GetAsFloat: TJSONFloat; override;
     function GetAsInteger: Integer; override;
+    function GetAsInt64: Int64; override;
     procedure SetAsBoolean(const AValue: Boolean); override;
     procedure SetAsFloat(const AValue: TJSONFloat); override;
     procedure SetAsInteger(const AValue: Integer); override;
+    procedure SetAsInt64(const AValue: Int64); override;
     function GetAsJSON: TJSONStringType; override;
     function GetAsString: TJSONStringType; override;
     procedure SetAsString(const AValue: TJSONStringType); override;
@@ -240,6 +282,7 @@ type
     Procedure Clear;  override;
     function Add(Item : TJSONData): Integer;
     function Add(I : Integer): Integer;
+    function Add(I : Int64): Int64;
     function Add(S : String): Integer;
     function Add: Integer;
     function Add(F : TJSONFloat): Integer;
@@ -253,6 +296,7 @@ type
     Property Types[Index : Integer] : TJSONType Read GetTypes;
     Property Nulls[Index : Integer] : Boolean Read GetNulls;
     Property Integers[Index : Integer] : Integer Read GetIntegers Write SetIntegers;
+    Property Int64s[Index : Integer] : Int64 Read GetInt64s Write SetInt64s;
     Property Strings[Index : Integer] : TJSONStringType Read GetStrings Write SetStrings;
     Property Floats[Index : Integer] : TJSONFloat Read GetFloats Write SetFloats;
     Property Booleans[Index : Integer] : Boolean Read GetBooleans Write SetBooleans;
@@ -272,6 +316,7 @@ type
     function GetElements(AName: string): TJSONData;
     function GetFloats(AName : String): TJSONFloat;
     function GetIntegers(AName : String): Integer;
+    function GetInt64s(AName : String): Int64;
     function GetIsNull(AName : String): Boolean; reintroduce;
     function GetNameOf(Index : Integer): TJSONStringType;
     function GetObjects(AName : String): TJSONObject;
@@ -282,6 +327,7 @@ type
     procedure SetElements(AName: string; const AValue: TJSONData);
     procedure SetFloats(AName : String; const AValue: TJSONFloat);
     procedure SetIntegers(AName : String; const AValue: Integer);
+    procedure SetInt64s(AName : String; const AValue: Int64);
     procedure SetIsNull(AName : String; const AValue: Boolean);
     procedure SetObjects(AName : String; const AValue: TJSONObject);
     procedure SetStrings(AName : String; const AValue: TJSONStringType);
@@ -290,9 +336,11 @@ type
     function GetAsBoolean: Boolean; override;
     function GetAsFloat: TJSONFloat; override;
     function GetAsInteger: Integer; override;
+    function GetAsInt64: Int64; override;
     procedure SetAsBoolean(const AValue: Boolean); override;
     procedure SetAsFloat(const AValue: TJSONFloat); override;
     procedure SetAsInteger(const AValue: Integer); override;
+    procedure SetAsInt64(const AValue: Int64); override;
     function GetAsJSON: TJSONStringType; override;
     function GetAsString: TJSONStringType; override;
     procedure SetAsString(const AValue: TJSONStringType); override;
@@ -317,6 +365,7 @@ type
     function Add(const AName: TJSONStringType; AValue: TJSONFloat): Integer; overload;
     function Add(const AName: TJSONStringType; AValue: TJSONStringType): Integer; overload;
     function Add(const AName: TJSONStringType; Avalue: Integer): Integer; overload;
+    function Add(const AName: TJSONStringType; Avalue: Int64): Integer; overload;
     function Add(const AName: TJSONStringType): Integer; overload;
     function Add(const AName: TJSONStringType; AValue : TJSONArray): Integer; overload;
     procedure Delete(Index : Integer);
@@ -330,6 +379,7 @@ type
     Property Nulls[AName : String] : Boolean Read GetIsNull Write SetIsNull;
     Property Floats[AName : String] : TJSONFloat Read GetFloats Write SetFloats;
     Property Integers[AName : String] : Integer Read GetIntegers Write SetIntegers;
+    Property Int64s[AName : String] : Int64 Read GetInt64s Write SetInt64s;
     Property Strings[AName : String] : TJSONStringType Read GetStrings Write SetStrings;
     Property Booleans[AName : String] : Boolean Read GetBooleans Write SetBooleans;
     Property Arrays[AName : String] : TJSONArray Read GetArrays Write SetArrays;
@@ -534,6 +584,11 @@ begin
   Result:=StrToInt(FValue);
 end;
 
+function TJSONstring.GetAsInt64: Int64;
+begin
+  Result:=StrToInt64(FValue);
+end;
+
 procedure TJSONstring.SetAsBoolean(const AValue: Boolean);
 begin
   FValue:=BoolToStr(AValue);
@@ -549,6 +604,11 @@ begin
   FValue:=IntToStr(AValue);
 end;
 
+procedure TJSONstring.SetAsInt64(const AValue: Int64);
+begin
+  FValue:=IntToStr(AValue);
+end;
+
 function TJSONstring.GetAsJSON: TJSONStringType;
 begin
   Result:='"'+StringToJSONString(FValue)+'"';
@@ -608,6 +668,10 @@ begin
   Result:=Ord(FValue);
 end;
 
+function TJSONboolean.GetAsInt64: Int64;
+begin
+  Result:=Ord(FValue);
+end;
 
 procedure TJSONboolean.SetAsBoolean(const AValue: Boolean);
 begin
@@ -624,6 +688,11 @@ begin
   FValue:=(AValue<>0)
 end;
 
+procedure TJSONboolean.SetAsInt64(const AValue: Int64);
+begin
+  FValue:=(AValue<>0)
+end;
+
 function TJSONboolean.GetAsJSON: TJSONStringType;
 begin
   If FValue then
@@ -673,6 +742,11 @@ begin
   ConvertError(True);
 end;
 
+function TJSONnull.GetAsInt64: Int64;
+begin
+  ConvertError(True);
+end;
+
 function TJSONnull.GetIsNull: Boolean;
 begin
   Result:=True;
@@ -693,6 +767,11 @@ begin
   ConvertError(False);
 end;
 
+procedure TJSONnull.SetAsInt64(const AValue: Int64);
+begin
+  ConvertError(False);
+end;
+
 function TJSONnull.GetAsJSON: TJSONStringType;
 begin
   Result:='Null';
@@ -748,6 +827,11 @@ begin
   Result:=Round(FValue);
 end;
 
+function TJSONFloatNumber.GetAsInt64: Int64;
+begin
+  Result:=Round(FValue);
+end;
+
 procedure TJSONFloatNumber.SetAsBoolean(const AValue: Boolean);
 begin
   FValue:=Ord(AValue);
@@ -763,6 +847,11 @@ begin
   FValue:=AValue;
 end;
 
+procedure TJSONFloatNumber.SetAsInt64(const AValue: Int64);
+begin
+  FValue:=AValue;
+end;
+
 function TJSONFloatNumber.GetAsJSON: TJSONStringType;
 begin
   Result:=AsString;
@@ -826,6 +915,11 @@ begin
   Result:=FValue;
 end;
 
+function TJSONIntegerNumber.GetAsInt64: Int64;
+begin
+  Result:=FValue;
+end;
+
 procedure TJSONIntegerNumber.SetAsBoolean(const AValue: Boolean);
 begin
   FValue:=Ord(AValue);
@@ -841,6 +935,11 @@ begin
   FValue:=AValue;
 end;
 
+procedure TJSONIntegerNumber.SetAsInt64(const AValue: Int64);
+begin
+  FValue:=AValue;
+end;
+
 function TJSONIntegerNumber.GetAsJSON: TJSONStringType;
 begin
   Result:=AsString;
@@ -881,6 +980,87 @@ begin
   FValue:=0;
 end;
 
+{ TJSONInt64Number }
+
+function TJSONInt64Number.GetAsInt64: Int64;
+begin
+  Result := FValue;
+end;
+
+procedure TJSONInt64Number.SetAsInt64(const AValue: Int64);
+begin
+  FValue := AValue;
+end;
+
+function TJSONInt64Number.GetAsBoolean: Boolean;
+begin
+  Result:=FValue<>0;
+end;
+
+function TJSONInt64Number.GetAsFloat: TJSONFloat;
+begin
+  Result:= FValue;
+end;
+
+function TJSONInt64Number.GetAsInteger: Integer;
+begin
+  Result := FValue;
+end;
+
+procedure TJSONInt64Number.SetAsBoolean(const AValue: Boolean);
+begin
+  FValue:=Ord(AValue);
+end;
+
+procedure TJSONInt64Number.SetAsFloat(const AValue: TJSONFloat);
+begin
+  FValue:=Round(AValue);
+end;
+
+procedure TJSONInt64Number.SetAsInteger(const AValue: Integer);
+begin
+  FValue:=AValue;
+end;
+
+function TJSONInt64Number.GetAsJSON: TJSONStringType;
+begin
+  Result:=AsString;
+end;
+
+function TJSONInt64Number.GetAsString: TJSONStringType;
+begin
+  Result:=IntToStr(FValue)
+end;
+
+procedure TJSONInt64Number.SetAsString(const AValue: TJSONStringType);
+begin
+  FValue:=StrToInt64(AValue);
+end;
+
+function TJSONInt64Number.GetValue: variant;
+begin
+  Result:=FValue;
+end;
+
+procedure TJSONInt64Number.SetValue(const AValue: variant);
+begin
+  FValue:=AValue;
+end;
+
+constructor TJSONInt64Number.Create(AValue: Int64);
+begin
+  FValue := AValue;
+end;
+
+class function TJSONInt64Number.NumberType: TJSONNumberType;
+begin
+  Result:=ntInt64;
+end;
+
+procedure TJSONInt64Number.Clear;
+begin
+  FValue:=0;
+end;
 
 { TJSONArray }
 
@@ -904,6 +1084,11 @@ begin
   Result:=Items[Index].AsInteger;
 end;
 
+function TJSONArray.GetInt64s(Index : Integer): Int64;
+begin
+  Result:=Items[Index].AsInt64;
+end;
+
 function TJSONArray.GetNulls(Index : Integer): Boolean;
 begin
   Result:=Items[Index].IsNull;
@@ -945,6 +1130,11 @@ begin
   Items[Index]:=TJSONIntegerNumber.Create(AValue);
 end;
 
+procedure TJSONArray.SetInt64s(Index : Integer; const AValue: Int64);
+begin
+  Items[Index]:=TJSONInt64Number.Create(AValue);
+end;
+
 procedure TJSONArray.SetObjects(Index : Integer; const AValue: TJSONObject);
 begin
   Items[Index]:=AValue;
@@ -979,6 +1169,11 @@ begin
   ConvertError(True);
 end;
 
+function TJSONArray.GetAsInt64: Int64;
+begin
+  ConvertError(True);
+end;
+
 procedure TJSONArray.SetAsBoolean(const AValue: Boolean);
 begin
   ConvertError(False);
@@ -993,6 +1188,10 @@ procedure TJSONArray.SetAsInteger(const AValue: Integer);
 begin
   ConvertError(False);
 end;
+procedure TJSONArray.SetAsInt64(const AValue: Int64);
+begin
+  ConvertError(False);
+end;
 {$warnings on}
 
 function TJSONArray.GetAsJSON: TJSONStringType;
@@ -1074,7 +1273,7 @@ begin
                      else
                        Result:=TJSONNull.Create;
       vtCurrency   : Result:=TJSONFloatNumber.Create(vCurrency^);
-      vtInt64      : Result:=TJSONFloatNumber.Create(vInt64^);
+      vtInt64      : Result:=TJSONInt64Number.Create(vInt64^);
       vtObject     : if (VObject is TJSONData) then
                        Result:=TJSONData(VObject)
                      else
@@ -1147,6 +1346,11 @@ begin
   Result:=Add(TJSONIntegerNumber.Create(I));
 end;
 
+function TJSONArray.Add(I: Int64): Int64;
+begin
+  Result:=Add(TJSONInt64Number.Create(I));
+end;
+
 function TJSONArray.Add(S: String): Integer;
 begin
   Result:=Add(TJSONString.Create(S));
@@ -1218,6 +1422,11 @@ begin
   Result:=GetElements(AName).AsInteger;
 end;
 
+function TJSONObject.GetInt64s(AName : String): Int64;
+begin
+  Result:=GetElements(AName).AsInt64;
+end;
+
 function TJSONObject.GetIsNull(AName : String): Boolean;
 begin
   Result:=GetElements(AName).IsNull;
@@ -1276,6 +1485,11 @@ begin
   SetElements(AName,TJSONIntegerNumber.Create(AVAlue));
 end;
 
+procedure TJSONObject.SetInt64s(AName : String; const AValue: Int64);
+begin
+  SetElements(AName,TJSONInt64Number.Create(AVAlue));
+end;
+
 procedure TJSONObject.SetIsNull(AName : String; const AValue: Boolean);
 begin
   If Not AValue then
@@ -1317,6 +1531,11 @@ begin
   ConvertError(True);
 end;
 
+function TJSONObject.GetAsInt64: Int64;
+begin
+  ConvertError(True);
+end;
+
 procedure TJSONObject.SetAsBoolean(const AValue: Boolean);
 begin
   ConvertError(False);
@@ -1331,6 +1550,11 @@ procedure TJSONObject.SetAsInteger(const AValue: Integer);
 begin
   ConvertError(False);
 end;
+
+procedure TJSONObject.SetAsInt64(const AValue: Int64);
+begin
+  ConvertError(False);
+end;
 {$warnings on}
 
 function TJSONObject.GetAsJSON: TJSONStringType;
@@ -1498,6 +1722,11 @@ begin
   Result:=Add(AName,TJSONIntegerNumber.Create(AValue));
 end;
 
+function TJSONObject.Add(const AName: TJSONStringType; Avalue: Int64): Integer;
+begin
+  Result:=Add(AName,TJSONInt64Number.Create(AValue));
+end;
+
 function TJSONObject.Add(const AName: TJSONStringType): Integer;
 begin
   Result:=Add(AName,TJSONNull.Create);

+ 53 - 0
packages/fcl-json/src/jsonconf.pp

@@ -83,15 +83,18 @@ type
 
     function  GetValue(const APath: WideString; const ADefault: WideString): WideString; overload;
     function  GetValue(const APath: WideString; ADefault: Integer): Integer; overload;
+    function  GetValue(const APath: WideString; ADefault: Int64): Int64; overload;
     function  GetValue(const APath: WideString; ADefault: Boolean): Boolean; overload;
     function  GetValue(const APath: WideString; ADefault: Double): Double; overload;
     procedure SetValue(const APath: WideString; const AValue: WideString); overload;
     procedure SetValue(const APath: WideString; AValue: Integer); overload;
+    procedure SetValue(const APath: WideString; AValue: Int64); overload;
     procedure SetValue(const APath: WideString; AValue: Boolean); overload;
     procedure SetValue(const APath: WideString; AValue: Double); overload;
 
     procedure SetDeleteValue(const APath: WideString; const AValue, DefValue: WideString); overload;
     procedure SetDeleteValue(const APath: WideString; AValue, DefValue: Integer); overload;
+    procedure SetDeleteValue(const APath: WideString; AValue, DefValue: Int64); overload;
     procedure SetDeleteValue(const APath: WideString; AValue, DefValue: Boolean); overload;
 
     procedure DeletePath(const APath: WideString);
@@ -284,6 +287,20 @@ begin
     Result:=StrToIntDef(El.AsString,ADefault);
 end;
 
+function TJSONConfig.GetValue(const APath: WideString; ADefault: Int64): Int64;
+var
+  El : TJSONData;
+
+begin
+  El:=FindElement(StripSlash(APath),False);
+  If Not Assigned(el) then
+    Result:=ADefault
+  else if (el is TJSONNumber) then
+    Result:=El.AsInt64
+  else
+    Result:=StrToInt64Def(El.AsString,ADefault);
+end;
+
 function TJSONConfig.GetValue(const APath: WideString; ADefault: Boolean): Boolean;
 
 var
@@ -376,6 +393,33 @@ begin
   FModified:=True;
 end;
 
+procedure TJSONConfig.SetValue(const APath: WideString; AValue: Int64);
+
+var
+  El : TJSONData;
+  ElName : WideString;
+  O : TJSONObject;
+  I : integer;
+
+begin
+  El:=FindElement(StripSlash(APath),True,O,ElName);
+  if Assigned(El) and (Not (El is TJSONInt64Number)) then
+    begin
+    I:=O.IndexOfName(elName);
+    If (I<>-1) then // Normally not needed...
+      O.Delete(i);
+    El:=Nil;
+    end;
+  If Not Assigned(el) then
+    begin
+    El:=TJSONInt64Number.Create(AValue);
+    O.Add(ElName,El);
+    end
+  else
+    El.AsInt64:=AValue;
+  FModified:=True;
+end;
+
 procedure TJSONConfig.SetDeleteValue(const APath: WideString; AValue,
   DefValue: Integer);
 begin
@@ -385,6 +429,15 @@ begin
     SetValue(APath, AValue);
 end;
 
+procedure TJSONConfig.SetDeleteValue(const APath: WideString; AValue,
+  DefValue: Int64);
+begin
+  if AValue = DefValue then
+    DeleteValue(APath)
+  else
+    SetValue(APath, AValue);
+end;
+
 procedure TJSONConfig.SetValue(const APath: WideString; AValue: Boolean);
 
 var

+ 4 - 1
packages/fcl-json/src/jsonparser.pp

@@ -127,13 +127,16 @@ Function TJSONParser.ParseNumber : TJSONNumber;
 
 Var
   I : Integer;
+  I64 : Int64;
   F : TJSONFloat;
   S : String;
 
 begin
   S:=CurrentTokenString;
   I:=0;
-  If TryStrToInt(S,I) then
+  If TryStrToInt64(S,I64) then
+    Result:=TJSONInt64Number.Create(I64)
+  Else If TryStrToInt(S,I) then
     Result:=TJSONIntegerNumber.Create(I)
   else
     begin

+ 4 - 1
packages/fcl-json/tests/jsonconftest.pp

@@ -48,10 +48,11 @@ end;
 procedure TTestJSONConfig.TestDataTypes;
 
 Const
-  A = 1;
+  A = Integer(1);
   B = 'A string';
   C = 1.23;
   D = True;
+  E = Int64($FFFFFFFFFFFFF);
 
 Var
   Co : TJSONCOnfig;
@@ -67,6 +68,8 @@ begin
     AssertEquals('Float read/Write',c,Co.GetValue('c',0.0),0.01);
     Co.SetValue('d',d);
     AssertEquals('Boolean read/Write',d,Co.GetValue('d',False));
+    Co.SetValue('e',E);
+    AssertEquals('Int64 read/Write',e,Co.GetValue('e',Int64(0)));
     Co.Flush;
   finally
     DeleteConf(Co,True);

+ 170 - 14
packages/fcl-json/tests/testjsondata.pp

@@ -45,6 +45,7 @@ type
     Procedure TestIsNull(J : TJSONData;Expected : Boolean);
     Procedure TestAsBoolean(J : TJSONData;Expected : Boolean; ExpectError : boolean = False);
     Procedure TestAsInteger(J : TJSONData; Expected : Integer; ExpectError : boolean = False);
+    Procedure TestAsInt64(J : TJSONData; Expected : Int64; ExpectError : boolean = False);
     Procedure TestAsString(J : TJSONData; Expected : String; ExpectError : boolean = False);
     Procedure TestAsFloat(J : TJSONData; Expected : TJSONFloat; ExpectError : boolean = False);
   end;
@@ -74,6 +75,17 @@ type
     procedure TestNegative;
     procedure TestZero;
   end;
+
+  { TTestInt64 }
+
+  TTestInt64 = class(TTestJSON)
+  Private
+    Procedure DoTest(I : Int64);
+  published
+    procedure TestPositive;
+    procedure TestNegative;
+    procedure TestZero;
+  end;
   
   { TTestFloat }
 
@@ -121,6 +133,7 @@ type
     procedure TestCreateNilPointer;
     procedure TestCreatePointer;
     procedure TestAddInteger;
+    procedure TestAddInt64;
     procedure TestAddFloat;
     procedure TestAddBooleanTrue;
     procedure TestAddBooleanFalse;
@@ -152,6 +165,7 @@ type
     procedure TestCreateNilPointer;
     procedure TestCreatePointer;
     procedure TestAddInteger;
+    procedure TestAddInt64;
     procedure TestAddFloat;
     procedure TestAddBooleanTrue;
     procedure TestAddBooleanFalse;
@@ -255,6 +269,40 @@ begin
     end;
 end;
 
+procedure TTestJSON.TestAsInt64(J: TJSONData; Expected: Int64;
+  ExpectError: boolean);
+
+Var
+  I : Int64;
+  AssignOK : Boolean;
+  Msg : String;
+
+begin
+  AssignOK:=False;
+  Try
+    I:=J.AsInt64;
+    AssignOK:=True;
+    If Not ExpectError then
+      AssertEquals(J.Classname+'.AsInt64',Expected,I);
+  except
+    On E : Exception do
+      begin
+      AssignOK:=False;
+      Msg:=E.Message;
+      end;
+  end;
+  If ExpectError then
+    begin
+    If AssignOK then
+      Fail(J.ClassName+'.AsInt64 must raise error');
+    end
+  else
+    begin
+    If not AssignOK then
+      Fail(J.ClassName+'.AsInt64 raised unexpected exception: '+Msg)
+    end;
+end;
+
 procedure TTestJSON.TestAsString(J: TJSONData; Expected: String;
   ExpectError: boolean);
   
@@ -339,6 +387,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,True);
     TestAsInteger(J,1);
+    TestAsInt64(J,1);
     TestAsString(J,BoolToStr(True));
     TestAsFloat(J,1.0);
   finally
@@ -360,6 +409,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,False);
     TestAsInteger(J,0);
+    TestAsInt64(J,0);
     TestAsString(J,BoolToStr(False));
     TestAsFloat(J,0.0);
   finally
@@ -385,6 +435,7 @@ begin
     TestIsNull(J,True);
     TestAsBoolean(J,False,True);
     TestAsInteger(J,0,true);
+    TestAsInt64(J,0,true);
     TestAsString(J,BoolToStr(False),true);
     TestAsFloat(J,0.0,true);
   finally
@@ -412,6 +463,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,False,True);
     TestAsInteger(J,0,true);
+    TestAsInt64(J,0,true);
     TestAsString(J,S);
     TestAsFloat(J,0.0,true);
   finally
@@ -436,6 +488,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,True,False);
     TestAsInteger(J,1,False);
+    TestAsInt64(J,1,False);
     TestAsString(J,S);
     TestAsFloat(J,1.0,False);
   finally
@@ -460,6 +513,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,True,False);
     TestAsInteger(J,-1,False);
+    TestAsInt64(J,-1,False);
     TestAsString(J,S);
     TestAsFloat(J,-1.0,False);
   finally
@@ -503,6 +557,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,True,False);
     TestAsInteger(J,-1,True);
+    TestAsInt64(J,-1,True);
     TestAsString(J,S);
     TestAsFloat(J,-1.0,True);
   finally
@@ -527,6 +582,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,False,False);
     TestAsInteger(J,0,True);
+    TestAsInt64(J,0,True);
     TestAsString(J,S);
     TestAsFloat(J,0,True);
   finally
@@ -548,6 +604,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,(F<>0),Not OK);
     TestAsInteger(J,Round(F),(Pos('.',S)<>0) or (Pos('E',UpperCase(S))<>0));
+    TestAsInt64(J,Round(F),(Pos('.',S)<>0) or (Pos('E',UpperCase(S))<>0));
     TestAsString(J,S);
     TestAsFloat(J,F,Not OK);
   finally
@@ -573,6 +630,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,(I<>0));
     TestAsInteger(J,I);
+    TestAsInt64(J,I);
     TestAsString(J,IntToStr(I));
     TestAsFloat(J,I);
   finally
@@ -596,6 +654,47 @@ begin
   DoTest(0);
 end;
 
+{ TTestInt64 }
+
+procedure TTestInt64.DoTest(I: Int64);
+
+Var
+  J : TJSONInt64Number;
+
+begin
+  J:=TJSONInt64Number.Create(I);
+  try
+    TestJSONType(J,jtNumber);
+    TestItemCount(J,0);
+    AssertEquals('Numbertype is ntInt64',ord(ntInt64),Ord(J.NumberType));
+    TestJSON(J,IntToStr(i));
+    TestIsNull(J,False);
+    TestAsBoolean(J,(I<>0));
+    TestAsInteger(J,I);
+    TestAsInt64(J,I);
+    TestAsString(J,IntToStr(I));
+    TestAsFloat(J,I);
+  finally
+    FreeAndNil(J);
+  end;
+end;
+
+procedure TTestInt64.TestPositive;
+
+begin
+  DoTest(1);
+end;
+
+procedure TTestInt64.TestNegative;
+begin
+  DoTest(-1);
+end;
+
+procedure TTestInt64.TestZero;
+begin
+  DoTest(0);
+end;
+
 { TTestFloat }
 
 procedure TTestFloat.DoTest(F: TJSONFloat);
@@ -615,6 +714,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,(F<>0));
     TestAsInteger(J,Round(F));
+    TestAsInt64(J,Round(F));
     TestAsString(J,S);
     TestAsFloat(J,F);
   finally
@@ -663,6 +763,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,False,True);
     TestAsInteger(J,1,True);
+    TestAsInt64(J,1,True);
     TestAsString(J,'',True);
     TestAsFloat(J,0.0,True);
   finally
@@ -780,12 +881,10 @@ end;
 procedure TTestArray.TestCreateInt64;
 
 Const
-  S : Int64 = $FFFFFF;
+  S : Int64 = $FFFFFFFFFFFFF;
 
 Var
   J : TJSONArray;
-  r : String;
-  F : TJSONFloat;
 
 begin
   J:=TJSonArray.Create([S]);
@@ -793,9 +892,7 @@ begin
     TestJSONType(J,jtArray);
     TestItemCount(J,1);
     TestJSONType(J[0],jtNumber);
-    F:=S;
-    Str(F,R);
-    TestJSON(J,'['+R+']');
+    TestJSON(J,'['+IntToStr(S)+']');
   finally
     FreeAndNil(J);
   end;
@@ -920,13 +1017,36 @@ Var
 begin
   J:=TJSonArray.Create;
   try
-    J.Add(0);
+    J.Add(Integer(0));
     TestItemCount(J,1);
     TestJSONType(J[0],jtNumber);
     AssertEquals('J[0] is TJSONIntegerNumber',J[0].ClassType,TJSONIntegerNumber);
     AssertEquals('j.Types[0]=jtNumber',ord(J.Types[0]),Ord(jtNumber));
     AssertEquals('J.Integers[0]=0',0,J.integers[0]);
     TestAsInteger(J[0],0);
+    TestAsInt64(J[0],0);
+    TestJSON(J,'[0]');
+  finally
+    FreeAndNil(J);
+  end;
+end;
+
+procedure TTestArray.TestAddInt64;
+
+Var
+  J : TJSONArray;
+
+begin
+  J:=TJSonArray.Create;
+  try
+    J.Add(Int64(0));
+    TestItemCount(J,1);
+    TestJSONType(J[0],jtNumber);
+    AssertEquals('J[0] is TJSONInt64Number',J[0].ClassType,TJSONInt64Number);
+    AssertEquals('j.Types[0]=jtNumber',ord(J.Types[0]),Ord(jtNumber));
+    AssertEquals('J.Int64s[0]=0',0,J.Int64s[0]);
+    TestAsInteger(J[0],0);
+    TestAsInt64(J[0],0);
     TestJSON(J,'[0]');
   finally
     FreeAndNil(J);
@@ -1057,6 +1177,8 @@ begin
     AssertEquals('J.Arrays[0] is TJSONArray',TJSONArray,J.Arrays[0].ClassType);
     TestAsInteger(J.Arrays[0][0],0);
     TestAsInteger(J.Arrays[0][1],1);
+    TestAsInt64(J.Arrays[0][0],0);
+    TestAsInt64(J.Arrays[0][1],1);
     TestJSON(J,'[[0, 1]]');
   finally
     FreeAndNil(J);
@@ -1086,6 +1208,8 @@ begin
     AssertEquals('J.Objects[0] is TJSONObject',TJSONObject,J.Objects[0].ClassType);
     TestAsInteger(J.Objects[0][A],0);
     TestAsInteger(J.Objects[0][B],1);
+    TestAsInt64(J.Objects[0][A],0);
+    TestAsInt64(J.Objects[0][B],1);
     TestJSON(J,'[{ "a" : 0, "b" : 1 }]');
   finally
     FreeAndNil(J);
@@ -1137,6 +1261,8 @@ begin
     TestItemCount(J,2);
     TestAsInteger(J[0],0);
     TestAsInteger(J[1],2);
+    TestAsInt64(J[0],0);
+    TestAsInt64(J[1],2);
   finally
     FreeAndNil(J);
   end;
@@ -1158,6 +1284,7 @@ begin
     TestIsNull(J,False);
     TestAsBoolean(J,False,True);
     TestAsInteger(J,1,True);
+    TestAsInt64(J,1,True);
     TestAsString(J,'',True);
     TestAsFloat(J,0.0,True);
   finally
@@ -1176,13 +1303,39 @@ Var
 begin
   J:=TJSonObject.Create;
   try
-    J.Add(A,0);
+    J.Add(A,Integer(0));
     TestItemCount(J,1);
     TestJSONType(J[A],jtNumber);
     AssertEquals('J[''a''] is TJSONIntegerNumber',J[A].ClassType,TJSONIntegerNumber);
     AssertEquals('j.Types[''a'']=jtNumber',ord(J.Types[A]),Ord(jtNumber));
     AssertEquals('J.Integers[''a'']=0',0,J.integers[A]);
     TestAsInteger(J[A],0);
+    TestAsInt64(J[A],0);
+    TestJSON(J,'{ "'+A+'" : 0 }');
+  finally
+    FreeAndNil(J);
+  end;
+end;
+
+procedure TTestObject.TestAddInt64;
+
+Const
+  A = 'a';
+
+Var
+  J : TJSONObject;
+
+begin
+  J:=TJSonObject.Create;
+  try
+    J.Add(A,Int64(0));
+    TestItemCount(J,1);
+    TestJSONType(J[A],jtNumber);
+    AssertEquals('J[''a''] is TJSONInt64Number',J[A].ClassType,TJSONInt64Number);
+    AssertEquals('j.Types[''a'']=jtNumber',ord(J.Types[A]),Ord(jtNumber));
+    AssertEquals('J.Int64s[''a'']=0',0,J.Int64s[A]);
+    TestAsInteger(J[A],0);
+    TestAsInt64(J[A],0);
     TestJSON(J,'{ "'+A+'" : 0 }');
   finally
     FreeAndNil(J);
@@ -1330,6 +1483,8 @@ begin
     AssertEquals('J.Objects[''a''] is TJSONObject',TJSONObject,J.Objects[A].ClassType);
     TestAsInteger(J.Objects[A][B],0);
     TestAsInteger(J.Objects[A][C],1);
+    TestAsInt64(J.Objects[A][B],0);
+    TestAsInt64(J.Objects[A][C],1);
     TestJSON(J,'{ "a" : { "b" : 0, "c" : 1 } }');
   finally
     FreeAndNil(J);
@@ -1358,6 +1513,8 @@ begin
     AssertEquals('J.Arrays[0] is TJSONArray',TJSONArray,J.Arrays[A].ClassType);
     TestAsInteger(J.Arrays[A][0],0);
     TestAsInteger(J.Arrays[A][1],1);
+    TestAsInt64(J.Arrays[A][0],0);
+    TestAsInt64(J.Arrays[A][1],1);
     TestJSON(J,'{ "a" : [0, 1] }');
   finally
     FreeAndNil(J);
@@ -1418,6 +1575,8 @@ begin
     TestItemCount(J,2);
     TestAsInteger(J[a],1);
     TestAsInteger(J[c],3);
+    TestAsInt64(J[a],1);
+    TestAsInt64(J[c],3);
   finally
     FreeAndNil(J);
   end;
@@ -1541,12 +1700,10 @@ procedure TTestObject.TestCreateInt64;
 
 Const
   A = 'A';
-  S : Int64 = $FFFFFF;
+  S : Int64 = $FFFFFFFFFFFFF;
 
 Var
   J : TJSONObject;
-  r : String;
-  F : TJSONFloat;
 
 begin
   J:=TJSONObject.Create([A,S]);
@@ -1554,9 +1711,7 @@ begin
     TestJSONType(J,jtObject);
     TestItemCount(J,1);
     TestJSONType(J[A],jtNumber);
-    F:=S;
-    Str(F,R);
-    TestJSON(J,'{ "A" : '+R+' }');
+    TestJSON(J,'{ "A" : '+IntToStr(S)+' }');
   finally
     FreeAndNil(J);
   end;
@@ -1792,6 +1947,7 @@ initialization
   RegisterTest(TTestNull);
   RegisterTest(TTestBoolean);
   RegisterTest(TTestInteger);
+  RegisterTest(TTestInt64);
   RegisterTest(TTestFloat);
   RegisterTest(TTestString);
   RegisterTest(TTestArray);

+ 24 - 0
packages/fcl-json/tests/testjsonparser.pp

@@ -41,6 +41,7 @@ type
     procedure TestFalse;
     procedure TestFloat;
     procedure TestInteger;
+    procedure TestInt64;
     procedure TestString;
     procedure TestArray;
     procedure TestObject;
@@ -88,6 +89,26 @@ begin
   end;
 end;
 
+procedure TTestParser.TestInt64;
+
+Var
+  P : TJSONParser;
+  J : TJSONData;
+
+begin
+  P:=TJSONParser.Create('123456789012345');
+  Try
+    J:=P.Parse;
+    If (J=Nil) then
+      Fail('Parse of 123456789012345 fails');
+    TestJSONType(J,jtNumber);
+    TestAsInt64(J,123456789012345);
+  Finally
+    FreeAndNil(J);
+    FreeAndNil(P);
+  end;
+end;
+
 procedure TTestParser.TestNull;
 
 Var
@@ -185,6 +206,9 @@ begin
   DoTestArray('[1]',1);
   DoTestArray('[1, 2]',2);
   DoTestArray('[1, 2, 3]',3);
+  DoTestArray('[1234567890123456]',1);
+  DoTestArray('[1234567890123456, 2234567890123456]',2);
+  DoTestArray('[1234567890123456, 2234567890123456, 3234567890123456]',3);
   Str(1.2,S1);
   Str(2.3,S2);
   Str(3.4,S3);

+ 111 - 27
packages/fcl-web/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/06/23]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/07/19]
 #
 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 m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
@@ -265,31 +265,31 @@ PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(F
 override PACKAGE_NAME=fcl-web
 override PACKAGE_VERSION=2.2.2
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -298,7 +298,7 @@ ifeq ($(FULL_TARGET),i386-netware)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -316,7 +316,7 @@ ifeq ($(FULL_TARGET),i386-netwlibc)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -325,13 +325,13 @@ ifeq ($(FULL_TARGET),i386-symbian)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -340,7 +340,7 @@ ifeq ($(FULL_TARGET),m68k-atari)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -349,10 +349,10 @@ ifeq ($(FULL_TARGET),m68k-embedded)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -370,34 +370,34 @@ ifeq ($(FULL_TARGET),powerpc-embedded)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -406,7 +406,7 @@ ifeq ($(FULL_TARGET),arm-darwin)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),arm-gba)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -421,7 +421,7 @@ ifeq ($(FULL_TARGET),arm-symbian)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -433,7 +433,7 @@ ifeq ($(FULL_TARGET),avr-embedded)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  fastcgi custfcgi fpfcgi
+override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache  custfcgi fpfcgi
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override TARGET_UNITS+=httpdefs fphttp custweb custcgi fpcgi fptemplate fphtml websession fpweb webutil fpdatasetform cgiapp ezcgi fpapache
@@ -1758,7 +1758,7 @@ else
 TAROPT=vz
 TAREXT=.tar.gz
 endif
-override REQUIRE_PACKAGES=rtl fcl-base fcl-xml fcl-db fcl-process httpd22
+override REQUIRE_PACKAGES=rtl fcl-base fcl-xml fcl-db fcl-process httpd22 fastcgi
 ifeq ($(FULL_TARGET),i386-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FCL-BASE=1
@@ -1767,6 +1767,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -1782,6 +1783,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 REQUIRE_PACKAGES_RTL=1
@@ -1792,6 +1794,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -1807,6 +1810,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
 REQUIRE_PACKAGES_RTL=1
@@ -1816,6 +1820,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -1832,6 +1837,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -1848,6 +1854,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_SQLITE=1
 REQUIRE_PACKAGES_PXLIB=1
 endif
@@ -1858,6 +1865,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -1873,6 +1881,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_SQLITE=1
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
@@ -1882,6 +1891,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),i386-netware)
 REQUIRE_PACKAGES_RTL=1
@@ -1890,6 +1900,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 REQUIRE_PACKAGES_RTL=1
@@ -1898,6 +1909,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -1913,6 +1925,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
 REQUIRE_PACKAGES_RTL=1
@@ -1923,6 +1936,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -1937,6 +1951,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
 REQUIRE_PACKAGES_RTL=1
@@ -1945,6 +1960,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 REQUIRE_PACKAGES_RTL=1
@@ -1953,6 +1969,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 REQUIRE_PACKAGES_RTL=1
@@ -1961,6 +1978,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -1975,6 +1993,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
 REQUIRE_PACKAGES_RTL=1
@@ -1983,6 +2002,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -1992,6 +2012,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2008,6 +2029,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2023,6 +2045,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2038,6 +2061,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
 REQUIRE_PACKAGES_RTL=1
@@ -2046,6 +2070,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
 REQUIRE_PACKAGES_RTL=1
@@ -2054,6 +2079,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2069,6 +2095,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
 REQUIRE_PACKAGES_RTL=1
@@ -2077,6 +2104,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -2086,6 +2114,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2101,6 +2130,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2116,6 +2146,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 REQUIRE_PACKAGES_RTL=1
@@ -2124,6 +2155,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
 REQUIRE_PACKAGES_RTL=1
@@ -2134,6 +2166,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2148,6 +2181,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
 REQUIRE_PACKAGES_RTL=1
@@ -2156,6 +2190,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -2165,6 +2200,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2180,6 +2216,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2195,6 +2232,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_SQLITE=1
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
@@ -2204,6 +2242,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -2213,6 +2252,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2229,6 +2269,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2246,6 +2287,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2262,6 +2304,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_ODBC=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2274,6 +2317,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),arm-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -2283,6 +2327,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2298,6 +2343,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
 REQUIRE_PACKAGES_RTL=1
@@ -2308,6 +2354,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2322,6 +2369,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2336,6 +2384,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),arm-nds)
 REQUIRE_PACKAGES_RTL=1
@@ -2344,6 +2393,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
 REQUIRE_PACKAGES_RTL=1
@@ -2352,6 +2402,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
 REQUIRE_PACKAGES_RTL=1
@@ -2360,6 +2411,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -2369,6 +2421,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2386,6 +2439,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2400,6 +2454,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
 REQUIRE_PACKAGES_RTL=1
@@ -2408,6 +2463,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -2417,6 +2473,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_MYSQL=1
@@ -2432,6 +2489,7 @@ REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-DB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HTTPD22=1
+REQUIRE_PACKAGES_FASTCGI=1
 endif
 ifdef REQUIRE_PACKAGES_RTL
 PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
@@ -2615,6 +2673,32 @@ ifdef UNITDIR_HTTPD22
 override COMPILER_UNITDIR+=$(UNITDIR_HTTPD22)
 endif
 endif
+ifdef REQUIRE_PACKAGES_FASTCGI
+PACKAGEDIR_FASTCGI:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fastcgi/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_FASTCGI),)
+ifneq ($(wildcard $(PACKAGEDIR_FASTCGI)/units/$(TARGETSUFFIX)),)
+UNITDIR_FASTCGI=$(PACKAGEDIR_FASTCGI)/units/$(TARGETSUFFIX)
+else
+UNITDIR_FASTCGI=$(PACKAGEDIR_FASTCGI)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_FASTCGI)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_FASTCGI) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_FASTCGI)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_FASTCGI=
+UNITDIR_FASTCGI:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fastcgi/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_FASTCGI),)
+UNITDIR_FASTCGI:=$(firstword $(UNITDIR_FASTCGI))
+else
+UNITDIR_FASTCGI=
+endif
+endif
+ifdef UNITDIR_FASTCGI
+override COMPILER_UNITDIR+=$(UNITDIR_FASTCGI)
+endif
+endif
 ifdef REQUIRE_PACKAGES_IBASE
 PACKAGEDIR_IBASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /ibase/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_IBASE),)

+ 11 - 11
packages/fcl-web/Makefile.fpc

@@ -13,19 +13,19 @@ rsts=fpcgi fphtml fpweb websession cgiapp
 
 # these units are listed separately because they don't work for
 # darwin (which does support the rest of fcl-web)
-units_beos=fastcgi custfcgi fpfcgi
-units_haiku=fastcgi custfcgi fpfcgi
-units_freebsd=fastcgi custfcgi fpfcgi
-units_solaris=fastcgi custfcgi fpfcgi
-units_netbsd=fastcgi custfcgi fpfcgi
-units_openbsd=fastcgi custfcgi fpfcgi
-units_linux=fastcgi custfcgi fpfcgi
-units_win32=fastcgi custfcgi fpfcgi
-units_win64=fastcgi custfcgi fpfcgi
-units_wince=fastcgi custfcgi fpfcgi
+units_beos=custfcgi fpfcgi
+units_haiku=custfcgi fpfcgi
+units_freebsd=custfcgi fpfcgi
+units_solaris=custfcgi fpfcgi
+units_netbsd=custfcgi fpfcgi
+units_openbsd=custfcgi fpfcgi
+units_linux=custfcgi fpfcgi
+units_win32=custfcgi fpfcgi
+units_win64=custfcgi fpfcgi
+units_wince=custfcgi fpfcgi
 
 [require]
-packages=fcl-base fcl-xml fcl-db fcl-process httpd22
+packages=fcl-base fcl-xml fcl-db fcl-process httpd22 fastcgi
 packages_darwin=univint
 
 [compiler]

+ 1 - 0
packages/fcl-web/fpmake.pp

@@ -21,6 +21,7 @@ begin
     P.Dependencies.Add('fcl-xml');
     P.Dependencies.Add('fcl-base');
     P.Dependencies.Add('fcl-process');
+    P.Dependencies.Add('fastcgi');
 
     P.Author := 'FreePascal development team';
     P.License := 'LGPL with modification, ';

Fișier diff suprimat deoarece este prea mare
+ 587 - 366
packages/fcl-xml/src/dom_html.pp


+ 491 - 246
packages/fcl-xml/src/htmldefs.pp

@@ -58,21 +58,21 @@ type
       );
 
   THTMLAttributeTag = (
-      atabbr, atacceptcharset, ataccept, ataccesskey, ataction, atalign, atalt, atarchive,
-      ataxis, atborder, atcellpadding, atcellspacing, atchar, atcharoff, atcharset,
-      atchecked, atcite, atclass, atclassid, atcodebase, atcodetype, atcols,
-      atcolspan, atcontent, atcoords, atdata, atdatetime, atdeclare,atdefer,
-      atdir, atdisabled, atenctype, atfor, atframe, atframeborder, atheaders,
-      atheight, athref, athreflang, athttpequiv, atid, atismap, atlabel, atlang,
+      atabbr, atalink, atacceptcharset, ataccept, ataccesskey, ataction, atalign, atalt, atarchive,
+      ataxis, atbackground, atbgcolor, atborder, atcellpadding, atcellspacing, atchar, atcharoff, atcharset,
+      atchecked, atcite, atclass, atclassid, atclear, atcode, atcodebase, atcodetype, atcolor, atcols,
+      atcolspan, atcompact, atcontent, atcoords, atdata, atdatetime, atdeclare,atdefer,
+      atdir, atdisabled, atenctype, atface, atfor, atframe, atframeborder, atheaders,
+      atheight, athref, athreflang, athspace, athttpequiv, atid, atismap, atlabel, atlang, atlink,
       atlongdesc, atmarginheight, atmarginwidth, atmaxlength, atmedia, atmethod,
-      atmultiple, atname, atnohref, atnoresize, atonblur, atonchange, atonclick,
+      atmultiple, atname, atnohref, atnoresize, atnoshade, atnowrap, atobject, atonblur, atonchange, atonclick,
       atondblclick, atonfocus, atonkeydown, atonkeypress, atonkeyup, atonload,
       atonmousedown, atonmousemove, atonmouseout, atonmouseover, atonmouseup,
-      atonreset, atonselect, atonsubmit, atonunload, atprofile, atreadonly,
+      atonreset, atonselect, atonsubmit, atonunload, atprofile, atprompt, atreadonly,
       atrel, atrev, atrows, atrowspan, atrules, atscheme, atscope, atscrolling,
-      atselected, atshape, atsize, atspan, atsrc, atstandby, atstyle, atsummary,
-      attabindex, attarget, attitle, attype, atusemap, atvalign, atvalue,
-      atvaluetype, atwidth
+      atselected, atshape, atsize, atspan, atsrc, atstandby, atstart, atstyle, atsummary,
+      attabindex, attarget, attext, attitle, attype, atusemap, atvalign, atvalue,
+      atvaluetype, atversion, atvlink, atvspace, atwidth
       );
   THTMLAttributeSet = set of THTMLAttributeTag;
 
@@ -97,8 +97,9 @@ type
     efPCDATAContent,                    // may have PCDATA content
     efPreserveWhitespace,               // preserve all whitespace
     efDeprecated,                       // can be dropped in future versions
-    efNoChecks                          // Checks (attributes,subtags,...) can only be implemented in descendants
-    );
+    efNoChecks,                         // Checks (attributes,subtags,...) can only be implemented in descendants
+    efEndTagOptional
+  );
   THTMLElementFlags = set of THTMLElementFlag;
 
   PHTMLElementProps = ^THTMLElementProps;
@@ -114,6 +115,10 @@ const
   BooleanAttributes = [atchecked,atdeclare,atdefer,atdisabled,atnohref,atnoresize,
                     atmultiple,atreadonly,atselected];
 
+  DeprecatedAttributes = [atalink, atbackground, atbgcolor, atclear, atcode, atcolor,
+    atcompact, atface, athspace, atlink, atnoshade, atnowrap, atobject, atprompt,
+    atstart, attext, atvlink, atversion, atvspace];
+
   efSubcontent = [efSubelementContent, efPCDATAContent];
 
   atsi18n = [atlang, atdir];
@@ -184,10 +189,10 @@ const
     (Name: 'col';       Flags: [];
      Attributes: atsattrs+atscellhalign+[atvalign,atspan,atwidth]),
 
-    (Name: 'colgroup';  Flags: [efSubelementContent];
+    (Name: 'colgroup';  Flags: [efSubelementContent, efEndTagOptional];
      Attributes: atsattrs+atscellhalign+[atvalign,atspan,atwidth]),
 
-    (Name: 'dd';        Flags: efSubcontent; Attributes: atsattrs),
+    (Name: 'dd';        Flags: efSubcontent+[efEndTagOptional]; Attributes: atsattrs),
 
     (Name: 'del';       Flags: [efSubelementContent]; Attributes: atsattrs+[atcite,atdatetime]),
 
@@ -195,11 +200,11 @@ const
 
     (Name: 'dir';       Flags: [efSubelementContent,efDeprecated]; Attributes: atsattrs),
 
-    (Name: 'div';       Flags: [efSubelementContent]; Attributes: atsattrs),
+    (Name: 'div';       Flags: efSubContent; Attributes: atsattrs),
 
     (Name: 'dl';        Flags: [efSubelementContent]; Attributes: atsattrs),
 
-    (Name: 'dt';        Flags: [efPCDataContent]; Attributes: atsattrs),
+    (Name: 'dt';        Flags: [efPCDataContent, efEndTagOptional]; Attributes: atsattrs),
 
     (Name: 'em';        Flags: efSubcontent; Attributes: atsattrs),
 
@@ -260,7 +265,7 @@ const
 
     (Name: 'legend';    Flags: efSubcontent; Attributes: atsattrs+[ataccesskey]),
 
-    (Name: 'li';        Flags: efSubcontent; Attributes: atsattrs),
+    (Name: 'li';        Flags: efSubcontent+[efEndTagOptional]; Attributes: atsattrs),
 
     (Name: 'link';      Flags: [];
      Attributes: atsattrs+[atcharset,athref,athreflang,attype,atrel,atrev,atmedia]),
@@ -283,10 +288,10 @@ const
 
     (Name: 'optgroup';  Flags: efSubcontent; Attributes: atsattrs+[atdisabled,atlabel]),
 
-    (Name: 'option';    Flags: efSubcontent;
+    (Name: 'option';    Flags: efSubcontent+[efEndTagOptional];
      Attributes: atsattrs+[atselected,atdisabled,atlabel,atvalue]),
 
-    (Name: 'p';         Flags: efSubcontent; Attributes: atsattrs),
+    (Name: 'p';         Flags: efSubcontent+[efEndTagOptional]; Attributes: atsattrs),
 
     (Name: 'param';     Flags: []; Attributes: [atid,atname,atvalue,atvaluetype,attype]),
 
@@ -324,23 +329,23 @@ const
 
     (Name: 'tbody';     Flags: [efSubelementContent]; Attributes: atsattrs+atscellhalign+[atvalign]),
 
-    (Name: 'td';        Flags: efSubcontent;
+    (Name: 'td';        Flags: efSubcontent+[efEndTagOptional];
      Attributes: atsattrs+atscellhalign+[atvalign,atabbr,ataxis,atheaders,atscope,atrowspan,atcolspan]),
 
     (Name: 'textarea';  Flags: [efPCDATAContent];
      Attributes: atsattrs+[atname,atrows,atcols,atdisabled,atreadonly,attabindex,
                  ataccesskey,atonfocus,atonblur,atonselect,atonchange]),
 
-    (Name: 'tfoot';     Flags: [efSubelementContent]; Attributes: atsattrs+atscellhalign+[atvalign]),
+    (Name: 'tfoot';     Flags: [efSubelementContent,efEndTagOptional]; Attributes: atsattrs+atscellhalign+[atvalign]),
 
-    (Name: 'th';        Flags: efSubcontent;
+    (Name: 'th';        Flags: efSubcontent+[efEndTagOptional];
      Attributes: atsattrs+atscellhalign+[atvalign,atabbr,ataxis,atheaders,atscope,atrowspan,atcolspan]),
 
-    (Name: 'thead';     Flags: [efSubelementContent]; Attributes: atsattrs+atscellhalign+[atvalign]),
+    (Name: 'thead';     Flags: [efSubelementContent, efEndTagOptional]; Attributes: atsattrs+atscellhalign+[atvalign]),
 
     (Name: 'title';     Flags: efSubcontent; Attributes: atsi18n),
 
-    (Name: 'tr';        Flags: [efSubelementContent];
+    (Name: 'tr';        Flags: [efSubelementContent, efEndTagOptional];
      Attributes: atsattrs+atscellhalign+[atvalign]),
 
     (Name: 'tt';        Flags: efSubcontent; Attributes: atsattrs),
@@ -357,22 +362,22 @@ const
 
     );
 
-  HTMLAttributeTag : array [THTMLAttributeTag] of string = (
-      'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alt', 'archive',
-      'axis', 'border', 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset',
-      'checked', 'cite', 'class', 'classid', 'codebase', 'codetype', 'cols',
-      'colspan', 'content', 'coords', 'data', 'datetime', 'declare', 'defer',
-      'dir', 'disabled', 'enctype', 'for', 'frame', 'frameborder', 'headers',
-      'height', 'href', 'hreflang', 'http-equiv', 'id', 'ismap', 'label', 'lang',
+  HTMLAttributeTag : array [THTMLAttributeTag] of String = (
+      'abbr', 'alink', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alt', 'archive',
+      'axis', 'background', 'bgcolor', 'border', 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset',
+      'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols',
+      'colspan', 'compact', 'content', 'coords', 'data', 'datetime', 'declare', 'defer',
+      'dir', 'disabled', 'enctype', 'face', 'for', 'frame', 'frameborder', 'headers',
+      'height', 'href', 'hreflang', 'hspace', 'http-equiv', 'id', 'ismap', 'label', 'lang', 'link',
       'longdesc', 'marginheight', 'marginwidth', 'maxlength', 'media', 'method',
-      'multiple', 'name', 'nohref', 'noresize', 'onblur', 'onchange', 'onclick',
+      'multiple', 'name', 'nohref', 'noresize', 'noshade', 'nowrap', 'object', 'onblur', 'onchange', 'onclick',
       'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload',
       'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup',
-      'onreset', 'onselect', 'onsubmit', 'onunload', 'profile', 'readonly',
+      'onreset', 'onselect', 'onsubmit', 'onunload', 'profile', 'prompt', 'readonly',
       'rel', 'rev', 'rows', 'rowspan', 'rules', 'scheme', 'scope', 'scrolling',
-      'selected', 'shape', 'size', 'span', 'src', 'standby', 'style', 'summary',
-      'tabindex', 'target', 'title', 'type', 'usemap', 'valign', 'value',
-      'valuetype', 'width');
+      'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
+      'tabindex', 'target', 'text', 'title', 'type', 'usemap', 'valign', 'value',
+      'valuetype', 'version', 'vlink', 'vspace', 'width');
 
   HTMLColor : array [THTMLColor] of string =
     ('Black', 'Silver', 'Gray', 'White', 'Maroon', 'Red', 'Purple', 'Fuchsia',
@@ -389,230 +394,470 @@ const
       'radio','submit','reset','file','hidden','image','button');
   HTMLbuttontype : array [THTMLbuttontype] of string = ('','submit','reset','button');
 
+function ResolveHTMLEntityReference(const Name: WideString;
+  var Entity: WideChar): Boolean;
 
-  // ISO8859-1 mapping:
-  HTMLEntities: array[#160..#255] of String = (
-    // 160-191
-    'nbsp', 'iexcl', 'cent', 'pound', 'curren', 'yen', 'brvbar', 'sect',
-    'uml', 'copy', 'ordf', 'laquo', 'not', 'shy', 'reg', 'macr',
-    'deg', 'plusmn', 'sup2', 'sup3', 'acute', 'micro', 'para', 'middot',
-    'cedil', 'sup1', 'ordm', 'raquo', 'frac14', 'frac12', 'frac34', 'iquest',
-    // 192-223
-    'Agrave', 'Aacute', 'Acirc', 'Atilde', 'Auml', 'Aring', 'AElig', 'Ccedil',
-    'Egrave', 'Eacute', 'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml',
-    'ETH', 'Ntilde', 'Ograve', 'Oacute', 'Ocirc', 'Otilde', 'Ouml', 'times',
-    'Oslash', 'Ugrave', 'Uacute', 'Ucirc', 'Uuml', 'Yacute', 'THORN', 'szlig',
-    // 224-255
-    'agrave', 'aacute', 'acirc', 'atilde', 'auml', 'aring', 'aelig', 'ccedil',
-    'egrave', 'eacute', 'ecirc', 'euml', 'igrave', 'iacute', 'icirc', 'iuml',
-    'eth', 'ntilde', 'ograve', 'oacute', 'ocirc', 'otilde', 'ouml', 'divide',
-    'oslash', 'ugrave', 'uacute', 'ucirc', 'uuml', 'yacute', 'thorn', 'yuml');
-
-
-  UnicodeHTMLEntities: array[0..141] of String = (
-    'Alpha',    // #913
-    'Beta',     // #914
-    'Gamma',    // #915
-    'Delta',    // #916
-    'Epsilon',  // #917
-    'Zeta',     // #918
-    'Eta',      // #919
-    'Theta',    // #920
-    'Iota',     // #921
-    'Kappa',    // #922
-    'Lambda',   // #923
-    'Mu',       // #924
-    'Nu',       // #925
-    'Xi',       // #926
-    'Omicron',  // #927
-    'Pi',       // #928
-    'Rho',      // #929
-    'Sigma',    // #931
-    'Tau',      // #932
-    'Upsilon',  // #933
-    'Phi',      // #934
-    'Chi',      // #935
-    'Psi',      // #936
-    'Omega',    // #937
-    'alpha',    // #945
-    'beta',     // #946
-    'gamma',    // #947
-    'delta',    // #948
-    'epsilon',  // #949
-    'zeta',     // #950
-    'eta',      // #951
-    'theta',    // #952
-    'iota',     // #953
-    'kappa',    // #954
-    'lambda',   // #955
-    'mu',       // #956
-    'nu',       // #957
-    'xi',       // #958
-    'omicron',  // #959
-    'pi',       // #960
-    'rho',      // #961
-    'sigmaf',   // #962
-    'sigma',    // #963
-    'tau',      // #964
-    'upsilon',  // #965
-    'phi',      // #966
-    'chi',      // #967
-    'psi',      // #968
-    'omega',    // #969
-    'thetasym', // #977
-    'upsih',    // #978
-    'piv',      // #982
-    'ensp',     // #8194
-    'emsp',     // #8195
-    'thinsp',   // #8201
-    'zwnj',     // #8204
-    'zwj',      // #8205
-    'lrm',      // #8206
-    'rlm',      // #8207
-    'ndash',    // #8211
-    'mdash',    // #8212
-    'lsquo',    // #8216
-    'rsquo',    // #8217
-    'sbquo',    // #8218
-    'ldquo',    // #8220
-    'rdquo',    // #8221
-    'bdquo',    // #8222
-    'dagger',   // #8224
-    'Dagger',   // #8225
-    'bull',     // #8226
-    'hellip',   // #8230
-    'permil',   // #8240
-    'prime',    // #8242
-    'lsaquo',   // #8249
-    'rsaquo',   // #8250
-    'oline',    // #8254
-    'frasl',    // #8260
-    'image',    // #8465
-    'weierp',   // #8472
-    'real',     // #8476
-    'trade',    // #8482
-    'alefsym',  // #8501
-    'larr',     // #8592
-    'uarr',     // #8593
-    'rarr',     // #8594
-    'darr',     // #8595
-    'harr',     // #8596
-    'crarr',    // #8629
-    'lArr',     // #8656
-    'uArr',     // #8657
-    'rArr',     // #8658
-    'dArr',     // #8659
-    'hArr',     // #8660
-    'forall',   // #8704
-    'part',     // #8706
-    'exist',    // #8707
-    'empty',    // #8709
-    'nabla',    // #8711
-    'isin',     // #8712
-    'notin',    // #8713
-    'ni',       // #8715
-    'prod',     // #8719
-    'sum',      // #8721
-    'minus',    // #8722
-    'lowast',   // #8727
-    'radic',    // #8730
-    'prop',     // #8733
-    'infin',    // #8734
-    'ang',      // #8736
-    'and',      // #8743
-    'or',       // #8744
-    'cap',      // #8745
-    'cup',      // #8746
-    'int',      // #8747
-    'there4',   // #8756
-    'sim',      // #8764
-    'cong',     // #8773
-    'asymp',    // #8776
-    'ne',       // #8800
-    'equiv',    // #8801
-    'le',       // #8804
-    'ge',       // #8805
-    'sub',      // #8834
-    'sup',      // #8835
-    'nsub',     // #8836
-    'sube',     // #8838
-    'supe',     // #8839
-    'oplus',    // #8853
-    'otimes',   // #8855
-    'perp',     // #8869
-    'sdot',     // #8901
-    'lceil',    // #8968
-    'rceil',    // #8969
-    'lfloor',   // #8970
-    'rfloor',   // #8971
-    'lang',     // #9001
-    'rang',     // #9002
-    'loz',      // #9674
-    'spades',   // #9824
-    'clubs',    // #9827
-    'hearts',   // #9829
-    'diams'     // #9830
-  );
-
-
-
-function ResolveHTMLEntityReference(const Name: String;
-  var Entity: Char): Boolean;
-
+function IsAutoClose(NewTag, OldTag: THTMLElementTag): Boolean;
 
 
 implementation
 
 uses SysUtils;
 
-function ResolveHTMLEntityReference(const Name: String;
-  var Entity: Char): Boolean;
+{ Define which elements auto-close other elements, modelled after libxml2.
+  This is an array of variable-length lists, each terminated by etUnknown.
+  Indices to first element of each list are provided by AutoCloseIndex array,
+  which *must* be updated after any change. }
+const
+  AutoCloseTab: array[0..277] of THTMLElementTag = (
+
+  etform,       etform, etp, ethr, eth1, eth2, eth3, eth4, eth5, eth6,
+                etdl, etul, etol, etmenu, etdir, etaddress, etpre,
+                ethead, etUnknown,
+  ethead,       etp, etUnknown,
+  ettitle,      etp, etUnknown,
+  etbody,       ethead, etstyle, etlink, ettitle, etp, etUnknown,
+  etframeset,   ethead, etstyle, etlink, ettitle, etp, etUnknown,
+  etli,         etp, eth1, eth2, eth3, eth4, eth5, eth6, etdl, etaddress,
+                etpre, ethead, etli, etUnknown,
+  ethr,         etp, ethead, etUnknown,
+  eth1,         etp, ethead, etUnknown,
+  eth2,         etp, ethead, etUnknown,
+  eth3,         etp, ethead, etUnknown,
+  eth4,         etp, ethead, etUnknown,
+  eth5,         etp, ethead, etUnknown,
+  eth6,         etp, ethead, etUnknown,
+  etdir,        etp, ethead, etUnknown,
+  etaddress,    etp, ethead, etul, etUnknown,
+  etpre,        etp, ethead, etul, etUnknown,
+  etblockquote, etp, ethead, etUnknown,
+  etdl,         etp, etdt, etmenu, etdir, etaddress, etpre,
+                ethead, etUnknown,
+  etdt,         etp, etmenu, etdir, etaddress, etpre,
+                ethead, etdd, etUnknown,
+  etdd,         etp, etmenu, etdir, etaddress, etpre,
+                ethead, etdt, etUnknown,
+  etul,         etp, ethead, etol, etmenu, etdir, etaddress, etpre, etUnknown,
+  etol,         etp, ethead, etul, etUnknown,
+  etmenu,       etp, ethead, etul, etUnknown,
+  etp,          etp, ethead, eth1, eth2, eth3, eth4, eth5, eth6, etUnknown,
+  etdiv,        etp, ethead, etUnknown,
+  etnoscript,   etp, ethead, etUnknown,
+  etcenter,     etfont, etb, eti, etp, ethead, etUnknown,
+  eta,          eta, etUnknown,
+  etcaption,    etp, etUnknown,
+  etcolgroup,   etcaption, etcolgroup, etcol, etp, etUnknown,
+  etcol,        etcaption, etcol, etp, etUnknown,
+  ettable,      etp, ethead, eth1, eth2, eth3, eth4, eth5, eth6, etpre,
+                eta, etUnknown,
+  etth,         etth, ettd, etp, etspan, etfont, eta, etb, eti, etu, etUnknown,
+  ettd,         etth, ettd, etp, etspan, etfont, eta, etb, eti, etu, etUnknown,
+  ettr,         etth, ettd, ettr, etcaption, etcol, etcolgroup, etp, etUnknown,
+  etthead,      etcaption, etcol, etcolgroup, etUnknown,
+  ettfoot,      etth, ettd, ettr, etcaption, etcol, etcolgroup, etthead,
+                ettbody, etp, etUnknown,
+  ettbody,      etth, ettd, ettr, etcaption, etcol, etcolgroup, etthead,
+                ettfoot, ettbody, etp, etUnknown,
+  etoptgroup,   etoption, etUnknown,
+  etoption,     etoption, etUnknown,
+  etfieldset,   etlegend, etp, ethead, eth1, eth2, eth3, eth4, eth5, eth6,
+                etpre, eta, etUnknown,
+  etUnknown);
+
+  AutoCloseIndex: array[0..40] of Integer = (
+    0, 19, 22, 25, 32, 39, 53, 57, 61, 65, 69,
+    73, 77, 81, 85, 90, 95, 99, 108, 117, 126,
+    135, 140, 145, 155, 159, 163, 170, 173, 176,
+    182, 187, 199, 210, 221, 230, 235, 246, 258,
+    261, 264
+  );
+
+{ HTML entities, each preceded with its code. There is a separate list for
+  each entity length, and each list is sorted by character codes.
+  The sole purpose of using AnsiString here is staying compatible with Delphi 7,
+  which is totally broken with respect to handling wide literals.
+}
+
+  ent_2 =
+    #3#$9C  + 'Mu'+
+    #3#$9D  + 'Nu'+
+    #3#$A0  + 'Pi'+
+    #3#$9E  + 'Xi'+
+    #$22#$65+ 'ge'+
+    #0#62   + 'gt'+
+    #$22#$64+ 'le'+
+    #0#60   + 'lt'+
+    #3#$BC  + 'mu'+
+    #$22#$60+ 'ne'+
+    #$22#$0B+ 'ni'+
+    #3#$BD  + 'nu'+
+    #$22#$28+ 'or'+
+    #3#$C0  + 'pi'+
+    #3#$BE  + 'xi';
+
+  ent_3 =
+    #3#$A7  + 'Chi'+
+    #0#208  + 'ETH'+
+    #3#$97  + 'Eta'+
+    #3#$A6  + 'Phi'+
+    #3#$A8  + 'Psi'+
+    #3#$A1  + 'Rho'+
+    #3#$A4  + 'Tau'+
+    #0#38   + 'amp'+
+    #$22#$27+ 'and'+
+    #$22#$20+ 'ang'+
+    #$22#$29+ 'cap'+
+    #3#$C7  + 'chi'+
+    #$22#$2A+ 'cup'+
+    #0#176  + 'deg'+
+    #3#$B7  + 'eta'+
+    #0#240  + 'eth'+
+    #$22#$2B+ 'int'+
+    #$25#$CA+ 'loz'+
+    #$20#$0E+ 'lrm'+
+    #0#172  + 'not'+
+    #3#$C6  + 'phi'+
+    #3#$D6  + 'piv'+
+    #3#$C8  + 'psi'+
+    #0#174  + 'reg'+
+    #3#$C1  + 'rho'+
+    #$20#$0F+ 'rlm'+
+    #0#173  + 'shy'+
+    #$22#$3C+ 'sim'+
+    #$22#$82+ 'sub'+
+    #$22#$11+ 'sum'+
+    #$22#$83+ 'sup'+
+    #3#$C4  + 'tau'+
+    #0#168  + 'uml'+
+    #0#165  + 'yen'+
+    #$20#$0D+ 'zwj';
+
+  ent_4 =
+    #0#196  + 'Auml'+
+    #3#$92  + 'Beta'+
+    #0#203  + 'Euml'+
+    #3#$99  + 'Iota'+
+    #0#207  + 'Iuml'+
+    #0#214  + 'Ouml'+
+    #0#220  + 'Uuml'+
+    #1#$78  + 'Yuml'+
+    #3#$96  + 'Zeta'+
+
+    #0#228  + 'auml'+
+    #3#$B2  + 'beta'+
+    #$20#$22+ 'bull'+
+    #0#162  + 'cent'+
+    #2#$C6  + 'circ'+
+    #$22#$45+ 'cong'+
+    #0#169  + 'copy'+
+    #$21#$D3+ 'dArr'+
+    #$21#$93+ 'darr'+
+    #$20#$03+ 'emsp'+
+    #$20#$02+ 'ensp'+
+    #0#235  + 'euml'+
+    #$20#$AC+ 'euro'+
+    #1#$92  + 'fnof'+
+    #$21#$D4+ 'hArr'+
+    #$21#$94+ 'harr'+
+    #3#$B9  + 'iota'+
+    #$22#$08+ 'isin'+
+    #0#239  + 'iuml'+
+    #$21#$D0+ 'lArr'+
+    #$23#$29+ 'lang'+
+    #$21#$90+ 'larr'+
+    #0#175  + 'macr'+
+    #0#160  + 'nbsp'+
+    #$22#$84+ 'nsub'+
+    #0#170  + 'ordf'+
+    #0#186  + 'ordm'+
+    #0#246  + 'ouml'+
+    #0#182  + 'para'+
+    #$22#$02+ 'part'+
+    #$22#$A5+ 'perp'+
+    #$22#$0F+ 'prod'+
+    #$22#$1D+ 'prop'+
+    #0#34   + 'quot'+
+    #$21#$D2+ 'rArr'+
+    #$23#$2A+ 'rang'+
+    #$21#$92+ 'rarr'+
+    #$21#$1C+ 'real'+
+    #$22#$C5+ 'sdot'+
+    #0#167  + 'sect'+
+    #$22#$86+ 'sube'+
+    #0#185  + 'sup1'+
+    #0#178  + 'sup2'+
+    #0#179  + 'sup3'+
+    #$22#$87+ 'supe'+
+    #$21#$D1+ 'uArr'+
+    #$21#$91+ 'uarr'+
+    #0#252  + 'uuml'+
+    #0#255  + 'yuml'+
+    #3#$B6  + 'zeta'+
+    #$20#$0C+ 'zwnj';
+
+  ent_5 =
+    #0#198  + 'AElig'+
+    #0#194  + 'Acirc'+
+    #3#$91  + 'Alpha'+
+    #0#197  + 'Aring'+
+    #3#$94  + 'Delta'+
+    #0#202  + 'Ecirc'+
+    #3#$93  + 'Gamma'+
+    #0#206  + 'Icirc'+
+    #3#$9A  + 'Kappa'+
+    #1#$52  + 'OElig'+
+    #0#212  + 'Ocirc'+
+    #3#$A9  + 'Omega'+
+    #$20#$33+ 'Prime'+
+    #3#$A3  + 'Sigma'+
+    #0#222  + 'THORN'+
+    #3#$98  + 'Theta'+
+    #0#219  + 'Ucirc'+
+
+    #0#226  + 'acirc'+
+    #0#180  + 'acute'+
+    #0#230  + 'aelig'+
+    #3#$B1  + 'alpha'+
+    #0#229  + 'aring'+
+    #$22#$48+ 'asymp'+
+    #$20#$1E+ 'bdquo'+
+    #0#184  + 'cedil'+
+    #$26#$63+ 'clubs'+
+    #$21#$B5+ 'crarr'+
+    #3#$B4  + 'delta'+
+    #$26#$66+ 'diams'+
+    #0#234  + 'ecirc'+
+    #$22#$05+ 'empty'+
+    #$22#$61+ 'equiv'+
+    #$22#$03+ 'exist'+
+    #$20#$44+ 'frasl'+
+    #3#$B3  + 'gamma'+
+    #0#238  + 'icirc'+
+    #0#161  + 'iexcl'+
+    #$21#$11+ 'image'+
+    #$22#$1E+ 'infin'+
+    #3#$BA  + 'kappa'+
+    #0#171  + 'laquo'+
+    #$23#$08+ 'lceil'+
+    #$20#$1C+ 'ldquo'+
+    #$20#$18+ 'lsquo'+
+    #$20#$14+ 'mdash'+
+    #0#181  + 'micro'+
+    #$22#$12+ 'minus'+
+    #$22#$07+ 'nabla'+
+    #$20#$13+ 'ndash'+
+    #$22#$09+ 'notin'+
+    #0#244  + 'ocirc'+
+    #1#$53  + 'oelig'+
+    #$20#$3E+ 'oline'+
+    #3#$C9  + 'omega'+
+    #$22#$95+ 'oplus'+
+    #0#163  + 'pound'+
+    #$20#$32+ 'prime'+
+    #$22#$1A+ 'radic'+
+    #0#187  + 'raquo'+
+    #$23#$09+ 'rceil'+
+    #$20#$1D+ 'rdquo'+
+    #$20#$19+ 'rsquo'+
+    #$20#$1A+ 'sbquo'+
+    #3#$C3  + 'sigma'+
+    #0#223  + 'szlig'+
+    #3#$B8  + 'theta'+
+    #0#254  + 'thorn'+
+    #2#$DC  + 'tilde'+
+    #0#215  + 'times'+
+    #$21#$22+ 'trade'+
+    #0#251  + 'ucirc'+
+    #3#$D2  + 'upsih';
+
+  ent_6 =
+    #0#193  + 'Aacute'+
+    #0#192  + 'Agrave'+
+    #0#195  + 'Atilde'+
+    #0#199  + 'Ccedil'+
+    #$20#$21+ 'Dagger'+
+    #0#201  + 'Eacute'+
+    #0#200  + 'Egrave'+
+    #0#205  + 'Iacute'+
+    #0#204  + 'Igrave'+
+    #3#$9B  + 'Lambda'+
+    #0#209  + 'Ntilde'+
+    #0#211  + 'Oacute'+
+    #0#210  + 'Ograve'+
+    #0#216  + 'Oslash'+
+    #0#213  + 'Otilde'+
+    #1#$60  + 'Scaron'+
+    #0#218  + 'Uacute'+
+    #0#217  + 'Ugrave'+
+    #0#221  + 'Yacute'+
+
+    #0#225  + 'aacute'+
+    #0#224  + 'agrave'+
+    #0#227  + 'atilde'+
+    #0#166  + 'brvbar'+
+    #0#231  + 'ccedil'+
+    #0#164  + 'curren'+
+    #$20#$20+ 'dagger'+
+    #0#247  + 'divide'+
+    #0#233  + 'eacute'+
+    #0#232  + 'egrave'+
+    #$22#$00+ 'forall'+
+    #0#189  + 'frac12'+
+    #0#188  + 'frac14'+
+    #0#190  + 'frac34'+
+    #$26#$65+ 'hearts'+
+    #$20#$26+ 'hellip'+
+    #0#237  + 'iacute'+
+    #0#236  + 'igrave'+
+    #0#191  + 'iquest'+
+    #3#$BB  + 'lambda'+
+    #$23#$0A+ 'lfloor'+
+    #$22#$17+ 'lowast'+
+    #$20#$39+ 'lsaquo'+
+    #0#183  + 'middot'+
+    #0#241  + 'ntilde'+
+    #0#243  + 'oacute'+
+    #0#242  + 'ograve'+
+    #0#248  + 'oslash'+
+    #0#245  + 'otilde'+
+    #$22#$97+ 'otimes'+
+    #$20#$30+ 'permil'+
+    #0#177  + 'plusmn'+
+    #$23#$0B+ 'rfloor'+
+    #$20#$3A+ 'rsaquo'+
+    #1#$61  + 'scaron'+
+    #3#$C2  + 'sigmaf'+
+    #$26#$60+ 'spades'+
+    #$22#$34+ 'there4'+
+    #$20#$09+ 'thinsp'+
+    #0#250  + 'uacute'+
+    #0#249  + 'ugrave'+
+    #$21#$18+ 'weierp'+
+    #0#253  + 'yacute';
+
+  ent_7 =
+    #3#$95  + 'Epsilon'+
+    #3#$9F  + 'Omicron'+
+    #3#$A5  + 'Upsilon'+
+    #$21#$35+ 'alefsym'+
+    #3#$B5  + 'epsilon'+
+    #3#$BF  + 'omicron'+
+    #3#$C5  + 'upsilon';
+
+  ent_8 =
+    #3#$D1  + 'thetasym';
+
+  strs: array[2..8] of string = (
+    ent_2, ent_3, ent_4, ent_5, ent_6, ent_7, ent_8
+  );
+
+function BSearch(P: PWideChar; Len: Integer; const data: string): WideChar;
 var
-  Ent: Char;
-  i: Integer;
+  L, H, mid, J, C: Integer;
 begin
-  if Name = 'quot' then
-  begin
-    Entity := '"';
-    Result := True;
-  end else if Name = 'apos' then
-  begin
-    Entity := '''';
-    Result := True;
-  end else if Name = 'amp' then
+  Result := #0;
+  L := 0;
+  H := (Length(data)+1) div (Len+2);
+  while L <= H do
   begin
-    Entity := '&';
-    Result := True;
-  end else if Name = 'lt' then
-  begin
-    Entity := '<';
-    Result := True;
-  end else if Name = 'gt' then
-  begin
-    Entity := '>';
-    Result := True;
-  end else if (Length(Name) > 0) and (Name[1] = '#') then
-  begin
-    for i := 2 to Length(Name) do
-      if (Name[i] < '0') or (Name[i] > '9') then
-        break;
-    if i > 2 then
+    mid := L + ((H - L) shr 1);
+    J := 0;
+    repeat
+      C := ord(P[J]) - ord(data[mid*(Len+2)+3+J]);
+      Inc(J);
+    until (C <> 0) or (J >= Len);
+    if C > 0 then L := mid + 1 else
     begin
-      Entity := Chr(StrToInt(Copy(Name, 2, i - 1)));
-      Result := True;
-    end else
-      Result := False;
-  end else
+      H := mid - 1;
+      if C = 0 then
+      begin
+        Result := WideChar((ord(data[mid*(Len+2)+1]) shl 8) or ord(data[mid*(Len+2)+2]));
+        Exit;
+      end;
+    end;
+  end;
+end;
+
+{
+  Remaining issues:
+  1) UTF-16 surrogate pairs
+  2) HTML accepts uppercase 'X' for hex notation, but XML does not.
+  3) 'apos' is used in xml/xhtml, but not in HTML 4.01
+}
+
+function ResolveHTMLEntityReference(const Name: WideString;
+  var Entity: WideChar): Boolean;
+var
+  i, L: Integer;
+  value: Integer;
+begin
+  L := Length(Name);
+  if (L > 1) and (Name[1] = '#') then
   begin
-    for Ent := Low(HTMLEntities) to High(HTMLEntities) do
-      if HTMLEntities[Ent] = Name then
+    value := 0;
+    if (Name[2] = 'x') or (Name[2] = 'X') then
+    begin
+      i := 3;
+      while i <= L do
       begin
-        Entity := Ent;
-        Result := True;
-        exit;
+        case Name[i] of
+          '0'..'9': Value := Value * 16 + Ord(Name[i]) - Ord('0');
+          'a'..'f': Value := Value * 16 + Ord(Name[i]) - (Ord('a') - 10);
+          'A'..'F': Value := Value * 16 + Ord(Name[i]) - (Ord('A') - 10);
+        else
+          Break;
+        end;
+        Inc(i);
       end;
-    Result := False;
+    end
+    else
+    begin
+      i := 2;
+      while i <= L do
+      begin
+        case Name[i] of
+          '0'..'9': Value := Value * 10 + Ord(Name[i]) - Ord('0');
+        else
+          Break;
+        end;
+        Inc(i);
+      end;
+    end;
+    Result := (i = L+1);
+    if Result then
+      Entity := WideChar(Value);
+  end
+  else
+  begin
+    case L of
+      2..8: Entity := BSearch(PWideChar(Name), L, strs[L]);
+    else
+      Entity := #0;
+    end;
+    Result := (Entity <> #0);
   end;
 end;
 
+function IsAutoClose(NewTag, OldTag: THTMLElementTag): Boolean;
+var
+  i, j: Integer;
+begin
+  Result := False;
+  for i := 0 to high(AutoCloseIndex) do
+    if NewTag = AutoCloseTab[AutoCloseIndex[i]] then
+    begin
+      j := AutoCloseIndex[i]+1;
+      while AutoCloseTab[j] <> etUnknown do
+      begin
+        if AutoCloseTab[j] = OldTag then
+        begin
+          Result := True;
+          Exit;
+        end;
+        Inc(j);
+      end;
+      Exit;
+    end;
+end;
+
 end.

+ 17 - 1
packages/fcl-xml/src/htmwrite.pp

@@ -336,21 +336,37 @@ var
   s: string;
   ElFlags: THTMLElementFlags;
   j: THTMLElementTag;
+  meta: Boolean;
 begin
   if not FInsideTextNode then
     wrtIndent;
-    
+
+  meta := False;
   s := LowerCase(node.NodeName);
   ElFlags := [efSubelementContent, efPCDATAContent];    // default flags
   for j := Low(THTMLElementTag) to High(THTMLElementTag) do
     if HTMLElementProps[J].Name = s then
     begin
       ElFlags := HTMLElementProps[j].Flags;
+      if j = etMeta then
+        meta := True;
       break;
     end;
 
   wrtChr('<');
   wrtStr(TDOMElement(node).TagName);
+
+  { Force charset label to utf-8, because it is the encoding we actually write }
+  if meta then
+  begin
+    s := TDOMElement(node).GetAttribute('http-equiv');
+    if SameText(s, 'content-type') then
+    begin
+      wrtStr(' content="text/html; charset=utf-8" http-equiv="Content-Type">');
+      Exit;
+    end;
+  end;
+
   if node.HasAttributes then
     for i := 0 to node.Attributes.Length - 1 do
     begin

+ 48 - 23
packages/fcl-xml/src/sax.pp

@@ -27,6 +27,8 @@ uses SysUtils, Classes;
 
 resourcestring
   SSAXAttributeIndexError = 'Invalid attribute index %d';
+  SSAXUnrecognizedFeature = 'Unknown SAX feature: "%s"';
+  SSAXUnrecognizedProperty = 'Unknown SAX property: "%s"';
 
 const
   XMLNS = 'http://www.w3.org/XML/1998/namespace';
@@ -47,6 +49,7 @@ type
   end;
 
   ESAXParseException = class(ESAXError);
+  ESAXNotRecognizedException = class(ESAXError);
 
 
 { TSAXInputSource: A single input source for an XML entity }
@@ -175,40 +178,40 @@ type
     FCurColumnNumber, FCurLineNumber: Integer;
     FCurPublicID, FCurSystemID: SAXString;
 
-    function GetFeature(const Name: String): Boolean; dynamic; abstract;
-    function GetProperty(const Name: String): TObject; dynamic; abstract;
-    procedure SetFeature(const Name: String; Value: Boolean); dynamic; abstract;
-    procedure SetProperty(const Name: String; Value: TObject); dynamic; abstract;
+    function GetFeature(const Name: String): Boolean; virtual;
+    function GetProperty(const Name: String): TObject; virtual;
+    procedure SetFeature(const Name: String; Value: Boolean); virtual;
+    procedure SetProperty(const Name: String; Value: TObject); virtual;
 
     // Notification of the content of a document
-    procedure DoCharacters(const ch: PSAXChar; AStart, ALength: Integer); dynamic;
-    procedure DoComment(const ch: PSAXChar; AStart, ALength: Integer); dynamic;
-    procedure DoEndDocument; dynamic;
-    procedure DoEndElement(const NamespaceURI, LocalName, QName: SAXString); dynamic;
-    procedure DoEndPrefixMapping(const Prefix: SAXString); dynamic;
-    procedure DoIgnorableWhitespace(const ch: PSAXChar; AStart, ALength: Integer); dynamic;
-    procedure DoProcessingInstruction(const Target, Data: SAXString); dynamic;
-    procedure DoSkippedEntity(const Name: SAXString); dynamic;
-    procedure DoStartDocument; dynamic;
-    procedure DoStartElement(const NamespaceURI, LocalName, QName: SAXString; Atts: TSAXAttributes); dynamic;
-    procedure DoStartPrefixMapping(const Prefix, URI: SAXString); dynamic;
+    procedure DoCharacters(const ch: PSAXChar; AStart, ALength: Integer); virtual;
+    procedure DoComment(const ch: PSAXChar; AStart, ALength: Integer); virtual;
+    procedure DoEndDocument; virtual;
+    procedure DoEndElement(const NamespaceURI, LocalName, QName: SAXString); virtual;
+    procedure DoEndPrefixMapping(const Prefix: SAXString); virtual;
+    procedure DoIgnorableWhitespace(const ch: PSAXChar; AStart, ALength: Integer); virtual;
+    procedure DoProcessingInstruction(const Target, Data: SAXString); virtual;
+    procedure DoSkippedEntity(const Name: SAXString); virtual;
+    procedure DoStartDocument; virtual;
+    procedure DoStartElement(const NamespaceURI, LocalName, QName: SAXString; Atts: TSAXAttributes); virtual;
+    procedure DoStartPrefixMapping(const Prefix, URI: SAXString); virtual;
 
     // Notification of basic DTD-related events
-    procedure DoNotationDecl(const Name, PublicID, SystemID: SAXString); dynamic;
+    procedure DoNotationDecl(const Name, PublicID, SystemID: SAXString); virtual;
     procedure DoUnparsedEntityDecl(const Name, PublicID,
-      SystemID, NotationName: SAXString); dynamic;
+      SystemID, NotationName: SAXString); virtual;
 
     // Resolving entities
     function DoResolveEntity(const PublicID,
-      SystemID: SAXString): TSAXInputSource; dynamic;
+      SystemID: SAXString): TSAXInputSource; virtual;
 
     // SAX error handlers
-    procedure DoError(AException: ESAXParseException); dynamic;
-    procedure DoFatalError(AException: ESAXParseException); dynamic;
-    procedure DoWarning(AException: ESAXParseException); dynamic;
+    procedure DoError(AException: ESAXParseException); virtual;
+    procedure DoFatalError(AException: ESAXParseException); virtual;
+    procedure DoWarning(AException: ESAXParseException); virtual;
   public
-    procedure Parse(AInput: TSAXInputSource); dynamic; abstract; overload;
-    procedure Parse(const SystemID: SAXString); dynamic; overload;
+    procedure Parse(AInput: TSAXInputSource); virtual; abstract; overload;
+    procedure Parse(const SystemID: SAXString); virtual; overload;
     procedure ParseStream(AStream: TStream);
 
     // Current location
@@ -672,6 +675,28 @@ begin
     OnUnparsedEntityDecl(Self, Name, PublicID, SystemID, NotationName);
 end;
 
+function TSAXReader.GetFeature(const Name: String): Boolean;
+begin
+  raise ESAXNotRecognizedException.CreateFmt(SSAXUnrecognizedFeature, [Name]);
+  Result := False;
+end;
+
+function TSAXReader.GetProperty(const Name: String): TObject;
+begin
+  raise ESAXNotRecognizedException.CreateFmt(SSAXUnrecognizedProperty, [Name]);
+  Result := nil;
+end;
+
+procedure TSAXReader.SetFeature(const Name: String; Value: Boolean);
+begin
+  raise ESAXNotRecognizedException.CreateFmt(SSAXUnrecognizedFeature, [Name]);
+end;
+
+procedure TSAXReader.SetProperty(const Name: String; Value: TObject);
+begin
+  raise ESAXNotRecognizedException.CreateFmt(SSAXUnrecognizedProperty, [Name]);
+end;
+
 procedure TSAXReader.DoCharacters(const ch: PSAXChar;
   AStart, ALength: Integer);
 begin

+ 135 - 108
packages/fcl-xml/src/sax_html.pp

@@ -52,6 +52,11 @@ type
     FTokenText: SAXString;
     FCurStringValueDelimiter: Char;
     FAttrNameRead: Boolean;
+    FStack: array of THTMLElementTag;
+    FNesting: Integer;
+    procedure AutoClose(const aName: string);
+    procedure NamePush(const aName: string);
+    procedure NamePop;
   protected
     procedure EnterNewScannerContext(NewContext: THTMLScannerContext);
   public
@@ -88,7 +93,6 @@ type
       Start, Count: Integer);
     procedure ReaderIgnorableWhitespace(Sender: TObject; const ch: PSAXChar;
       Start, Count: Integer);
-    procedure ReaderSkippedEntity(Sender: TObject; const Name: SAXString);
     procedure ReaderStartElement(Sender: TObject;
       const NamespaceURI, LocalName, RawName: SAXString; Attr: TSAXAttributes);
     procedure ReaderEndElement(Sender: TObject;
@@ -122,6 +126,7 @@ constructor THTMLReader.Create;
 begin
   inherited Create;
   FScannerContext := scUnknown;
+  SetLength(FStack, 16);
 end;
 
 destructor THTMLReader.Destroy;
@@ -193,12 +198,10 @@ begin
                 EnterNewScannerContext(scTag);
               end;
             else
-              EnterNewScannerContext(scText);
+              FScannerContext := scText;
           end;
         scText:
           case Buffer[BufferPos] of
-            #9, #10, #13, ' ':
-              EnterNewScannerContext(scWhitespace);
             '&':
               begin
                 Inc(BufferPos);
@@ -267,114 +270,142 @@ begin
   end;
 end;
 
-procedure THTMLReader.EnterNewScannerContext(NewContext: THTMLScannerContext);
+function LookupTag(const aName: string): THTMLElementTag;
+var
+  j: THTMLElementTag;
+begin
+  for j := Low(THTMLElementTag) to High(THTMLElementTag) do
+    if SameText(HTMLElementProps[j].Name, aName) then
+    begin
+      Result := j;
+      Exit;
+    end;
+  Result := etUnknown;
+end;
 
-  function SplitTagString(const s: String; var Attr: TSAXAttributes): String;
-  var
-    i, j: Integer;
-    AttrName: String;
-    ValueDelimiter: Char;
-    DoIncJ: Boolean;
+procedure THTMLReader.AutoClose(const aName: string);
+var
+  newTag: THTMLElementTag;
+begin
+  newTag := LookupTag(aName);
+  while (FNesting > 0) and IsAutoClose(newTag, FStack[FNesting-1]) do
   begin
-    Attr := nil;
-    i := Pos(' ', s);
-    if i <= 0 then
-      Result := LowerCase(s)
-    else
-    begin
-      Result := LowerCase(Copy(s, 1, i - 1));
-      Attr := TSAXAttributes.Create;
+    DoEndElement('', HTMLElementProps[FStack[FNesting-1]].Name, '');
+    namePop;
+  end;
+end;
 
-      Inc(i);
+procedure THTMLReader.NamePush(const aName: string);
+var
+  tag: THTMLElementTag;
+begin
+  tag := LookupTag(aName);
+  if FNesting >= Length(FStack) then
+    SetLength(FStack, FNesting * 2);
+  FStack[FNesting] := tag;
+  Inc(FNesting);
+end;
 
-      while (i <= Length(s)) and (s[i] in WhitespaceChars) do
-        Inc(i);
+procedure THTMLReader.NamePop;
+begin
+  if FNesting <= 0 then
+    Exit;
+  Dec(FNesting);
+  FStack[FNesting] := etUnknown;
+end;
 
-      SetLength(AttrName, 0);
-      j := i;
+function SplitTagString(const s: String; var Attr: TSAXAttributes): String;
+var
+  i, j: Integer;
+  AttrName: String;
+  ValueDelimiter: Char;
+  DoIncJ: Boolean;
+begin
+  Attr := nil;
+  i := Pos(' ', s);
+  if i <= 0 then
+    Result := LowerCase(s)
+  else
+  begin
+    Result := LowerCase(Copy(s, 1, i - 1));
+    Attr := TSAXAttributes.Create;
+    Inc(i);
 
-      while j <= Length(s) do
-        if s[j] = '=' then
+    while (i <= Length(s)) and (s[i] in WhitespaceChars) do
+      Inc(i);
+
+    SetLength(AttrName, 0);
+    j := i;
+
+    while j <= Length(s) do
+      if s[j] = '=' then
+      begin
+        AttrName := LowerCase(Copy(s, i, j - i));
+        Inc(j);
+        if (j < Length(s)) and ((s[j] = '''') or (s[j] = '"')) then
         begin
-          AttrName := LowerCase(Copy(s, i, j - i));
+          ValueDelimiter := s[j];
           Inc(j);
-          if (j < Length(s)) and ((s[j] = '''') or (s[j] = '"')) then
+        end else
+          ValueDelimiter := #0;
+        i := j;
+        DoIncJ := False;
+        while j <= Length(s) do
+          if ValueDelimiter = #0 then
+            if s[j] in WhitespaceChars then
+              break
+            else
+              Inc(j)
+          else if s[j] = ValueDelimiter then
           begin
-            ValueDelimiter := s[j];
-            Inc(j);
+            DoIncJ := True;
+            break
           end else
-            ValueDelimiter := #0;
-          i := j;
-          DoIncJ := False;
-          while j <= Length(s) do
-            if ValueDelimiter = #0 then
-              if s[j] in WhitespaceChars then
-                break
-              else
-                Inc(j)
-            else if s[j] = ValueDelimiter then
-            begin
-              DoIncJ := True;
-              break
-            end else
-              Inc(j);
+            Inc(j);
 
-          Attr.AddAttribute('', AttrName, '', '', Copy(s, i, j - i));
+        Attr.AddAttribute('', AttrName, '', '', Copy(s, i, j - i));
 
-          if DoIncJ then
-            Inc(j);
+        if DoIncJ then
+          Inc(j);
 
-          while (j <= Length(s)) and (s[j] in WhitespaceChars) do
-            Inc(j);
-          i := j;
-        end
-        else if s[j] in WhitespaceChars then
-        begin
-          Attr.AddAttribute('', Copy(s, i, j - i), '', '', '');
+        while (j <= Length(s)) and (s[j] in WhitespaceChars) do
           Inc(j);
-          while (j <= Length(s)) and (s[j] in WhitespaceChars) do
-            Inc(j);
-          i := j;
-        end else
+        i := j;
+      end
+      else if s[j] in WhitespaceChars then
+      begin
+        Attr.AddAttribute('', Copy(s, i, j - i), '', '', '');
+        Inc(j);
+        while (j <= Length(s)) and (s[j] in WhitespaceChars) do
           Inc(j);
-    end;
+        i := j;
+      end else
+        Inc(j);
   end;
+end;
 
+procedure THTMLReader.EnterNewScannerContext(NewContext: THTMLScannerContext);
 var
   Attr: TSAXAttributes;
-  EntString, TagName: String;
-  Found: Boolean;
-  Ent: Char;
+  TagName: String;
+  Ent: SAXChar;
   i: Integer;
+  elTag: THTMLElementTag;
 begin
   case ScannerContext of
     scWhitespace:
-      DoIgnorableWhitespace(PSAXChar(TokenText), 1, Length(TokenText));
+      if (FNesting > 0) and (efPCDataContent in HTMLElementProps[FStack[FNesting-1]].Flags) then
+        DoCharacters(PSAXChar(TokenText), 0, Length(TokenText))
+      else
+        DoIgnorableWhitespace(PSAXChar(TokenText), 0, Length(TokenText));
     scText:
       DoCharacters(PSAXChar(TokenText), 0, Length(TokenText));
     scEntityReference:
       begin
         if ResolveHTMLEntityReference(TokenText, Ent) then
-        begin
-          EntString := Ent;
-          DoCharacters(PSAXChar(EntString), 0, 1);
-        end else
-        begin
-          { Is this a predefined Unicode character entity? We must check this,
-            as undefined entities must be handled as text, for compatiblity
-            to popular browsers... }
-          Found := False;
-          for i := Low(UnicodeHTMLEntities) to High(UnicodeHTMLEntities) do
-            if UnicodeHTMLEntities[i] = TokenText then
-            begin
-              Found := True;
-              break;
-            end;
-          if Found then
-            DoSkippedEntity(TokenText)
-          else
-            DoCharacters(PSAXChar('&' + TokenText), 0, Length(TokenText) + 1);
-        end;
+          DoCharacters(@Ent, 0, 1)
+        else
+          DoCharacters(PSAXChar('&' + TokenText + ';'), 0, Length(TokenText) + 2);
       end;
     scTag:
       if Length(TokenText) > 0 then
@@ -385,18 +416,35 @@ begin
           setlength(fTokenText,length(fTokenText)-1);
           // Do NOT combine to a single line, as Attr is an output value!
           TagName := SplitTagString(TokenText, Attr);
+          AutoClose(TagName);
           DoStartElement('', TagName, '', Attr);
           DoEndElement('', TagName, '');
         end
         else if TokenText[1] = '/' then
         begin
-          DoEndElement('',
-            SplitTagString(Copy(TokenText, 2, Length(TokenText)), Attr), '');
+          Delete(FTokenText, 1, 1);
+          TagName := SplitTagString(TokenText, Attr);
+          elTag := LookupTag(TagName);
+          i := FNesting-1;
+          while (i >= 0) and (FStack[i] <> elTag) and
+            (efEndTagOptional in HTMLElementProps[FStack[i]].Flags) do
+            Dec(i);
+          if (i>=0) and (FStack[i] = elTag) then
+            while FStack[FNesting-1] <> elTag do
+            begin
+              DoEndElement('', HTMLElementProps[FStack[FNesting-1]].Name, '');
+              namePop;
+            end;
+
+          DoEndElement('', TagName, '');
+          namePop;
         end
         else if TokenText[1] <> '!' then
         begin
           // Do NOT combine to a single line, as Attr is an output value!
           TagName := SplitTagString(TokenText, Attr);
+          AutoClose(TagName);
+          namePush(TagName);
           DoStartElement('', TagName, '', Attr);
         end;
         if Assigned(Attr) then
@@ -419,7 +467,6 @@ begin
   FReader := AReader;
   FReader.OnCharacters := @ReaderCharacters;
   FReader.OnIgnorableWhitespace := @ReaderIgnorableWhitespace;
-  FReader.OnSkippedEntity := @ReaderSkippedEntity;
   FReader.OnStartElement := @ReaderStartElement;
   FReader.OnEndElement := @ReaderEndElement;
   FDocument := ADocument;
@@ -430,16 +477,7 @@ end;
 constructor THTMLToDOMConverter.CreateFragment(AReader: THTMLReader;
   AFragmentRoot: TDOMNode);
 begin
-  inherited Create;
-  FReader := AReader;
-  FReader.OnCharacters := @ReaderCharacters;
-  FReader.OnIgnorableWhitespace := @ReaderIgnorableWhitespace;
-  FReader.OnSkippedEntity := @ReaderSkippedEntity;
-  FReader.OnStartElement := @ReaderStartElement;
-  FReader.OnEndElement := @ReaderEndElement;
-  FDocument := AFragmentRoot.OwnerDocument;
-  FElementStack := TList.Create;
-  FNodeBuffer := TList.Create;
+  Create(AReader, AFragmentRoot.OwnerDocument);
   FragmentRoot := AFragmentRoot;
   IsFragmentMode := True;
 end;
@@ -487,17 +525,6 @@ begin
   FNodeBuffer.Add(NodeInfo);
 end;
 
-procedure THTMLToDOMConverter.ReaderSkippedEntity(Sender: TObject;
-  const Name: SAXString);
-var
-  NodeInfo: THTMLNodeInfo;
-begin
-  NodeInfo := THTMLNodeInfo.Create;
-  NodeInfo.NodeType := ntEntityReference;
-  NodeInfo.DOMNode := FDocument.CreateEntityReference(Name);
-  FNodeBuffer.Add(NodeInfo);
-end;
-
 procedure THTMLToDOMConverter.ReaderStartElement(Sender: TObject;
   const NamespaceURI, LocalName, RawName: SAXString; Attr: TSAXAttributes);
 var

+ 25 - 26
packages/fcl-xml/src/sax_xml.pp

@@ -107,6 +107,11 @@ uses htmldefs; // for entities...
 
 const
   WhitespaceChars = [#9, #10, #13, ' '];
+  char_lt: SAXChar = '<';
+  char_gt: SAXChar = '>';
+  char_quot: SAXChar = '"';
+  char_apos: SAXChar = '''';
+  char_amp: SAXChar = '&';
 
 
 constructor TSAXXMLReader.Create;
@@ -184,12 +189,10 @@ begin
                 EnterNewScannerContext(scTag);
               end;
             else
-              EnterNewScannerContext(scText);
+              FScannerContext := scText
           end;
         scText:
           case Buffer[BufferPos] of
-            #9, #10, #13, ' ':
-              EnterNewScannerContext(scWhitespace);
             '&':
               begin
                 Inc(BufferPos);
@@ -333,9 +336,9 @@ procedure TSAXXMLReader.EnterNewScannerContext(NewContext: TXMLScannerContext);
 
 var
   Attr: TSAXAttributes;
-  EntString, TagName: String;
+  TagName: String;
   Found: Boolean;
-  Ent: Char;
+  Ent: SAXChar;
   i: Integer;
 begin
   case ScannerContext of
@@ -345,27 +348,23 @@ begin
       DoCharacters(PSAXChar(TokenText), 0, Length(TokenText));
     scEntityReference:
       begin
-        if ResolveHTMLEntityReference(TokenText, Ent) then
-        begin
-          EntString := Ent;
-          DoCharacters(PSAXChar(EntString), 0, 1);
-        end else
-        begin
-          { Is this a predefined Unicode character entity? We must check this,
-            as undefined entities must be handled as text, for compatiblity
-            to popular browsers... }
-          Found := False;
-          for i := Low(UnicodeHTMLEntities) to High(UnicodeHTMLEntities) do
-            if UnicodeHTMLEntities[i] = TokenText then
-            begin
-              Found := True;
-              break;
-            end;
-          if Found then
-            DoSkippedEntity(TokenText)
-          else
-            DoCharacters(PSAXChar('&' + TokenText), 0, Length(TokenText) + 1);
-        end;
+        if (Length(TokenText) >= 2) and (TokenText[1] = '#') and
+          (((TokenText[2] >= '0') and (TokenText[2] <= '9')) or (TokenText[2]='x')) and
+          // here actually using it to resolve character references
+          ResolveHTMLEntityReference(TokenText, Ent) then
+            DoCharacters(@Ent, 0, 1)
+        else if TokenText = 'lt' then
+          DoCharacters(@char_lt, 0, 1)
+        else if TokenText = 'gt' then
+          DoCharacters(@char_gt, 0, 1)
+        else if TokenText = 'amp' then
+          DoCharacters(@char_amp, 0, 1)
+        else if TokenText = 'quot' then
+          DoCharacters(@char_quot, 0, 1)
+        else if TokenText = 'apos' then
+          DoCharacters(@char_apos, 0, 1)
+        else
+          DoSkippedEntity(TokenText);
       end;
     scTag:
       if Length(TokenText) > 0 then

+ 27 - 18
packages/fcl-xml/src/xmlread.pp

@@ -201,7 +201,7 @@ type
     DTDSubsetType: TDTDSubsetType;
     constructor Create(const AData: WideString);
     procedure NextChar;
-    procedure NewLine(p: PWideChar); virtual;
+    procedure NewLine; virtual;
     function SkipUntil(var ToFill: TWideCharBuf; const Delim: TSetOfChar;
       wsflag: PBoolean = nil): WideChar; virtual;
     procedure Initialize; virtual;
@@ -228,7 +228,7 @@ type
     procedure AfterConstruction; override;
     destructor Destroy; override;
     function SetEncoding(const AEncoding: string): Boolean; override;
-    procedure NewLine(p: PWideChar); override;
+    procedure NewLine; override;
     function SkipUntil(var ToFill: TWideCharBuf; const Delim: TSetOfChar;
       wsflag: PBoolean = nil): WideChar; override;
     procedure Initialize; override;
@@ -844,10 +844,10 @@ begin
   Result := False;
 end;
 
-procedure TXMLCharSource.NewLine(p: PWideChar);
+procedure TXMLCharSource.NewLine;
 begin
   Inc(FLineNo);
-  LFPos := p;
+  LFPos := FBuf;
 end;
 
 function TXMLCharSource.SkipUntil(var ToFill: TWideCharBuf; const Delim: TSetOfChar;
@@ -860,7 +860,7 @@ begin
   nonws := False;
   repeat
     if FBuf^ = #10 then
-      NewLine(FBuf);
+      NewLine;
     if (FBuf^ < #255) and (Char(ord(FBuf^)) in Delim) then
       Break;
     if (FBuf^ > #32) or not (Char(ord(FBuf^)) in [#32, #9, #10, #13]) then
@@ -910,8 +910,11 @@ begin
 // count line endings to obtain correct error location
   while FBuf < FBufEnd do
   begin
-    if FBuf^ = #10 then
+    if (FBuf^ = #10) or (FBuf^ = #13) or (FXML11Rules and ((FBuf^ = #$85) or (FBuf^ = #$2028))) then
     begin
+      if (FBuf^ = #13) and (FBuf < FBufEnd-1) and
+      ((FBuf[1] = #10) or (FXML11Rules and (FBuf[1] = #$85))) then
+        Inc(FBuf);
       LFPos := FBuf;
       Inc(FLineNo);
     end;
@@ -1039,17 +1042,16 @@ begin
     Result := False;
 end;
 
-procedure TXMLDecodingSource.NewLine(p: PWideChar);
+procedure TXMLDecodingSource.NewLine;
 begin
-  case p^ of
+  case FBuf^ of
     #10: begin
       Inc(FLineNo);
-      LFPos := p;
+      LFPos := FBuf;
     end;
     #13: begin
-      FBuf := p;
       Inc(FLineNo);
-      LFPos := p;
+      LFPos := FBuf;
       // Reload trashes the buffer, it should be consumed beforehand
       if (FBufEnd >= FBuf+2) or Reload then
       begin
@@ -1063,9 +1065,9 @@ begin
     end;
     #$85, #$2028: if FXML11Rules then
     begin
-      p^ := #10;
+      FBuf^ := #10;
       Inc(FLineNo);
-      LFPos := p;
+      LFPos := FBuf;
     end;
   end;
 end;
@@ -1353,7 +1355,7 @@ begin
       if (p^ = #10) or (p^ = #13) or (FXML11 and ((p^ = #$85) or (p^ = #$2028))) then
       begin
         FSource.FBuf := p;
-        FSource.NewLine(p);
+        FSource.NewLine;
         p := FSource.FBuf;
       end
       else if (p^ <> #32) and (p^ <> #9) then
@@ -2403,6 +2405,7 @@ var
   AttDef: TDOMAttrDef;
   dt: TAttrDataType;
   Found, DiscardIt: Boolean;
+  Offsets: array [Boolean] of Integer;
 begin
   ExpectWhitespace;
   ElDef := FindOrCreateElDef;
@@ -2481,10 +2484,16 @@ begin
             ExpectWhitespace;
           end;
         end
-        else if Found then
-          ExpectWhitespace
         else
-          FatalError('Illegal attribute type for ''%s''', [AttDef.Name]);
+        begin
+          // don't report 'expected whitespace' if token does not match completely
+          Offsets[False] := 0;
+          Offsets[True] := Length(AttrDataTypeNames[dt]);
+          if Found and (FSource.FBuf^ < 'A') then
+            ExpectWhitespace
+          else
+            FatalError('Illegal attribute type for ''%s''', [AttDef.Name], Offsets[Found]);
+        end;
       end;
       StoreLocation(FTokenStart);
       if FSource.Matches('#REQUIRED') then
@@ -2805,7 +2814,7 @@ begin
       begin
 // strictly this is needed only for 2-byte lineendings
         BufAppendChunk(ToFill, old, FBuf);
-        NewLine(FBuf);
+        NewLine;
         old := FBuf;
         wc := FBuf^
       end

+ 71 - 2
packages/fcl-xml/src/xpath.pp

@@ -1486,9 +1486,78 @@ begin
 end;
 
 function TXPathNumberVariable.AsText: DOMString;
+var
+  frec: TFloatRec;
+  i, nd, reqlen: Integer;
+  P: DOMPChar;
 begin
-// TODO: Decimal separator!!!
-  Result := FloatToStr(FValue);
+  FloatToDecimal(frec, FValue, fvExtended, 17, 9999);
+
+  // TODO: remove workaround after #14143 is fixed
+  if {frec.Exponent = -32768} frec.Digits[0] = 'N' then
+  begin
+    Result := 'NaN';          // do not localize
+    Exit;
+  end
+  else if {frec.Exponent = 32767} (frec.Digits[0] = 'I') or ((frec.Digits[0] = '+') and (frec.Digits[1] = 'I')) then
+  begin
+    if frec.Negative then
+      Result := '-Infinity'   // do not localize
+    else
+      Result := 'Infinity';   // do not localize
+    Exit;  
+  end
+  else if frec.Digits[0] = #0 then
+  begin
+    Result := '0';
+    Exit;
+  end
+  else
+  begin
+    nd := StrLen(@frec.Digits[0]);
+    reqlen := nd + ord(frec.Negative);  // maybe minus sign
+    if frec.Exponent > nd then
+      Inc(reqlen, frec.Exponent - nd)   // add this much zeroes at the right
+    else if frec.Exponent < nd then
+    begin
+      Inc(reqlen);                      // decimal point
+      if frec.Exponent <= 0 then
+        Inc(reqlen, 1 - frec.Exponent); // zeroes at the left + one more for the int part
+    end;
+    SetLength(Result, reqlen);
+    P := DOMPChar(Result);
+    if frec.Negative then
+    begin
+      P^ := '-';
+      Inc(P);
+    end;
+    if frec.Exponent <= 0 then          // value less than 1, put zeroes at left
+    begin
+      for i := 0 to 1-frec.Exponent do
+        P[i] := '0';
+      P[1] := '.';
+      for i := 0 to nd-1 do
+        P[i+2-frec.Exponent] := WideChar(ord(frec.Digits[i]));
+    end
+    else if frec.Exponent > nd then    // large integer, put zeroes at right
+    begin
+      for i := 0 to nd-1 do
+        P[i] := WideChar(ord(frec.Digits[i]));
+      for i := nd to reqlen-1-ord(frec.Negative) do
+        P[i] := '0';
+    end
+    else  // 0 < exponent <= digits, insert decimal point into middle
+    begin
+      for i := 0 to frec.Exponent-1 do
+        P[i] := WideChar(ord(frec.Digits[i]));
+      if frec.Exponent < nd then
+      begin
+        P[frec.Exponent] := '.';
+        for i := frec.Exponent to nd-1 do
+          P[i+1] := WideChar(ord(frec.Digits[i]));
+      end;
+    end;
+  end;
 end;
 
 

+ 16 - 2
packages/fcl-xml/tests/xpathts.pp

@@ -542,7 +542,8 @@ const
   '<b ns1:attrib2="test"/>'#10+
   '</doc>';
 
-  StringTests: array[0..75] of TTestRec = (             // numbers refer to xalan/string/stringXX
+  StringTests: array[0..84] of TTestRec = (             // numbers refer to xalan/string/stringXX
+    (expr: 'string(0)';       rt: rtString; s: '0'),
     (expr: 'string(5)';       rt: rtString; s: '5'),    // #38/39
     (expr: 'string(0.5)';     rt: rtString; s: '0.5'),
     (expr: 'string(-0.5)';    rt: rtString; s: '-0.5'),
@@ -634,7 +635,20 @@ const
 
     (data: str30; expr: 'local-name(baz2:b)'; rt: rtString; s: 'b'), // namespace07
     (data: str30; expr: 'local-name(baz2:b/@baz1:attrib2)'; rt: rtString; s: 'attrib2'), // namespace09
-    (data: str30; expr: 'local-name()'; rt: rtString; s: 'doc')      // namespace26
+    (data: str30; expr: 'local-name()'; rt: rtString; s: 'doc'),      // namespace26
+    
+    // tests for number->string conversions at boundary conditions
+    (expr: 'string(123456789012345678)';     rt: rtString; s: '123456789012345680'),    // #132.1
+    (expr: 'string(-123456789012345678)';    rt: rtString; s: '-123456789012345680'),   // #132.2
+    (expr: 'string(.10123456789234567893)';  rt: rtString; s: '0.10123456789234568'),   // #133.1
+    (expr: 'string(-.10123456789234567893)'; rt: rtString; s: '-0.10123456789234568'),  // #133.2
+    
+    (expr: 'string(9.87654321012345)'; rt: rtString; s: '9.87654321012345'),  // #134.1
+    (expr: 'string(98765432101234.5)'; rt: rtString; s: '98765432101234.5'),  // #134.2
+    (expr: 'string(.0000000000000000000000000000000000000000123456789)'; rt: rtString;  // #135.1
+      s: '0.0000000000000000000000000000000000000000123456789'),
+    (expr: 'string(-.0000000000000000000000000000000000000000123456789)'; rt: rtString; // #135.2
+      s: '-0.0000000000000000000000000000000000000000123456789')
   );
   
   ax114='<doc>'+

+ 3071 - 0
packages/fpvectorial/Makefile

@@ -0,0 +1,3071 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/07/17]
+#
+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 m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx
+LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override DEFAULT_FPCDIR=../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
+FPC:=$(shell $(FPCPROG) -PB)
+endif
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+else
+ifeq ($(strip $(wildcard $(FPC))),)
+FPC:=$(firstword $(FPCPROG))
+endif
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifneq ($(words $(FPC_COMPILERINFO)),5)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifeq ($(CPU_TARGET),armeb)
+ARCH=arm
+override FPCOPT+=-Cb
+else
+ifeq ($(CPU_TARGET),armel)
+ARCH=arm
+override FPCOPT+=-CaEABI
+else
+ARCH=$(CPU_TARGET)
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifeq ($(OS_TARGET),darwin)
+ifeq ($(OS_SOURCE),darwin)
+DARWIN2DARWIN=1
+endif
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+ifndef DARWIN2DARWIN
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+override PACKAGE_NAME=fpvectorial
+override PACKAGE_VERSION=2.2.2
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_UNITS+=fpvectbuildunit
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_IMPLICITUNITS+=avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico pdfvrsintatico
+endif
+override INSTALL_BUILDUNIT=fpvectbuildunit
+override INSTALL_FPCPACKAGE=y
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override COMPILER_INCLUDEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override COMPILER_SOURCEDIR+=src
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override COMPILER_SOURCEDIR+=src
+endif
+override SHARED_BUILD=n
+override SHARED_BUILD=n
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+ifeq ($(OS_SOURCE),linux)
+ifndef GCCLIBDIR
+ifeq ($(CPU_TARGET),i386)
+ifneq ($(findstring x86_64,$(shell uname -a)),)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
+endif
+endif
+endif
+ifeq ($(CPU_TARGET),powerpc64)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`)
+endif
+endif
+endif
+ifndef GCCLIBDIR
+CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(CROSSGCC),)
+GCCLIBDIR:=$(shell dirname `$(CROSSGCC) -print-libgcc-file-name`)
+endif
+endif
+ifndef OTHERLIBDIR
+OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
+endif
+endif
+ifdef inUnix
+ifeq ($(OS_SOURCE),netbsd)
+OTHERLIBDIR+=/usr/pkg/lib
+endif
+export GCCLIBDIR OTHERLIB
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),emx)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=emx
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),morphos)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=mos
+endif
+ifeq ($(OS_TARGET),atari)
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),haiku)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=hai
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),darwin)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=dwn
+endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+else
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+PPUEXT=.ppw
+OEXT=.ow
+ASMEXT=.sw
+SMARTEXT=.slw
+STATICLIBEXT=.aw
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+PPUEXT=.ppo
+ASMEXT=.so2
+OEXT=.oo2
+AOUTEXT=.out
+SMARTEXT=.sl2
+STATICLIBPREFIX=
+STATICLIBEXT=.ao2
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),atari)
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+FPCMADE=fpcmade.$(SHORTSUFFIX)
+ZIPSUFFIX=$(SHORTSUFFIX)
+ZIPCROSSPREFIX=
+ZIPSOURCESUFFIX=src
+ZIPEXAMPLESUFFIX=exm
+else
+FPCMADE=fpcmade.$(TARGETSUFFIX)
+ZIPSOURCESUFFIX=.source
+ZIPEXAMPLESUFFIX=.examples
+ifdef CROSSCOMPILE
+ZIPSUFFIX=.$(SOURCESUFFIX)
+ZIPCROSSPREFIX=$(TARGETSUFFIX)-
+else
+ZIPSUFFIX=.$(TARGETSUFFIX)
+ZIPCROSSPREFIX=
+endif
+endif
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO= __missing_command_ECHO
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE= __missing_command_DATE
+else
+DATE:=$(firstword $(DATE))
+endif
+else
+DATE:=$(firstword $(DATE))
+endif
+endif
+export DATE
+ifndef GINSTALL
+GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL= __missing_command_GINSTALL
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+endif
+export GINSTALL
+ifndef CPPROG
+CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(CPPROG),)
+CPPROG= __missing_command_CPPROG
+else
+CPPROG:=$(firstword $(CPPROG))
+endif
+endif
+export CPPROG
+ifndef RMPROG
+RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(RMPROG),)
+RMPROG= __missing_command_RMPROG
+else
+RMPROG:=$(firstword $(RMPROG))
+endif
+endif
+export RMPROG
+ifndef MVPROG
+MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MVPROG),)
+MVPROG= __missing_command_MVPROG
+else
+MVPROG:=$(firstword $(MVPROG))
+endif
+endif
+export MVPROG
+ifndef MKDIRPROG
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG= __missing_command_MKDIRPROG
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+endif
+export MKDIRPROG
+ifndef ECHOREDIR
+ifndef inUnix
+ECHOREDIR=echo
+else
+ECHOREDIR=$(ECHO)
+endif
+endif
+ifndef COPY
+COPY:=$(CPPROG) -fp
+endif
+ifndef COPYTREE
+COPYTREE:=$(CPPROG) -Rfp
+endif
+ifndef MKDIRTREE
+MKDIRTREE:=$(MKDIRPROG) -p
+endif
+ifndef MOVE
+MOVE:=$(MVPROG) -f
+endif
+ifndef DEL
+DEL:=$(RMPROG) -f
+endif
+ifndef DELTREE
+DELTREE:=$(RMPROG) -rf
+endif
+ifndef INSTALL
+ifdef inUnix
+INSTALL:=$(GINSTALL) -c -m 644
+else
+INSTALL:=$(COPY)
+endif
+endif
+ifndef INSTALLEXE
+ifdef inUnix
+INSTALLEXE:=$(GINSTALL) -c -m 755
+else
+INSTALLEXE:=$(COPY)
+endif
+endif
+ifndef MKDIR
+MKDIR:=$(GINSTALL) -m 755 -d
+endif
+export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE= __missing_command_PPUMOVE
+else
+PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+export PPUMOVE
+ifndef FPCMAKE
+FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(FPCMAKE),)
+FPCMAKE= __missing_command_FPCMAKE
+else
+FPCMAKE:=$(firstword $(FPCMAKE))
+endif
+endif
+export FPCMAKE
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG= __missing_command_ZIPPROG
+else
+ZIPPROG:=$(firstword $(ZIPPROG))
+endif
+endif
+export ZIPPROG
+ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG= __missing_command_TARPROG
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+endif
+export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),win32)
+ifeq ($(CROSSBINDIR),)
+ASNAME=asw
+LDNAME=ldw
+ARNAME=arw
+endif
+endif
+endif
+ifndef ASPROG
+ifdef CROSSBINDIR
+ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
+else
+ASPROG=$(ASNAME)
+endif
+endif
+ifndef LDPROG
+ifdef CROSSBINDIR
+LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
+else
+LDPROG=$(LDNAME)
+endif
+endif
+ifndef RCPROG
+ifdef CROSSBINDIR
+RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
+else
+RCPROG=$(RCNAME)
+endif
+endif
+ifndef ARPROG
+ifdef CROSSBINDIR
+ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
+else
+ARPROG=$(ARNAME)
+endif
+endif
+AS=$(ASPROG)
+LD=$(LDPROG)
+RC=$(RCPROG)
+AR=$(ARPROG)
+PPAS=ppas$(SRCBATCHEXT)
+ifdef inUnix
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+ifndef UPXPROG
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+export UPXPROG
+ZIPOPT=-9
+ZIPEXT=.zip
+ifeq ($(USETAR),bz2)
+TAROPT=vj
+TAREXT=.tar.bz2
+else
+TAROPT=vz
+TAREXT=.tar.gz
+endif
+override REQUIRE_PACKAGES=rtl fcl-image
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_WINUNITS-BASE=1
+REQUIRE_PACKAGES_WINUNITS-JEDI=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_UNIVINT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_UNIVINT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_UNIVINT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_WINUNITS-BASE=1
+REQUIRE_PACKAGES_WINUNITS-JEDI=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_UNIVINT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_UNIVINT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+endif
+ifdef REQUIRE_PACKAGES_RTL
+PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_RTL),)
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
+UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
+else
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_RTL)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_RTL=
+UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_RTL),)
+UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override COMPILER_UNITDIR+=$(UNITDIR_RTL)
+endif
+endif
+ifdef REQUIRE_PACKAGES_PASJPEG
+PACKAGEDIR_PASJPEG:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /pasjpeg/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_PASJPEG),)
+ifneq ($(wildcard $(PACKAGEDIR_PASJPEG)/units/$(TARGETSUFFIX)),)
+UNITDIR_PASJPEG=$(PACKAGEDIR_PASJPEG)/units/$(TARGETSUFFIX)
+else
+UNITDIR_PASJPEG=$(PACKAGEDIR_PASJPEG)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_PASJPEG)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_PASJPEG) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_PASJPEG)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_PASJPEG=
+UNITDIR_PASJPEG:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /pasjpeg/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_PASJPEG),)
+UNITDIR_PASJPEG:=$(firstword $(UNITDIR_PASJPEG))
+else
+UNITDIR_PASJPEG=
+endif
+endif
+ifdef UNITDIR_PASJPEG
+override COMPILER_UNITDIR+=$(UNITDIR_PASJPEG)
+endif
+endif
+ifdef REQUIRE_PACKAGES_HASH
+PACKAGEDIR_HASH:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /hash/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_HASH),)
+ifneq ($(wildcard $(PACKAGEDIR_HASH)/units/$(TARGETSUFFIX)),)
+UNITDIR_HASH=$(PACKAGEDIR_HASH)/units/$(TARGETSUFFIX)
+else
+UNITDIR_HASH=$(PACKAGEDIR_HASH)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_HASH)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_HASH) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_HASH)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_HASH=
+UNITDIR_HASH:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /hash/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_HASH),)
+UNITDIR_HASH:=$(firstword $(UNITDIR_HASH))
+else
+UNITDIR_HASH=
+endif
+endif
+ifdef UNITDIR_HASH
+override COMPILER_UNITDIR+=$(UNITDIR_HASH)
+endif
+endif
+ifdef REQUIRE_PACKAGES_PASZLIB
+PACKAGEDIR_PASZLIB:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_PASZLIB),)
+ifneq ($(wildcard $(PACKAGEDIR_PASZLIB)/units/$(TARGETSUFFIX)),)
+UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)/units/$(TARGETSUFFIX)
+else
+UNITDIR_PASZLIB=$(PACKAGEDIR_PASZLIB)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_PASZLIB)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_PASZLIB) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_PASZLIB)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_PASZLIB=
+UNITDIR_PASZLIB:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /paszlib/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_PASZLIB),)
+UNITDIR_PASZLIB:=$(firstword $(UNITDIR_PASZLIB))
+else
+UNITDIR_PASZLIB=
+endif
+endif
+ifdef UNITDIR_PASZLIB
+override COMPILER_UNITDIR+=$(UNITDIR_PASZLIB)
+endif
+endif
+ifdef REQUIRE_PACKAGES_FCL-BASE
+PACKAGEDIR_FCL-BASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl-base/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_FCL-BASE),)
+ifneq ($(wildcard $(PACKAGEDIR_FCL-BASE)/units/$(TARGETSUFFIX)),)
+UNITDIR_FCL-BASE=$(PACKAGEDIR_FCL-BASE)/units/$(TARGETSUFFIX)
+else
+UNITDIR_FCL-BASE=$(PACKAGEDIR_FCL-BASE)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_FCL-BASE)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_FCL-BASE) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_FCL-BASE)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_FCL-BASE=
+UNITDIR_FCL-BASE:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fcl-base/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_FCL-BASE),)
+UNITDIR_FCL-BASE:=$(firstword $(UNITDIR_FCL-BASE))
+else
+UNITDIR_FCL-BASE=
+endif
+endif
+ifdef UNITDIR_FCL-BASE
+override COMPILER_UNITDIR+=$(UNITDIR_FCL-BASE)
+endif
+endif
+ifdef REQUIRE_PACKAGES_FCL-IMAGE
+PACKAGEDIR_FCL-IMAGE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl-image/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_FCL-IMAGE),)
+ifneq ($(wildcard $(PACKAGEDIR_FCL-IMAGE)/units/$(TARGETSUFFIX)),)
+UNITDIR_FCL-IMAGE=$(PACKAGEDIR_FCL-IMAGE)/units/$(TARGETSUFFIX)
+else
+UNITDIR_FCL-IMAGE=$(PACKAGEDIR_FCL-IMAGE)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_FCL-IMAGE)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_FCL-IMAGE) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_FCL-IMAGE)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_FCL-IMAGE=
+UNITDIR_FCL-IMAGE:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /fcl-image/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_FCL-IMAGE),)
+UNITDIR_FCL-IMAGE:=$(firstword $(UNITDIR_FCL-IMAGE))
+else
+UNITDIR_FCL-IMAGE=
+endif
+endif
+ifdef UNITDIR_FCL-IMAGE
+override COMPILER_UNITDIR+=$(UNITDIR_FCL-IMAGE)
+endif
+endif
+ifdef REQUIRE_PACKAGES_WINUNITS-BASE
+PACKAGEDIR_WINUNITS-BASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /winunits-base/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_WINUNITS-BASE),)
+ifneq ($(wildcard $(PACKAGEDIR_WINUNITS-BASE)/units/$(TARGETSUFFIX)),)
+UNITDIR_WINUNITS-BASE=$(PACKAGEDIR_WINUNITS-BASE)/units/$(TARGETSUFFIX)
+else
+UNITDIR_WINUNITS-BASE=$(PACKAGEDIR_WINUNITS-BASE)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_WINUNITS-BASE)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_WINUNITS-BASE) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_WINUNITS-BASE)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_WINUNITS-BASE=
+UNITDIR_WINUNITS-BASE:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /winunits-base/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_WINUNITS-BASE),)
+UNITDIR_WINUNITS-BASE:=$(firstword $(UNITDIR_WINUNITS-BASE))
+else
+UNITDIR_WINUNITS-BASE=
+endif
+endif
+ifdef UNITDIR_WINUNITS-BASE
+override COMPILER_UNITDIR+=$(UNITDIR_WINUNITS-BASE)
+endif
+endif
+ifdef REQUIRE_PACKAGES_WINUNITS-JEDI
+PACKAGEDIR_WINUNITS-JEDI:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /winunits-jedi/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_WINUNITS-JEDI),)
+ifneq ($(wildcard $(PACKAGEDIR_WINUNITS-JEDI)/units/$(TARGETSUFFIX)),)
+UNITDIR_WINUNITS-JEDI=$(PACKAGEDIR_WINUNITS-JEDI)/units/$(TARGETSUFFIX)
+else
+UNITDIR_WINUNITS-JEDI=$(PACKAGEDIR_WINUNITS-JEDI)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_WINUNITS-JEDI)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_WINUNITS-JEDI) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_WINUNITS-JEDI)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_WINUNITS-JEDI=
+UNITDIR_WINUNITS-JEDI:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /winunits-jedi/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_WINUNITS-JEDI),)
+UNITDIR_WINUNITS-JEDI:=$(firstword $(UNITDIR_WINUNITS-JEDI))
+else
+UNITDIR_WINUNITS-JEDI=
+endif
+endif
+ifdef UNITDIR_WINUNITS-JEDI
+override COMPILER_UNITDIR+=$(UNITDIR_WINUNITS-JEDI)
+endif
+endif
+ifdef REQUIRE_PACKAGES_UNIVINT
+PACKAGEDIR_UNIVINT:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /univint/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_UNIVINT),)
+ifneq ($(wildcard $(PACKAGEDIR_UNIVINT)/units/$(TARGETSUFFIX)),)
+UNITDIR_UNIVINT=$(PACKAGEDIR_UNIVINT)/units/$(TARGETSUFFIX)
+else
+UNITDIR_UNIVINT=$(PACKAGEDIR_UNIVINT)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_UNIVINT)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_UNIVINT) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_UNIVINT)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_UNIVINT=
+UNITDIR_UNIVINT:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /univint/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_UNIVINT),)
+UNITDIR_UNIVINT:=$(firstword $(UNITDIR_UNIVINT))
+else
+UNITDIR_UNIVINT=
+endif
+endif
+ifdef UNITDIR_UNIVINT
+override COMPILER_UNITDIR+=$(UNITDIR_UNIVINT)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(ARCH)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(ARCH)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX)
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O2
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),linux)
+ifeq ($(CPU_TARGET),x86_64)
+override FPCOPT+=-Cg
+endif
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef GCCLIBDIR
+override FPCOPT+=-Fl$(GCCLIBDIR)
+endif
+ifdef OTHERLIBDIR
+override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
+EXECPPAS:=@$(PPAS)
+endif
+endif
+endif
+.PHONY: fpc_units
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
+override ALLTARGET+=fpc_units
+override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
+override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
+override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+endif
+fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+	@$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+	$(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+	$(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(PPUEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.lpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.inc $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_distinstall
+fpc_distinstall: install exampleinstall
+.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
+ifndef PACKDIR
+ifndef inUnix
+PACKDIR=$(BASEDIR)/../fpc-pack
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+ifndef ZIPNAME
+ifdef DIST_ZIPNAME
+ZIPNAME=$(DIST_ZIPNAME)
+else
+ZIPNAME=$(PACKAGE_NAME)
+endif
+endif
+ifndef FULLZIPNAME
+FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
+endif
+ifndef ZIPTARGET
+ifdef DIST_ZIPTARGET
+ZIPTARGET=DIST_ZIPTARGET
+else
+ZIPTARGET=install
+endif
+endif
+ifndef USEZIP
+ifdef inUnix
+USETAR=1
+endif
+endif
+ifndef inUnix
+USEZIPWRAPPER=1
+endif
+ifdef USEZIPWRAPPER
+ZIPPATHSEP=$(PATHSEP)
+ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
+else
+ZIPPATHSEP=/
+endif
+ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
+ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
+ifdef USETAR
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
+ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
+else
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
+ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
+endif
+fpc_zipinstall:
+	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
+	$(MKDIR) $(DIST_DESTDIR)
+	$(DEL) $(ZIPDESTFILE)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
+else
+	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
+	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
+	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
+endif
+ifdef inUnix
+	/bin/sh $(ZIPWRAPPER)
+else
+ifdef RUNBATCH
+	$(RUNBATCH) $(ZIPWRAPPER)
+else
+	$(ZIPWRAPPER)
+endif
+endif
+	$(DEL) $(ZIPWRAPPER)
+else
+	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
+endif
+	$(DELTREE) $(PACKDIR)
+fpc_zipsourceinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
+fpc_zipexampleinstall:
+ifdef HASEXAMPLES
+	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
+endif
+fpc_zipdistinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+endif
+ifdef CLEAN_UNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
+endif
+ifdef CLEANPPUFILES
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
+override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+	-$(DELTREE) units
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+	-$(DEL) *.o *.ppu *.a
+endif
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *_ppas$(BATCHEXT)
+ifdef AOUTEXT
+	-$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+	-$(DEL) *$(DEBUGSYMEXT)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+	@$(ECHO)
+	@$(ECHO)  == Package info ==
+	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
+	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC.......... $(FPC)
+	@$(ECHO)  FPC Version.. $(FPC_VERSION)
+	@$(ECHO)  Source CPU... $(CPU_SOURCE)
+	@$(ECHO)  Target CPU... $(CPU_TARGET)
+	@$(ECHO)  Source OS.... $(OS_SOURCE)
+	@$(ECHO)  Target OS.... $(OS_TARGET)
+	@$(ECHO)  Full Source.. $(FULL_SOURCE)
+	@$(ECHO)  Full Target.. $(FULL_TARGET)
+	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
+	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
+	@$(ECHO)
+	@$(ECHO)  == Directory info ==
+	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
+	@$(ECHO)  Basedir......... $(BASEDIR)
+	@$(ECHO)  FPCDir.......... $(FPCDIR)
+	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
+	@$(ECHO)  UnitsDir........ $(UNITSDIR)
+	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
+	@$(ECHO)
+	@$(ECHO)  GCC library..... $(GCCLIBDIR)
+	@$(ECHO)  Other library... $(OTHERLIBDIR)
+	@$(ECHO)
+	@$(ECHO)  == Tools info ==
+	@$(ECHO)
+	@$(ECHO)  As........ $(AS)
+	@$(ECHO)  Ld........ $(LD)
+	@$(ECHO)  Ar........ $(AR)
+	@$(ECHO)  Rc........ $(RC)
+	@$(ECHO)
+	@$(ECHO)  Mv........ $(MVPROG)
+	@$(ECHO)  Cp........ $(CPPROG)
+	@$(ECHO)  Rm........ $(RMPROG)
+	@$(ECHO)  GInstall.. $(GINSTALL)
+	@$(ECHO)  Echo...... $(ECHO)
+	@$(ECHO)  Shell..... $(SHELL)
+	@$(ECHO)  Date...... $(DATE)
+	@$(ECHO)  FPCMake... $(FPCMAKE)
+	@$(ECHO)  PPUMove... $(PPUMOVE)
+	@$(ECHO)  Upx....... $(UPXPROG)
+	@$(ECHO)  Zip....... $(ZIPPROG)
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)
+	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
+	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
+	@$(ECHO)
+	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
+	@$(ECHO)  Install Files....... $(INSTALL_FILES)
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+	@$(ECHO)  DateStr.............. $(DATESTR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
+	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
+	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
+	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
+	@$(ECHO)
+	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
+	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
+	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
+	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
+	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
+	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
+	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
+	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
+	@$(ECHO)
+	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
+	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
+	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+all: fpc_all
+debug: fpc_debug
+smart: fpc_smart
+release: fpc_release
+units: fpc_units
+examples:
+shared: fpc_shared
+install: fpc_install
+sourceinstall: fpc_sourceinstall
+exampleinstall: fpc_exampleinstall
+distinstall: fpc_distinstall
+zipinstall: fpc_zipinstall
+zipsourceinstall: fpc_zipsourceinstall
+zipexampleinstall: fpc_zipexampleinstall
+zipdistinstall: fpc_zipdistinstall
+clean: fpc_clean
+distclean: fpc_distclean
+cleanall: fpc_cleanall
+info: fpc_info
+makefiles: fpc_makefiles
+.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+.NOTPARALLEL:

+ 37 - 0
packages/fpvectorial/Makefile.fpc

@@ -0,0 +1,37 @@
+#
+#   Makefile.fpc for FPVectorial Library
+#
+
+[package]
+name=fpvectorial
+version=2.2.2
+
+[require]
+libc=n
+packages=fcl-image
+
+[target]
+units=fpvectbuildunit
+exampledirs=
+implicitunits= avisocncgcodereader avisocncgcodewriter avisozlib fpvectorial \
+	       fpvtocanvas  pdfvectorialreader pdfvrlexico pdfvrsemantico \
+	       pdfvrsintatico
+
+[compiler]
+includedir=src
+sourcedir=src
+
+[install]
+buildunit=fpvectbuildunit
+fpcpackage=y
+
+[shared]
+build=n
+
+[default]
+fpcdir=../..
+
+[rules]
+.NOTPARALLEL:
+
+

+ 57 - 0
packages/fpvectorial/fpmake.pp

@@ -0,0 +1,57 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+
+Var
+  T,TBuild : TTarget;
+  P : TPackage;
+  i : Integer;
+begin
+  With Installer do
+    begin
+{$endif ALLPACKAGES}
+
+    P:=AddPackage('fpvectorial');
+{$ifdef ALLPACKAGES}
+    P.Directory:='fpvectorial';
+{$endif ALLPACKAGES}
+    P.Version:='2.2.2-0';
+    P.Author := 'Felipe Monteiro de Carvalho, Pedro Sol Pegorini L de Lima';
+    P.License := 'LGPL with static linking modification ';
+    P.HomepageURL := 'www.freepascal.org';
+    P.Email := '';
+    P.Description := '???';
+    P.NeedLibC:= true;
+
+    P.Dependencies.Add('fcl-image');
+
+    P.SourcePath.Add('src');
+
+    T:=P.Targets.AddImplicitUnit('jwazmouse.pas');
+    T:=P.Targets.AddImplicitUnit('avisocncgcodereader'); 
+    T:=P.Targets.AddImplicitUnit('avisocncgcodewriter'); 
+    T:=P.Targets.AddImplicitUnit('avisozlib'); 
+    T:=P.Targets.AddImplicitUnit('fpvectorial'); 
+    T:=P.Targets.AddImplicitUnit('fpvtocanvas');  
+    T:=P.Targets.AddImplicitUnit('pdfvectorialreader'); 
+    T:=P.Targets.AddImplicitUnit('pdfvrlexico'); 
+    T:=P.Targets.AddImplicitUnit('pdfvrsemantico');
+    T:=P.Targets.AddImplicitUnit('pdfvrsintaticoa');
+
+    // Build unit depending on all implicit units
+    TBuild:=P.Targets.AddUnit('fpvectorialbuildunit.pp');
+    TBuild.Install:=False;
+    For I:=0 to P.Targets.Count-1 do
+      begin
+        T:=P.Targets.TargetItems[I];
+        if T.TargetType=ttImplicitUnit then
+          TBuild.Dependencies.AddUnit(T.Name);
+      end;
+
+{$ifndef ALLPACKAGES}
+    Run;
+    end;
+end.
+{$endif ALLPACKAGES}

+ 234 - 0
packages/fpvectorial/src/avisocncgcodereader.pas

@@ -0,0 +1,234 @@
+{
+Reads AvisoCNC G-Code
+
+License: The same modified LGPL as the Free Pascal RTL
+         See the file COPYING.modifiedLGPL for more details
+
+AUTHORS: Felipe Monteiro de Carvalho
+         Pedro Sol Pegorini L de Lima
+}
+unit avisocncgcodereader;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils,
+  fpvectorial;
+
+type
+
+  { Used by tcutils.SeparateString }
+  T10Strings = array[0..9] of shortstring;
+
+  { TvAvisoCNCGCodeReader }
+
+  TvAvisoCNCGCodeReader = class(TvCustomVectorialReader)
+  private
+    LastX, LastY, LastZ: Double;
+    function  SeparateString(AString: string; ASeparator: Char): T10Strings;
+    procedure ReadString(AStr: string; AData: TvVectorialDocument);
+    function  GetCoordinate(AStr: shortstring): Integer;
+    function  GetCoordinateValue(AStr: shortstring): Double;
+  public
+    { General reading methods }
+    procedure ReadFromStrings(AStrings: TStrings; AData: TvVectorialDocument); override;
+  end;
+
+implementation
+
+const
+  { Coordinate constants }
+
+  INT_COORDINATE_NONE = 0;
+  INT_COORDINATE_X = 1;
+  INT_COORDINATE_Y = 2;
+  INT_COORDINATE_Z = 3;
+
+  { GCode constants }
+
+  STR_GCODE_LINEAR_MOVE = 'G01';
+  STR_GCODE_STEPPER_MOVE = 'S01';
+  STR_GCODE_2DBEZIER_MOVE = 'B02';
+  STR_GCODE_3DBEZIER_MOVE = 'B03';
+  STR_GCODE_DRILL_UP = 'P01';
+  STR_GCODE_DRILL_DOWN = 'P02';
+
+{ TvAvisoCNCGCodeReader }
+
+{@@
+  Reads a string and separates it in substring
+  using ASeparator to delimite them.
+
+  Limits:
+
+  Number of substrings: 10 (indexed 0 to 9)
+  Length of each substring: 255 (they are shortstrings)
+}
+function TvAvisoCNCGCodeReader.SeparateString(AString: string; ASeparator: Char): T10Strings;
+var
+  i, CurrentPart: Integer;
+begin
+  CurrentPart := 0;
+
+  { Clears the result }
+  for i := 0 to 9 do Result[i] := '';
+
+  { Iterates througth the string, filling strings }
+  for i := 1 to Length(AString) do
+  begin
+    if Copy(AString, i, 1) = ASeparator then
+    begin
+      Inc(CurrentPart);
+
+      { Verifies if the string capacity wasn't exceeded }
+      if CurrentPart > 9 then Exit;
+    end
+    else
+      Result[CurrentPart] := Result[CurrentPart] + Copy(AString, i, 1);
+  end;
+end;
+
+procedure TvAvisoCNCGCodeReader.ReadString(AStr: string;
+  AData: TvVectorialDocument);
+var
+  AParams: T10Strings;
+  DestX, DestY, DestZ: Double;
+  i: Integer;
+begin
+  {$ifdef FPVECTORIALDEBUG}
+  WriteLn('TvAvisoCNCGCodeReader.ReadString ', AStr);
+  {$endif}
+  AParams := SeparateString(AStr, ' ');
+
+  {
+    Format may be:
+    G01 X3
+    G01 X3 Y4
+    G01 X3 Y4 Z2
+  }
+  if AParams[0] = STR_GCODE_DRILL_UP then
+  begin
+    AData.AddLineToPath(LastX, LastY, 0);
+    LastZ := 0;
+  end
+  else if AParams[0] = STR_GCODE_DRILL_DOWN then
+  begin
+    AData.AddLineToPath(LastX, LastY, 50);
+    LastZ := 50;
+  end
+  else if AParams[0] = STR_GCODE_LINEAR_MOVE then
+  begin
+    DestX := LastX;
+    DestY := LastY;
+    DestZ := LastZ;
+
+    for i := 1 to 3 do
+    begin
+      case GetCoordinate(AParams[i]) of
+      INT_COORDINATE_X: DestX := GetCoordinateValue(AParams[i]);
+      INT_COORDINATE_Y: DestY := GetCoordinateValue(AParams[i]);
+      INT_COORDINATE_Z: DestZ := GetCoordinateValue(AParams[i]);
+      else
+        // error
+      end;
+    end;
+
+    AData.AddLineToPath(DestX, DestY, DestZ);
+
+    LastX := DestX;
+    LastY := DestY;
+    LastZ := DestZ;
+  end
+  else if AParams[0] = STR_GCODE_2DBEZIER_MOVE then
+  begin
+    AData.AddBezierToPath(
+      GetCoordinateValue(AParams[1]),
+      GetCoordinateValue(AParams[2]),
+      GetCoordinateValue(AParams[3]),
+      GetCoordinateValue(AParams[4]),
+      GetCoordinateValue(AParams[5]),
+      GetCoordinateValue(AParams[6])
+      );
+
+    LastX := GetCoordinateValue(AParams[5]);
+    LastY := GetCoordinateValue(AParams[6]);
+  end
+  else if AParams[0] = STR_GCODE_3DBEZIER_MOVE then
+  begin
+    AData.AddBezierToPath(
+      GetCoordinateValue(AParams[1]),
+      GetCoordinateValue(AParams[2]),
+      GetCoordinateValue(AParams[3]),
+      GetCoordinateValue(AParams[4]),
+      GetCoordinateValue(AParams[5]),
+      GetCoordinateValue(AParams[6]),
+      GetCoordinateValue(AParams[7]),
+      GetCoordinateValue(AParams[8]),
+      GetCoordinateValue(AParams[9])
+      );
+
+    LastX := GetCoordinateValue(AParams[7]);
+    LastY := GetCoordinateValue(AParams[8]);
+    LastZ := GetCoordinateValue(AParams[9]);
+  end;
+  {else
+  begin
+     Ignore any of these codes:
+
+      STR_GCODE_STEPPER_MOVE
+
+      and anything else
+  end;}
+end;
+
+function TvAvisoCNCGCodeReader.GetCoordinate(AStr: shortstring): Integer;
+begin
+  Result := INT_COORDINATE_NONE;
+
+  if AStr = '' then Exit
+  else if AStr[1] = 'X' then Result := INT_COORDINATE_X
+  else if AStr[1] = 'Y' then Result := INT_COORDINATE_Y
+  else if AStr[1] = 'Z' then Result := INT_COORDINATE_Z;
+end;
+
+function TvAvisoCNCGCodeReader.GetCoordinateValue(AStr: shortstring): Double;
+begin
+  Result := 0.0;
+
+  if Length(AStr) <= 1 then Exit;
+
+  Result := StrToFloat(Copy(AStr, 2, Length(AStr) - 1));
+end;
+
+{@@
+  The information of each separate path is lost in G-Code files
+  Only one path uniting all of them is created when reading G-Code
+}
+procedure TvAvisoCNCGCodeReader.ReadFromStrings(AStrings: TStrings;
+  AData: TvVectorialDocument);
+var
+  i: Integer;
+begin
+  {$ifdef FPVECTORIALDEBUG}
+  WriteLn('TvAvisoCNCGCodeReader.ReadFromStrings AStrings = ', PtrInt(AStrings), ' AData = ', PtrInt(AData));
+  {$endif}
+  
+  AData.StartPath(0, 0);
+
+  for i := 0 to AStrings.Count - 1 do
+    ReadString(AStrings.Strings[i], AData);
+
+  {$ifdef FPVECTORIALDEBUG}
+  WriteLn('AData.EndPath');
+  {$endif}
+  AData.EndPath();
+end;
+
+initialization
+
+  RegisterVectorialReader(TvAvisoCNCGCodeReader, vfGCodeAvisoCNCPrototipoV5);
+
+end.
+

+ 87 - 0
packages/fpvectorial/src/avisocncgcodewriter.pas

@@ -0,0 +1,87 @@
+{
+Writes AvisoCNC G-Code
+
+License: The same modified LGPL as the Free Pascal RTL
+         See the file COPYING.modifiedLGPL for more details
+
+AUTHORS: Felipe Monteiro de Carvalho
+         Pedro Sol Pegorini L de Lima
+}
+unit avisocncgcodewriter;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils,
+  fpvectorial;
+
+type
+  { TvAvisoCNCGCodeWriter }
+
+  TvAvisoCNCGCodeWriter = class(TvCustomVectorialWriter)
+  public
+    { General reading methods }
+    procedure WriteToStrings(AStrings: TStrings; AData: TvVectorialDocument); override;
+  end;
+
+implementation
+
+{ TvGCodeVectorialWriter }
+
+procedure TvAvisoCNCGCodeWriter.WriteToStrings(AStrings: TStrings;
+  AData: TvVectorialDocument);
+var
+  i, j: Integer;
+  Str: string;
+  APath: TPath;
+begin
+  AStrings.Clear;
+
+  AStrings.Add('M216 // Ligar monitor de carga');
+  AStrings.Add('G28 // Ir rapidamente para posição inicial');
+  AStrings.Add('G00');
+
+  // itera por todos os itens
+  for i := 0 to AData.GetPathCount - 1 do
+  begin
+    APath := AData.GetPath(i);
+
+    // levanta a broca
+    AStrings.Add('P01 // Sobe a cabeça de gravação');
+    // vai para o ponto inicial
+    AStrings.Add(Format('G01 X%f Y%f',
+      [APath.Points[0].X, APath.Points[0].Y]));
+    AStrings.Add('P02 // Abaixa a cabeça de gravação');
+
+    for j := 1 to APath.Len - 1 do
+    begin
+      case APath.Points[j].SegmentType of
+      st2DLine: AStrings.Add(Format('G01 X%f Y%f',
+         [APath.Points[j].X, APath.Points[j].Y]));
+      st3DLine: AStrings.Add(Format('G01 X%f Y%f Z%f',
+         [APath.Points[j].X, APath.Points[j].Y, APath.Points[j].Z]));
+      st2DBezier: AStrings.Add(Format('B02 X%f Y%f X%f Y%f X%f Y%f',
+         [APath.Points[j].X2, APath.Points[j].Y2,
+          APath.Points[j].X3, APath.Points[j].Y3,
+          APath.Points[j].X, APath.Points[j].Y]));
+      st3DBezier: AStrings.Add(Format('B03 X%f Y%f Z%f X%f Y%f Z%f X%f Y%f Z%f',
+         [APath.Points[j].X2, APath.Points[j].Y2, APath.Points[j].Z2,
+          APath.Points[j].X3, APath.Points[j].Y3, APath.Points[j].Z3,
+          APath.Points[j].X, APath.Points[j].Y, APath.Points[j].Z]));
+      end;
+    end;
+  end;
+
+  AStrings.Add('P01 // Sobe a cabeça de gravação');
+  AStrings.Add('M30 // Parar o programa e retornar para posição inicial');
+  AStrings.Add('M215 // Desligar monitor de carga');
+end;
+
+initialization
+
+  RegisterVectorialWriter(TvAvisoCNCGCodeWriter, vfGCodeAvisoCNCPrototipoV5);
+
+end.
+

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