Browse Source

* synchronized with trunk

git-svn-id: branches/wasm@47506 -
nickysn 4 years ago
parent
commit
c895c8fa0a
100 changed files with 673 additions and 327 deletions
  1. 12 0
      .gitattributes
  2. 2 2
      Makefile
  3. 2 2
      compiler/Makefile
  4. 6 6
      compiler/assemble.pas
  5. 2 1
      compiler/globtype.pas
  6. 3 2
      compiler/link.pas
  7. 2 1
      compiler/msg/errore.msg
  8. 1 1
      compiler/msgidx.inc
  9. 89 90
      compiler/msgtxt.inc
  10. 4 2
      compiler/options.pas
  11. 2 2
      compiler/utils/Makefile
  12. 0 4
      compiler/utils/ppumove.pp
  13. 2 1
      compiler/utils/ppuutils/ppudump.pp
  14. 2 2
      installer/Makefile
  15. 2 2
      packages/Makefile
  16. 2 2
      packages/a52/Makefile
  17. 2 2
      packages/ami-extra/Makefile
  18. 2 2
      packages/amunits/Makefile
  19. 2 2
      packages/arosunits/Makefile
  20. 2 2
      packages/aspell/Makefile
  21. 2 2
      packages/bfd/Makefile
  22. 2 2
      packages/bzip2/Makefile
  23. 2 2
      packages/cairo/Makefile
  24. 2 2
      packages/cdrom/Makefile
  25. 2 2
      packages/cdrom/examples/Makefile
  26. 2 2
      packages/chm/Makefile
  27. 2 2
      packages/cocoaint/Makefile
  28. 2 2
      packages/dblib/Makefile
  29. 2 2
      packages/dbus/Makefile
  30. 2 2
      packages/dbus/examples/Makefile
  31. 2 2
      packages/dts/Makefile
  32. 2 2
      packages/fastcgi/Makefile
  33. 2 2
      packages/fcl-async/Makefile
  34. 2 2
      packages/fcl-base/Makefile
  35. 2 2
      packages/fcl-base/examples/Makefile
  36. 2 2
      packages/fcl-db/Makefile
  37. 2 2
      packages/fcl-db/src/base/Makefile
  38. 2 2
      packages/fcl-db/src/codegen/Makefile
  39. 2 2
      packages/fcl-db/src/datadict/Makefile
  40. 2 2
      packages/fcl-db/src/dbase/Makefile
  41. 2 2
      packages/fcl-db/src/export/Makefile
  42. 2 2
      packages/fcl-db/src/json/Makefile
  43. 2 2
      packages/fcl-db/src/memds/Makefile
  44. 2 2
      packages/fcl-db/src/paradox/Makefile
  45. 2 2
      packages/fcl-db/src/sdf/Makefile
  46. 2 2
      packages/fcl-db/src/sql/Makefile
  47. 2 2
      packages/fcl-db/src/sqldb/Makefile
  48. 2 2
      packages/fcl-db/src/sqldb/interbase/Makefile
  49. 2 2
      packages/fcl-db/src/sqldb/mssql/Makefile
  50. 2 2
      packages/fcl-db/src/sqldb/mysql/Makefile
  51. 2 2
      packages/fcl-db/src/sqldb/odbc/Makefile
  52. 2 2
      packages/fcl-db/src/sqldb/oracle/Makefile
  53. 2 2
      packages/fcl-db/src/sqldb/postgres/Makefile
  54. 1 1
      packages/fcl-db/src/sqldb/postgres/pqconnection.pp
  55. 2 2
      packages/fcl-db/src/sqldb/sqlite/Makefile
  56. 2 2
      packages/fcl-db/src/sqlite/Makefile
  57. 2 2
      packages/fcl-db/tests/Makefile
  58. 2 2
      packages/fcl-extra/Makefile
  59. 2 2
      packages/fcl-extra/examples/Makefile
  60. 2 2
      packages/fcl-fpcunit/Makefile
  61. 2 2
      packages/fcl-fpcunit/src/exampletests/Makefile
  62. 2 2
      packages/fcl-fpcunit/src/tests/Makefile
  63. 2 2
      packages/fcl-image/Makefile
  64. 2 2
      packages/fcl-image/examples/Makefile
  65. 2 2
      packages/fcl-js/Makefile
  66. 2 2
      packages/fcl-json/Makefile
  67. 2 2
      packages/fcl-net/Makefile
  68. 2 2
      packages/fcl-net/examples/Makefile
  69. 2 2
      packages/fcl-passrc/Makefile
  70. 1 1
      packages/fcl-passrc/src/pasresolver.pp
  71. 4 1
      packages/fcl-passrc/src/passrcutil.pp
  72. 5 4
      packages/fcl-passrc/src/pastree.pp
  73. 87 41
      packages/fcl-passrc/src/pparser.pp
  74. 77 24
      packages/fcl-passrc/src/pscanner.pp
  75. 70 3
      packages/fcl-passrc/tests/tcclasstype.pas
  76. 25 0
      packages/fcl-passrc/tests/tcgenerics.pp
  77. 14 0
      packages/fcl-passrc/tests/tconstparser.pas
  78. 30 2
      packages/fcl-passrc/tests/tcprocfunc.pas
  79. 25 2
      packages/fcl-passrc/tests/tcscanner.pas
  80. 21 0
      packages/fcl-passrc/tests/tctypeparser.pas
  81. 50 0
      packages/fcl-passrc/tests/tcvarparser.pas
  82. 2 2
      packages/fcl-pdf/Makefile
  83. 2 2
      packages/fcl-process/Makefile
  84. 2 2
      packages/fcl-registry/Makefile
  85. 2 2
      packages/fcl-registry/tests/Makefile
  86. 2 2
      packages/fcl-report/Makefile
  87. 2 2
      packages/fcl-res/Makefile
  88. 2 2
      packages/fcl-sdo/Makefile
  89. 2 2
      packages/fcl-sound/Makefile
  90. 4 4
      packages/fcl-sound/src/fpwavreader.pas
  91. 1 1
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16.wav.info.txt
  92. 1 1
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16_tag.wav.info.txt
  93. 1 1
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_24.wav.info.txt
  94. 1 1
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav.info.txt
  95. BIN
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32float.wav
  96. 1 0
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32float.wav.info.txt
  97. BIN
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32float.wav.raw
  98. BIN
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_64float.wav
  99. 1 0
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_64float.wav.info.txt
  100. BIN
      packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_64float.wav.raw

+ 12 - 0
.gitattributes

@@ -4368,6 +4368,12 @@ packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_24.wav.raw -text
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav -text svneol=unset#audio/x-wav
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav -text svneol=unset#audio/x-wav
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav.info.txt svneol=native#text/plain
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav.info.txt svneol=native#text/plain
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav.raw -text
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav.raw -text
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32float.wav -text svneol=unset#audio/x-wav
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32float.wav.info.txt svneol=native#text/plain
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32float.wav.raw -text
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_64float.wav -text svneol=unset#audio/x-wav
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_64float.wav.info.txt svneol=native#text/plain
+packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_64float.wav.raw -text
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav -text svneol=unset#audio/x-wav
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav -text svneol=unset#audio/x-wav
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav.info.txt svneol=native#text/plain
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav.info.txt svneol=native#text/plain
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav.raw -text svneol=unset#application/octet-stream
 packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_8.wav.raw -text svneol=unset#application/octet-stream
@@ -4380,6 +4386,12 @@ packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_24.wav.raw -text
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32.wav -text svneol=unset#audio/x-wav
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32.wav -text svneol=unset#audio/x-wav
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32.wav.info.txt svneol=native#text/plain
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32.wav.info.txt svneol=native#text/plain
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32.wav.raw -text
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32.wav.raw -text
+packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32float.wav -text svneol=unset#audio/x-wav
+packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32float.wav.info.txt svneol=native#text/plain
+packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_32float.wav.raw -text
+packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_64float.wav -text svneol=unset#audio/x-wav
+packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_64float.wav.info.txt svneol=native#text/plain
+packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_64float.wav.raw -text
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_8.wav -text svneol=unset#audio/x-wav
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_8.wav -text svneol=unset#audio/x-wav
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_8.wav.info.txt svneol=native#text/plain
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_8.wav.info.txt svneol=native#text/plain
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_8.wav.raw -text svneol=unset#application/octet-stream
 packages/fcl-sound/tests/data/wav/reader/valid/44k_stereo_8.wav.raw -text svneol=unset#application/octet-stream

+ 2 - 2
Makefile

@@ -1597,11 +1597,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
compiler/Makefile

@@ -3643,11 +3643,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 6 - 6
compiler/assemble.pas

@@ -587,7 +587,7 @@ Implementation
         index: longint;
         index: longint;
       begin
       begin
         MaybeAddLinePostfix;
         MaybeAddLinePostfix;
-        if (cs_link_on_target in current_settings.globalswitches) then
+        if (cs_assemble_on_target in current_settings.globalswitches) then
           newline:=@target_info.newline
           newline:=@target_info.newline
         else
         else
           newline:=@source_info.newline;
           newline:=@source_info.newline;
@@ -623,7 +623,7 @@ Implementation
           compiler itself, especially on hardware with slow disk I/O.
           compiler itself, especially on hardware with slow disk I/O.
           Consider this as a poor man's pipe on Amiga, because real pipe handling
           Consider this as a poor man's pipe on Amiga, because real pipe handling
           would be much more complex and error prone to implement. (KB) }
           would be much more complex and error prone to implement. (KB) }
-        if (([cs_asm_extern,cs_asm_leave,cs_link_on_target] * current_settings.globalswitches) = []) then
+        if (([cs_asm_extern,cs_asm_leave,cs_assemble_on_target] * current_settings.globalswitches) = []) then
          begin
          begin
           { try to have an unique name for the .s file }
           { try to have an unique name for the .s file }
           tempFileName:=HexStr(GetProcessID shr 4,7)+ExtractFileName(owner.AsmFileName);
           tempFileName:=HexStr(GetProcessID shr 4,7)+ExtractFileName(owner.AsmFileName);
@@ -745,7 +745,7 @@ Implementation
       begin
       begin
 {$ifdef hasunix}
 {$ifdef hasunix}
         DoPipe:=(cs_asm_pipe in current_settings.globalswitches) and
         DoPipe:=(cs_asm_pipe in current_settings.globalswitches) and
-                (([cs_asm_extern,cs_asm_leave,cs_link_on_target] * current_settings.globalswitches) = []) and
+                (([cs_asm_extern,cs_asm_leave,cs_assemble_on_target] * current_settings.globalswitches) = []) and
                 ((asminfo^.id in [as_gas,as_ggas,as_darwin,as_powerpc_xcoff,as_clang_gas,as_clang_llvm,as_solaris_as]));
                 ((asminfo^.id in [as_gas,as_ggas,as_darwin,as_powerpc_xcoff,as_clang_gas,as_clang_llvm,as_solaris_as]));
 {$else hasunix}
 {$else hasunix}
         DoPipe:=false;
         DoPipe:=false;
@@ -829,9 +829,9 @@ Implementation
         asmbin:=asminfo^.asmbin;
         asmbin:=asminfo^.asmbin;
         if (af_llvm in asminfo^.flags) then
         if (af_llvm in asminfo^.flags) then
           asmbin:=asmbin+llvmutilssuffix;
           asmbin:=asmbin+llvmutilssuffix;
-        if cs_link_on_target in current_settings.globalswitches then
+        if cs_assemble_on_target in current_settings.globalswitches then
          begin
          begin
-           { If linking on target, don't add any path PM }
+           { If assembling on target, don't add any path PM }
            FindAssembler:=utilsprefix+ChangeFileExt(asmbin,target_info.exeext);
            FindAssembler:=utilsprefix+ChangeFileExt(asmbin,target_info.exeext);
            exit;
            exit;
          end
          end
@@ -937,7 +937,7 @@ Implementation
           Replace(result,'$ARCH',lower(cputypestr[current_settings.cputype]))
           Replace(result,'$ARCH',lower(cputypestr[current_settings.cputype]))
 {$endif arm}
 {$endif arm}
         ;
         ;
-        if (cs_link_on_target in current_settings.globalswitches) then
+        if (cs_assemble_on_target in current_settings.globalswitches) then
          begin
          begin
            Replace(result,'$ASM',maybequoted(ScriptFixFileName(AsmFileName)));
            Replace(result,'$ASM',maybequoted(ScriptFixFileName(AsmFileName)));
            Replace(result,'$OBJ',maybequoted(ScriptFixFileName(ObjFileName)));
            Replace(result,'$OBJ',maybequoted(ScriptFixFileName(ObjFileName)));

+ 2 - 1
compiler/globtype.pas

@@ -229,7 +229,8 @@ interface
          cs_link_pre_binutils_2_19,
          cs_link_pre_binutils_2_19,
          cs_link_vlink,
          cs_link_vlink,
          { disable LTO for the system unit (needed to work around linker bugs on macOS) }
          { disable LTO for the system unit (needed to work around linker bugs on macOS) }
-         cs_lto_nosystem
+         cs_lto_nosystem,
+	 cs_assemble_on_target
        );
        );
        tglobalswitches = set of tglobalswitch;
        tglobalswitches = set of tglobalswitch;
 
 

+ 3 - 2
compiler/link.pas

@@ -216,10 +216,11 @@ Implementation
          exit;
          exit;
 
 
         {When linking on target, the units has not been assembled yet,
         {When linking on target, the units has not been assembled yet,
+         if assembling is also done on target,
          so there is no object files to look for at
          so there is no object files to look for at
          the host. Look for the corresponding assembler file instead,
          the host. Look for the corresponding assembler file instead,
          because it will be assembled to object file on the target.}
          because it will be assembled to object file on the target.}
-        if isunit and (cs_link_on_target in current_settings.globalswitches) then
+        if isunit and (cs_assemble_on_target in current_settings.globalswitches) then
           s:=ChangeFileExt(s,target_info.asmext);
           s:=ChangeFileExt(s,target_info.asmext);
 
 
         { when it does not belong to the unit then check if
         { when it does not belong to the unit then check if
@@ -266,7 +267,7 @@ Implementation
          Message1(exec_w_objfile_not_found,s);
          Message1(exec_w_objfile_not_found,s);
 
 
         {Restore file extension}
         {Restore file extension}
-        if isunit and (cs_link_on_target in current_settings.globalswitches) then
+        if isunit and (cs_assemble_on_target in current_settings.globalswitches) then
           foundfile:= ChangeFileExt(foundfile,target_info.objext);
           foundfile:= ChangeFileExt(foundfile,target_info.objext);
 
 
         findobjectfile:=ScriptFixFileName(foundfile);
         findobjectfile:=ScriptFixFileName(foundfile);

+ 2 - 1
compiler/msg/errore.msg

@@ -4094,6 +4094,7 @@ F*2P<x>_Set target CPU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel,powerpc,
 **2SI<x>_Set interface style to <x>
 **2SI<x>_Set interface style to <x>
 **3SIcom_COM compatible interface (default)
 **3SIcom_COM compatible interface (default)
 **3SIcorba_CORBA compatible interface
 **3SIcorba_CORBA compatible interface
+**2sT_Generate script only to link on target
 **2Sm_Support macros like C (global)
 **2Sm_Support macros like C (global)
 **2So_Same as -Mtp
 **2So_Same as -Mtp
 **2Sr_Transparent file names in ISO mode
 **2Sr_Transparent file names in ISO mode
@@ -4103,7 +4104,7 @@ F*2P<x>_Set target CPU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipsel,powerpc,
 **2Sy_@<pointer> returns a typed pointer, same as $T+
 **2Sy_@<pointer> returns a typed pointer, same as $T+
 **1s_Do not call assembler and linker
 **1s_Do not call assembler and linker
 **2sh_Generate script to link on host
 **2sh_Generate script to link on host
-**2st_Generate script to link on target
+**2st_Generate script to assemble and link on target
 **2sr_Skip register allocation phase (use with -alr)
 **2sr_Skip register allocation phase (use with -alr)
 **1T<x>_Target operating system:
 **1T<x>_Target operating system:
 # i386 targets
 # i386 targets

+ 1 - 1
compiler/msgidx.inc

@@ -1135,7 +1135,7 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 86546;
+  MsgTxtSize = 86604;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
     28,107,360,130,99,63,145,36,223,68,
     28,107,360,130,99,63,145,36,223,68,

+ 89 - 90
compiler/msgtxt.inc

@@ -1738,43 +1738,44 @@ const msgtxt : array[0..000360,1..240] of char=(
   '**2SI<x>_Set interface style to <x>'#010+
   '**2SI<x>_Set interface style to <x>'#010+
   '**3SIcom_COM compatible interface (default)'#010+
   '**3SIcom_COM compatible interface (default)'#010+
   '**3SIcorba_CORBA compatible interface'#010+
   '**3SIcorba_CORBA compatible interface'#010+
-  '**2Sm_Support macro','s like C (global)'#010+
+  '**2sT_Generate scri','pt only to link on target'#010+
+  '**2Sm_Support macros like C (global)'#010+
   '**2So_Same as -Mtp'#010+
   '**2So_Same as -Mtp'#010+
   '**2Sr_Transparent file names in ISO mode'#010+
   '**2Sr_Transparent file names in ISO mode'#010+
   '**2Ss_Constructor name must be init (destructor must be done)'#010+
   '**2Ss_Constructor name must be init (destructor must be done)'#010+
-  '**2Sv_Support vector processing (use CPU vector extensions if availabl'+
-  'e)'#010+
-  '**2Sx_Enable exception keyw','ords (default in Delphi/ObjFPC modes)'#010+
+  '**2Sv_Support vector processing (use CPU vector extensi','ons if availa'+
+  'ble)'#010+
+  '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
   '**2Sy_@<pointer> returns a typed pointer, same as $T+'#010+
   '**2Sy_@<pointer> returns a typed pointer, same as $T+'#010+
   '**1s_Do not call assembler and linker'#010+
   '**1s_Do not call assembler and linker'#010+
   '**2sh_Generate script to link on host'#010+
   '**2sh_Generate script to link on host'#010+
-  '**2st_Generate script to link on target'#010+
-  '**2sr_Skip register allocation p','hase (use with -alr)'#010+
+  '**2st_Generate script to as','semble and link on target'#010+
+  '**2sr_Skip register allocation phase (use with -alr)'#010+
   '**1T<x>_Target operating system:'#010+
   '**1T<x>_Target operating system:'#010+
   '3*2Tandroid_Android'#010+
   '3*2Tandroid_Android'#010+
   '3*2Taros_AROS'#010+
   '3*2Taros_AROS'#010+
   '3*2Tbeos_BeOS'#010+
   '3*2Tbeos_BeOS'#010+
   '3*2Tdarwin_Darwin/Mac OS X'#010+
   '3*2Tdarwin_Darwin/Mac OS X'#010+
   '3*2Tembedded_Embedded'#010+
   '3*2Tembedded_Embedded'#010+
-  '3*2Temx_OS/2 via EMX (including EMX/RSX extender)'#010+
+  '3*2Temx_OS/2 via EMX (including',' EMX/RSX extender)'#010+
   '3*2Tfreebsd_FreeBSD'#010+
   '3*2Tfreebsd_FreeBSD'#010+
-  '3*2Tgo32v2_Version ','2 of DJ Delorie DOS extender'#010+
+  '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+
   '3*2Thaiku_Haiku'#010+
   '3*2Thaiku_Haiku'#010+
   '3*2Tiphonesim_iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tdar'+
   '3*2Tiphonesim_iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tdar'+
   'win)'#010+
   'win)'#010+
   '3*2Tlinux_Linux'#010+
   '3*2Tlinux_Linux'#010+
   '3*2Tnativent_Native NT API (experimental)'#010+
   '3*2Tnativent_Native NT API (experimental)'#010+
-  '3*2Tnetbsd_NetBSD'#010+
+  '3*2T','netbsd_NetBSD'#010+
   '3*2Tnetware_Novell Netware Module (clib)'#010+
   '3*2Tnetware_Novell Netware Module (clib)'#010+
-  '3*2','Tnetwlibc_Novell Netware Module (libc)'#010+
+  '3*2Tnetwlibc_Novell Netware Module (libc)'#010+
   '3*2Topenbsd_OpenBSD'#010+
   '3*2Topenbsd_OpenBSD'#010+
   '3*2Tos2_OS/2 / eComStation'#010+
   '3*2Tos2_OS/2 / eComStation'#010+
   '3*2Tsymbian_Symbian OS'#010+
   '3*2Tsymbian_Symbian OS'#010+
   '3*2Tsolaris_Solaris'#010+
   '3*2Tsolaris_Solaris'#010+
   '3*2Twatcom_Watcom compatible DOS extender'#010+
   '3*2Twatcom_Watcom compatible DOS extender'#010+
-  '3*2Twdosx_WDOSX DOS extender'#010+
+  '3*2Twdosx_W','DOSX DOS extender'#010+
   '3*2Twin32_Windows 32 Bit'#010+
   '3*2Twin32_Windows 32 Bit'#010+
-  '3*2Twince_Windo','ws CE'#010+
+  '3*2Twince_Windows CE'#010+
   '4*2Tandroid_Android'#010+
   '4*2Tandroid_Android'#010+
   '4*2Taros_AROS'#010+
   '4*2Taros_AROS'#010+
   '4*2Tdarwin_Darwin/Mac OS X'#010+
   '4*2Tdarwin_Darwin/Mac OS X'#010+
@@ -1782,20 +1783,20 @@ const msgtxt : array[0..000360,1..240] of char=(
   '4*2Tembedded_Embedded'#010+
   '4*2Tembedded_Embedded'#010+
   '4*2Tfreebsd_FreeBSD'#010+
   '4*2Tfreebsd_FreeBSD'#010+
   '4*2Thaiku_Haiku'#010+
   '4*2Thaiku_Haiku'#010+
-  '4*2Tiphonesim_iPhoneSimulator'#010+
+  '4*2Tiphonesim_iPhoneSimulator',#010+
   '4*2Tlinux_Linux'#010+
   '4*2Tlinux_Linux'#010+
   '4*2Tnetbsd_NetBSD'#010+
   '4*2Tnetbsd_NetBSD'#010+
   '4*2Topenbsd_OpenBSD'#010+
   '4*2Topenbsd_OpenBSD'#010+
-  '4*2','Tsolaris_Solaris'#010+
+  '4*2Tsolaris_Solaris'#010+
   '4*2Twin64_Win64 (64 bit Windows systems)'#010+
   '4*2Twin64_Win64 (64 bit Windows systems)'#010+
   '6*2Tamiga_Commodore Amiga'#010+
   '6*2Tamiga_Commodore Amiga'#010+
   '6*2Tatari_Atari ST/STe/TT'#010+
   '6*2Tatari_Atari ST/STe/TT'#010+
   '6*2Tembedded_Embedded'#010+
   '6*2Tembedded_Embedded'#010+
   '6*2Tlinux_Linux'#010+
   '6*2Tlinux_Linux'#010+
   '6*2Tnetbsd_NetBSD'#010+
   '6*2Tnetbsd_NetBSD'#010+
-  '6*2Tmacosclassic_Classic Mac OS'#010+
+  '6*2Tmacosclassic','_Classic Mac OS'#010+
   '6*2Tpalmos_PalmOS'#010+
   '6*2Tpalmos_PalmOS'#010+
-  '6*2Tsinclairql_Sinclair ','QL'#010+
+  '6*2Tsinclairql_Sinclair QL'#010+
   '8*2Tembedded_Embedded'#010+
   '8*2Tembedded_Embedded'#010+
   '8*2Tmsdos_MS-DOS (and compatible)'#010+
   '8*2Tmsdos_MS-DOS (and compatible)'#010+
   '8*2Twin16_Windows 16 Bit'#010+
   '8*2Twin16_Windows 16 Bit'#010+
@@ -1803,11 +1804,11 @@ const msgtxt : array[0..000360,1..240] of char=(
   'A*2Taros_AROS'#010+
   'A*2Taros_AROS'#010+
   'A*2Tembedded_Embedded'#010+
   'A*2Tembedded_Embedded'#010+
   'A*2Tfreertos_FreeRTOS'#010+
   'A*2Tfreertos_FreeRTOS'#010+
-  'A*2Tgba_Game Boy Advance'#010+
+  'A*2Tgba_Game Boy Adv','ance'#010+
   'A*2Tios_iOS'#010+
   'A*2Tios_iOS'#010+
   'A*2Tlinux_Linux'#010+
   'A*2Tlinux_Linux'#010+
   'A*2Tnds_Nintendo DS'#010+
   'A*2Tnds_Nintendo DS'#010+
-  'A*2Tn','etbsd_NetBSD'#010+
+  'A*2Tnetbsd_NetBSD'#010+
   'A*2Tpalmos_PalmOS'#010+
   'A*2Tpalmos_PalmOS'#010+
   'A*2Tsymbian_Symbian'#010+
   'A*2Tsymbian_Symbian'#010+
   'A*2Twince_Windows CE'#010+
   'A*2Twince_Windows CE'#010+
@@ -1816,10 +1817,10 @@ const msgtxt : array[0..000360,1..240] of char=(
   'a*2Tios_iOS'#010+
   'a*2Tios_iOS'#010+
   'a*2Tlinux_Linux'#010+
   'a*2Tlinux_Linux'#010+
   'a*2Twin64_Windows 64'#010+
   'a*2Twin64_Windows 64'#010+
-  'J*2Tandroid_Android'#010+
+  'J*2Tandroid_An','droid'#010+
   'J*2Tjava_Java'#010+
   'J*2Tjava_Java'#010+
   'm*2Tandroid_Android'#010+
   'm*2Tandroid_Android'#010+
-  'm*2Tembedded_Embed','ded'#010+
+  'm*2Tembedded_Embedded'#010+
   'm*2Tlinux_Linux'#010+
   'm*2Tlinux_Linux'#010+
   'M*2Tembedded_Embedded'#010+
   'M*2Tembedded_Embedded'#010+
   'M*2Tlinux_Linux'#010+
   'M*2Tlinux_Linux'#010+
@@ -1828,11 +1829,11 @@ const msgtxt : array[0..000360,1..240] of char=(
   'P*2Tdarwin_Darwin/Mac OS X'#010+
   'P*2Tdarwin_Darwin/Mac OS X'#010+
   'P*2Tembedded_Embedded'#010+
   'P*2Tembedded_Embedded'#010+
   'P*2Tlinux_Linux'#010+
   'P*2Tlinux_Linux'#010+
-  'P*2Tmacosclassic_Classic Mac OS'#010+
+  'P*2Tmacosclassic_Classic Mac ','OS'#010+
   'P*2Tmorphos_MorphOS'#010+
   'P*2Tmorphos_MorphOS'#010+
   'P*2Tnetbsd_NetBSD'#010+
   'P*2Tnetbsd_NetBSD'#010+
   'P*2Twii_Wii'#010+
   'P*2Twii_Wii'#010+
-  'p*2Ta','ix_AIX'#010+
+  'p*2Taix_AIX'#010+
   'p*2Tdarwin_Darwin/Mac OS X'#010+
   'p*2Tdarwin_Darwin/Mac OS X'#010+
   'p*2Tembedded_Embedded'#010+
   'p*2Tembedded_Embedded'#010+
   'p*2Tlinux_Linux'#010+
   'p*2Tlinux_Linux'#010+
@@ -1841,10 +1842,10 @@ const msgtxt : array[0..000360,1..240] of char=(
   'r*2Tlinux_Linux'#010+
   'r*2Tlinux_Linux'#010+
   'r*2Tembedded_Embedded'#010+
   'r*2Tembedded_Embedded'#010+
   'S*2Tlinux_Linux'#010+
   'S*2Tlinux_Linux'#010+
-  'S*2Tsolaris_Solaris'#010+
+  'S*2Tsolaris_Solari','s'#010+
   's*2Tlinux_Linux'#010+
   's*2Tlinux_Linux'#010+
   'V*2Tembedded_Embedded'#010+
   'V*2Tembedded_Embedded'#010+
-  'x*2Tembedded_Embed','ded'#010+
+  'x*2Tembedded_Embedded'#010+
   'x*2Tfreertos_FreeRTOS'#010+
   'x*2Tfreertos_FreeRTOS'#010+
   'x*2Tlinux_Linux'#010+
   'x*2Tlinux_Linux'#010+
   'Z*2Tembedded_Embedded'#010+
   'Z*2Tembedded_Embedded'#010+
@@ -1852,150 +1853,148 @@ const msgtxt : array[0..000360,1..240] of char=(
   'Z*2Tmsxdos_MSX-DOS'#010+
   'Z*2Tmsxdos_MSX-DOS'#010+
   '**1u<x>_Undefines the symbol <x>'#010+
   '**1u<x>_Undefines the symbol <x>'#010+
   '**1U_Unit options:'#010+
   '**1U_Unit options:'#010+
-  '**2Un_Do not check where the unit name matches the file name'#010+
-  '**2Ur_Generate re','lease unit files (never automatically recompiled)'#010+
+  '**2Un_Do not check w','here the unit name matches the file name'#010+
+  '**2Ur_Generate release unit files (never automatically recompiled)'#010+
   '**2Us_Compile a system unit'#010+
   '**2Us_Compile a system unit'#010+
   '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
   '**1v<x>_Be verbose. <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*_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*_n : Show notes                  t : Show tried/used files'#010+
   '**2*_h : Show hints                  c : Show conditionals'#010+
   '**2*_h : Show hints                  c : Show conditionals'#010+
-  '**2*_i : Show general info           d : Show debug info'#010+
-  '**2*_l : Show linenumbers     ','       r : Rhide/GCC compatibility mod'+
-  'e'#010+
+  '**2*_i : Show general info   ','        d : Show debug info'#010+
+  '**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode'#010+
   '**2*_s : Show time stamps            q : Show message numbers'#010+
   '**2*_s : Show time stamps            q : Show message numbers'#010+
   '**2*_a : Show everything             x : Show info about invoked tools'+
   '**2*_a : Show everything             x : Show info about invoked tools'+
   #010+
   #010+
-  '**2*_b : Write file names messages   p : Write tree.log with parse ','t'+
+  '**2*_b : ','Write file names messages   p : Write tree.log with parse t'+
   'ree'#010+
   'ree'#010+
   '**2*_    with full path              v : Write fpcdebug.txt with'#010+
   '**2*_    with full path              v : Write fpcdebug.txt with'#010+
   '**2*_z : Write output to stderr          lots of debugging info'#010+
   '**2*_z : Write output to stderr          lots of debugging info'#010+
-  '**2*_m<x>,<y> : Do not show messages numbered <x> and <y>'#010+
-  'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binar','y name (e.g.'+
-  ' for version)'#010+
+  '**2*_m<x>,<y> : Do not show messages numbered <x','> and <y>'#010+
+  'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g. f'+
+  'or version)'#010+
   '**1W<x>_Target-specific options (targets)'#010+
   '**1W<x>_Target-specific options (targets)'#010+
   '3*2WA_Specify native type application (Windows)'#010+
   '3*2WA_Specify native type application (Windows)'#010+
   '4*2WA_Specify native type application (Windows)'#010+
   '4*2WA_Specify native type application (Windows)'#010+
-  'A*2WA_Specify native type application (Windows)'#010+
-  '3*2Wb_Create a bundle instea','d of a library (Darwin)'#010+
+  'A*2WA_Specify nati','ve type application (Windows)'#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+
   'p*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'a*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'a*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'A*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  '4*2Wb_Cr','eate a bundle instead of a library (Darwin)'#010+
+  'A*','2Wb_Create a bundle instead of a library (Darwin)'#010+
+  '4*2Wb_Create a bundle instead of a library (Darwin)'#010+
   '3*2WB_Create a relocatable image (Windows, Symbian)'#010+
   '3*2WB_Create a relocatable image (Windows, Symbian)'#010+
   '3*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+
   '3*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+
-  '4*2WB_Create a relocatable image (Windows)'#010+
+  '4*2WB_Create a relocatable image (Wi','ndows)'#010+
   '4*2WB<x>_Set image base to <x> (Windows)'#010+
   '4*2WB<x>_Set image base to <x> (Windows)'#010+
-  'A*2WB_Crea','te a relocatable image (Windows, Symbian)'#010+
+  'A*2WB_Create a relocatable image (Windows, Symbian)'#010+
   'A*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+
   'A*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+
   'Z*2WB<x>_Set image base to <x> (ZX Spectrum)'#010+
   'Z*2WB<x>_Set image base to <x> (ZX Spectrum)'#010+
-  '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
-  '4*2WC_Specify console type application (Win','dows)'#010+
+  '3*2WC_Specify console type application (EMX, ','OS/2, Windows)'#010+
+  '4*2WC_Specify console type application (Windows)'#010+
   'A*2WC_Specify console type application (Windows)'#010+
   'A*2WC_Specify console type application (Windows)'#010+
   'P*2WC_Specify console type application (Classic Mac OS)'#010+
   'P*2WC_Specify console type application (Classic Mac OS)'#010+
   '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
-  '4*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
-  'A*2WD','_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
+  '4*2WD_Use',' DEFFILE to export functions of 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+
   '3*2We_Use external resources (Darwin)'#010+
   '4*2We_Use external resources (Darwin)'#010+
   '4*2We_Use external resources (Darwin)'#010+
   'a*2We_Use external resources (Darwin)'#010+
   'a*2We_Use external resources (Darwin)'#010+
-  'A*2We_Use external resources (Darwin)'#010+
-  'P*2We_Use external resources (D','arwin)'#010+
+  'A*2We_Use e','xternal 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 application (EMX, OS/2)'#010+
   '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
   '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
-  '4*2WG_Specify graphic type application (Windows)'#010+
-  'A*2WG_Specify graphic type appl','ication (Windows)'#010+
+  '4*2WG_Specify graphic ','type application (Windows)'#010+
+  'A*2WG_Specify graphic type application (Windows)'#010+
   'P*2WG_Specify graphic type application (Classic Mac OS)'#010+
   'P*2WG_Specify graphic type application (Classic Mac OS)'#010+
   '3*2Wi_Use internal resources (Darwin)'#010+
   '3*2Wi_Use internal resources (Darwin)'#010+
   '4*2Wi_Use internal resources (Darwin)'#010+
   '4*2Wi_Use internal resources (Darwin)'#010+
-  'a*2Wi_Use internal resources (Darwin)'#010+
+  'a*2Wi_Use internal resources (Da','rwin)'#010+
   'A*2Wi_Use internal resources (Darwin)'#010+
   'A*2Wi_Use internal resources (Darwin)'#010+
-  'P*2Wi_Use inte','rnal resources (Darwin)'#010+
+  'P*2Wi_Use internal resources (Darwin)'#010+
   'p*2Wi_Use internal resources (Darwin)'#010+
   'p*2Wi_Use internal resources (Darwin)'#010+
   '3*2WI_Turn on/off the usage of import sections (Windows)'#010+
   '3*2WI_Turn on/off the usage of import sections (Windows)'#010+
   '4*2WI_Turn on/off the usage of import sections (Windows)'#010+
   '4*2WI_Turn on/off the usage of import sections (Windows)'#010+
-  'A*2WI_Turn on/off the usage of import sections (Windows)'#010+
-  '8*2Wh_U','se huge code for units (ignored for models with CODE in a uni'+
-  'que segment)'#010+
+  'A*2WI_','Turn on/off the usage of import sections (Windows)'#010+
+  '8*2Wh_Use huge code for units (ignored for models with CODE in a uniqu'+
+  'e segment)'#010+
   '8*2Wm<x>_Set memory model'#010+
   '8*2Wm<x>_Set memory model'#010+
   '8*3WmTiny_Tiny memory model'#010+
   '8*3WmTiny_Tiny memory model'#010+
   '8*3WmSmall_Small memory model (default)'#010+
   '8*3WmSmall_Small memory model (default)'#010+
-  '8*3WmMedium_Medium memory model'#010+
+  '8*3WmMedium_Me','dium memory model'#010+
   '8*3WmCompact_Compact memory model'#010+
   '8*3WmCompact_Compact memory model'#010+
-  '8*3WmL','arge_Large memory model'#010+
+  '8*3WmLarge_Large memory model'#010+
   '8*3WmHuge_Huge memory model'#010+
   '8*3WmHuge_Huge memory model'#010+
   '3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   '3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'n)'#010+
   'n)'#010+
-  '4*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
-  'n)'#010+
-  'p*2WM<x>_Minimum Mac OS X deployment versi','on: 10.4, 10.5.1, ... (Dar'+
+  '4*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.','1, ... (Dar'+
   'win)'#010+
   'win)'#010+
+  'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
+  'n)'#010+
   'P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'n)'#010+
   'n)'#010+
   '3*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   '3*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  '4*2WN_Do not generate relocation code, needed for debugging (Windo','ws'+
+  '4*2WN_Do',' not generate relocation code, needed for debugging (Windows'+
   ')'#010+
   ')'#010+
   'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   'A*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
   'A*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
   'le values'#010+
   'le values'#010+
-  'm*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
-  'le values'#010+
-  'R*2Wp<','x>_Specify the controller type; see fpc -i or fpc -iu for poss'+
+  'm*2Wp<x>_Specify the control','ler type; see fpc -i or fpc -iu for poss'+
   'ible values'#010+
   'ible values'#010+
-  'V*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
+  'R*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
   'le values'#010+
   'le values'#010+
-  'x*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
+  'V*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+
   'le values'#010+
   'le values'#010+
-  '3*2WP<','x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'+
-  #010+
+  'x*2Wp<x>_Specify the control','ler type; see fpc -i or fpc -iu for poss'+
+  'ible values'#010+
+  '3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'#010+
   '4*2WP<x>_Minimum iOS deployment version: 8.0, 8.0.2, ... (iphonesim)'#010+
   '4*2WP<x>_Minimum iOS deployment version: 8.0, 8.0.2, ... (iphonesim)'#010+
-  'a*2WP<x>_Minimum iOS deployment version: 7.0, 7.1.2, ... (Darwin)'#010+
-  'A*2WP<x>_Minimum iOS deployment version: 3','.0, 5.0.1, ... (Darwin)'#010+
+  'a*2WP<x>_Minimum iOS deployment version: 7.0, 7.1.','2, ... (Darwin)'#010+
+  'A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)'#010+
   '3*2WR_Generate relocation code (Windows)'#010+
   '3*2WR_Generate relocation code (Windows)'#010+
   '4*2WR_Generate relocation code (Windows)'#010+
   '4*2WR_Generate relocation code (Windows)'#010+
   'A*2WR_Generate relocation code (Windows)'#010+
   'A*2WR_Generate relocation code (Windows)'#010+
-  '8*2Wt<x>_Set the target executable format'#010+
+  '8*2Wt<x>_Set the target executable ','format'#010+
   '8*3Wtexe_Create a DOS .EXE file (default)'#010+
   '8*3Wtexe_Create a DOS .EXE file (default)'#010+
-  '8*3Wtcom_','Create a DOS .COM file (requires tiny memory model)'#010+
+  '8*3Wtcom_Create a DOS .COM file (requires tiny memory model)'#010+
   'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**1X_Executable options:'#010+
   '**1X_Executable options:'#010+
-  '**2X9_Generate linkerscript for GNU Binutils ld older than version 2','.'+
-  '19.1 (Linux)'#010+
+  '**2X9_Gene','rate linkerscript for GNU Binutils ld older than version 2'+
+  '.19.1 (Linux)'#010+
   '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
   '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
   'ux)'#010+
   'ux)'#010+
   '**2Xd_Do not search default library path (sometimes required for cross'+
   '**2Xd_Do not search default library path (sometimes required for cross'+
-  '-compiling when not using -XR)'#010+
+  '-compiling when not usin','g -XR)'#010+
   '**2Xe_Use external linker'#010+
   '**2Xe_Use external linker'#010+
-  '**2Xf_Substitute pthread ','library name for linking (BSD)'#010+
+  '**2Xf_Substitute pthread library name for linking (BSD)'#010+
   '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
   '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
   'to executable'#010+
   'to executable'#010+
-  '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
+  '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)',#010+
   '**2Xi_Use internal linker'#010+
   '**2Xi_Use internal linker'#010+
-  'L*2XlS<x>_LLVM utilties suffix ','(e.g. -7 in case clang is called clan'+
-  'g-7)'#010+
+  'L*2XlS<x>_LLVM utilties suffix (e.g. -7 in case clang is called clang-'+
+  '7)'#010+
   '**2XLA_Define library substitutions for linking'#010+
   '**2XLA_Define library substitutions for linking'#010+
   '**2XLO_Define order of library linking'#010+
   '**2XLO_Define order of library linking'#010+
   '**2XLD_Exclude default order of standard libraries'#010+
   '**2XLD_Exclude default order of standard libraries'#010+
-  '**2Xm_Generate link map'#010+
-  '**2XM<x>_Set the name of the '#039'main'#039' ','program routine (default'+
-  ' is '#039'main'#039')'#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+
   '**2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)'+
   '**2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)'+
   #010+
   #010+
   'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+
   'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+
-  '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
-  '**2Xr<x>_S','et the linker'#039's rlink-path to <x> (needed for cross co'+
-  'mpile, see the ld manual for more information) (BeOS, Linux)'#010+
-  '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
-  ', Linux, Mac OS, Solaris)'#010+
-  '**2Xs_Strip all symbols from ','executable'#010+
+  '**2XP<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, Free','B'+
+  '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+
   '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
-  '**2Xv_Generate table for Virtual Entry calls'#010+
-  '**2XV_Use VLink as external linker       (default o','n Amiga, MorphOS)'+
-  #010+
+  '**2Xv_Generate table for Virtual Entry',' calls'#010+
+  '**2XV_Use VLink as external linker       (default on Amiga, MorphOS)'#010+
   '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
   '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
   '**1*_'#010+
   '**1*_'#010+
   '**1?_Show this help'#010+
   '**1?_Show this help'#010+

+ 4 - 2
compiler/options.pas

@@ -2142,9 +2142,11 @@ begin
                  begin
                  begin
                    init_settings.globalswitches:=init_settings.globalswitches+[cs_asm_extern,cs_link_extern,cs_link_nolink];
                    init_settings.globalswitches:=init_settings.globalswitches+[cs_asm_extern,cs_link_extern,cs_link_nolink];
                    if more='h' then
                    if more='h' then
-                     init_settings.globalswitches:=init_settings.globalswitches-[cs_link_on_target]
+                     init_settings.globalswitches:=init_settings.globalswitches-[cs_link_on_target,cs_assemble_on_target]
                    else if more='t' then
                    else if more='t' then
-                     init_settings.globalswitches:=init_settings.globalswitches+[cs_link_on_target]
+                     init_settings.globalswitches:=init_settings.globalswitches+[cs_link_on_target,cs_assemble_on_target]
+                   else if more='T' then
+                     init_settings.globalswitches:=init_settings.globalswitches+[cs_link_on_target]-[cs_asm_extern]
                    else if more='r' then
                    else if more='r' then
                      init_settings.globalswitches:=init_settings.globalswitches+[cs_asm_leave,cs_no_regalloc]
                      init_settings.globalswitches:=init_settings.globalswitches+[cs_asm_leave,cs_no_regalloc]
                    else if more<>'' then
                    else if more<>'' then

+ 2 - 2
compiler/utils/Makefile

@@ -2722,11 +2722,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 0 - 4
compiler/utils/ppumove.pp

@@ -24,10 +24,6 @@
 Program ppumove;
 Program ppumove;
 uses
 uses
 
 
-{$IFDEF MACOS}
-{$DEFINE USE_FAKE_SYSUTILS}
-{$ENDIF MACOS}
-
 {$IFNDEF USE_FAKE_SYSUTILS}
 {$IFNDEF USE_FAKE_SYSUTILS}
   sysutils,
   sysutils,
 {$ELSE}
 {$ELSE}

+ 2 - 1
compiler/utils/ppuutils/ppudump.pp

@@ -2300,7 +2300,8 @@ const
         'Link using native linker', {cs_link_native}
         'Link using native linker', {cs_link_native}
         'Link for GNU linker version <=2.19', {cs_link_pre_binutils_2_19}
         'Link for GNU linker version <=2.19', {cs_link_pre_binutils_2_19}
         'Link using vlink', {cs_link_vlink}
         'Link using vlink', {cs_link_vlink}
-        'Link-Time Optimization disabled for system unit' {cs_lto_nosystem}
+        'Link-Time Optimization disabled for system unit', {cs_lto_nosystem}
+        'Assemble on target OS' {cs_asemble_on_target}
        );
        );
     localswitchname : array[tlocalswitch] of string[50] =
     localswitchname : array[tlocalswitch] of string[50] =
        { Switches which can be changed locally }
        { Switches which can be changed locally }

+ 2 - 2
installer/Makefile

@@ -3643,11 +3643,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/Makefile

@@ -1503,11 +1503,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/a52/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/ami-extra/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/amunits/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/arosunits/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/aspell/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/bfd/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/bzip2/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/cairo/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/cdrom/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/cdrom/examples/Makefile

@@ -2633,11 +2633,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/chm/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/cocoaint/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/dblib/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/dbus/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/dbus/examples/Makefile

@@ -2633,11 +2633,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/dts/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fastcgi/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-async/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-base/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-base/examples/Makefile

@@ -3769,11 +3769,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/base/Makefile

@@ -3714,11 +3714,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/codegen/Makefile

@@ -3259,11 +3259,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/datadict/Makefile

@@ -3861,11 +3861,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/dbase/Makefile

@@ -3891,11 +3891,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/export/Makefile

@@ -3401,11 +3401,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/json/Makefile

@@ -2777,11 +2777,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/memds/Makefile

@@ -3259,11 +3259,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/paradox/Makefile

@@ -3089,11 +3089,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sdf/Makefile

@@ -2947,11 +2947,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sql/Makefile

@@ -3571,11 +3571,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sqldb/Makefile

@@ -3920,11 +3920,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sqldb/interbase/Makefile

@@ -3089,11 +3089,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sqldb/mssql/Makefile

@@ -2947,11 +2947,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sqldb/mysql/Makefile

@@ -3401,11 +3401,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sqldb/odbc/Makefile

@@ -3089,11 +3089,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sqldb/oracle/Makefile

@@ -3401,11 +3401,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sqldb/postgres/Makefile

@@ -3401,11 +3401,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 1 - 1
packages/fcl-db/src/sqldb/postgres/pqconnection.pp

@@ -77,7 +77,7 @@ type
   TPQTranConnection = class
   TPQTranConnection = class
   protected
   protected
     FPGConn        : PPGConn;
     FPGConn        : PPGConn;
-    FTranActive    : boolean
+    FTranActive    : boolean;
   end;
   end;
 
 
   { TPQConnection }
   { TPQConnection }

+ 2 - 2
packages/fcl-db/src/sqldb/sqlite/Makefile

@@ -3089,11 +3089,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/src/sqlite/Makefile

@@ -2777,11 +2777,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-db/tests/Makefile

@@ -3089,11 +3089,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-extra/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-extra/examples/Makefile

@@ -2580,11 +2580,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-fpcunit/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-fpcunit/src/exampletests/Makefile

@@ -3231,11 +3231,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-fpcunit/src/tests/Makefile

@@ -3231,11 +3231,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-image/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-image/examples/Makefile

@@ -2633,11 +2633,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-js/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-json/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-net/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-net/examples/Makefile

@@ -3541,11 +3541,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-passrc/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 1 - 1
packages/fcl-passrc/src/pasresolver.pp

@@ -9467,7 +9467,7 @@ begin
       RaiseIncompatibleType(20170216151734,nResultTypeMismatchExpectedButFound,
       RaiseIncompatibleType(20170216151734,nResultTypeMismatchExpectedButFound,
         [],DeclResult,ImplResult,ImplProc);
         [],DeclResult,ImplResult,ImplProc);
 
 
-    if ImplProc.IsAsync<>DeclProc.IsAsync then
+    if ImplProc.IsAsync and not DeclProc.IsAsync then
       RaiseMsg(20200524111856,nXModifierMismatchY,sXModifierMismatchY,['procedure type','async'],ImplProc);
       RaiseMsg(20200524111856,nXModifierMismatchY,sXModifierMismatchY,['procedure type','async'],ImplProc);
     end;
     end;
 
 

+ 4 - 1
packages/fcl-passrc/src/passrcutil.pp

@@ -123,8 +123,11 @@ begin
     D:=ExtractFilePath(FileName);
     D:=ExtractFilePath(FileName);
     If (D='') then
     If (D='') then
       D:='.';
       D:='.';
+    FResolver.ModuleDirectory:=D;
     FResolver.BaseDirectory:=D;
     FResolver.BaseDirectory:=D;
-    FResolver.AddIncludePath(D);
+
+    FResolver.AddIncludePath(D); // still needed?
+
     FScanner:=TPascalScanner.Create(FResolver);
     FScanner:=TPascalScanner.Create(FResolver);
     FScanner.OpenFile(FileName);
     FScanner.OpenFile(FileName);
     FContainer:=TSrcContainer.Create;
     FContainer:=TSrcContainer.Create;

+ 5 - 4
packages/fcl-passrc/src/pastree.pp

@@ -111,7 +111,8 @@ type
 
 
   TPasMemberVisibility = (visDefault, visPrivate, visProtected, visPublic,
   TPasMemberVisibility = (visDefault, visPrivate, visProtected, visPublic,
     visPublished, visAutomated,
     visPublished, visAutomated,
-    visStrictPrivate, visStrictProtected);
+    visStrictPrivate, visStrictProtected,
+    visRequired, visOptional);
 
 
   TCallingConvention = (ccDefault,ccRegister,ccPascal,ccCDecl,ccStdCall,
   TCallingConvention = (ccDefault,ccRegister,ccPascal,ccCDecl,ccStdCall,
                         ccOldFPCCall,ccSafeCall,ccSysCall,ccMWPascal,
                         ccOldFPCCall,ccSafeCall,ccSysCall,ccMWPascal,
@@ -119,7 +120,7 @@ type
                         ccMS_ABI_Default,ccMS_ABI_CDecl,
                         ccMS_ABI_Default,ccMS_ABI_CDecl,
                         ccVectorCall);
                         ccVectorCall);
   TProcTypeModifier = (ptmOfObject,ptmIsNested,ptmStatic,ptmVarargs,
   TProcTypeModifier = (ptmOfObject,ptmIsNested,ptmStatic,ptmVarargs,
-                       ptmReferenceTo,ptmAsync);
+                       ptmReferenceTo,ptmAsync,ptmFar);
   TProcTypeModifiers = set of TProcTypeModifier;
   TProcTypeModifiers = set of TProcTypeModifier;
   TPackMode = (pmNone,pmPacked,pmBitPacked);
   TPackMode = (pmNone,pmPacked,pmBitPacked);
 
 
@@ -1700,7 +1701,7 @@ const
 
 
   VisibilityNames: array[TPasMemberVisibility] of string = (
   VisibilityNames: array[TPasMemberVisibility] of string = (
     'default','private', 'protected', 'public', 'published', 'automated',
     'default','private', 'protected', 'public', 'published', 'automated',
-    'strict private', 'strict protected');
+    'strict private', 'strict protected','required','optional');
 
 
   ObjKindNames: array[TPasObjKind] of string = (
   ObjKindNames: array[TPasObjKind] of string = (
     'object', 'class', 'interface',
     'object', 'class', 'interface',
@@ -1767,7 +1768,7 @@ const
                         'MS_ABI_Default','MS_ABI_CDecl',
                         'MS_ABI_Default','MS_ABI_CDecl',
                         'VectorCall');
                         'VectorCall');
   ProcTypeModifiers : Array[TProcTypeModifier] of string =
   ProcTypeModifiers : Array[TProcTypeModifier] of string =
-      ('of Object', 'is nested','static','varargs','reference to','async');
+      ('of Object', 'is nested','static','varargs','reference to','async','far');
 
 
   ModifierNames : Array[TProcedureModifier] of string
   ModifierNames : Array[TProcedureModifier] of string
                 = ('virtual', 'dynamic','abstract', 'override',
                 = ('virtual', 'dynamic','abstract', 'override',

+ 87 - 41
packages/fcl-passrc/src/pparser.pp

@@ -311,7 +311,7 @@ type
     function CheckProcedureArgs(Parent: TPasElement;
     function CheckProcedureArgs(Parent: TPasElement;
       Args: TFPList; // list of TPasArgument
       Args: TFPList; // list of TPasArgument
       ProcType: TProcType): boolean;
       ProcType: TProcType): boolean;
-    function CheckVisibility(S: String; var AVisibility: TPasMemberVisibility): Boolean;
+    function CheckVisibility(S: String; var AVisibility: TPasMemberVisibility; IsObjCProtocol : Boolean = False): Boolean;
     procedure ParseExc(MsgNumber: integer; const Msg: String);
     procedure ParseExc(MsgNumber: integer; const Msg: String);
     procedure ParseExc(MsgNumber: integer; const Fmt: String; Args : Array of {$ifdef pas2js}jsvalue{$else}const{$endif});
     procedure ParseExc(MsgNumber: integer; const Fmt: String; Args : Array of {$ifdef pas2js}jsvalue{$else}const{$endif});
     procedure ParseExcExpectedIdentifier;
     procedure ParseExcExpectedIdentifier;
@@ -1192,29 +1192,40 @@ procedure TPasParser.ChangeToken(tk: TToken);
 var
 var
   Cur, Last: PTokenRec;
   Cur, Last: PTokenRec;
   IsLast: Boolean;
   IsLast: Boolean;
+
+  Procedure DoChange(tk1,tk2 : TToken);
+
+    begin
+      // change last token '>>' into two '>'
+      Cur:=@FTokenRing[FTokenRingCur];
+      Cur^.Token:=tk2;
+      Cur^.AsString:=TokenInfos[tk2];
+      Last:=@FTokenRing[FTokenRingEnd];
+      Last^.Token:=tk2;
+      Last^.AsString:=TokenInfos[tk2];
+      if Last^.Comments<>nil then
+        Last^.Comments.Clear;
+      Last^.SourcePos:=Cur^.SourcePos;
+      dec(Cur^.SourcePos.Column);
+      Last^.TokenPos:=Cur^.TokenPos;
+      inc(Last^.TokenPos.Column);
+      FTokenRingEnd:=(FTokenRingEnd+1) mod FTokenRingSize;
+      if FTokenRingStart=FTokenRingEnd then
+        FTokenRingStart:=(FTokenRingStart+1) mod FTokenRingSize;
+      FCurToken:=tk1;
+      FCurTokenString:=TokenInfos[tk1];
+    end;
+
 begin
 begin
   //writeln('TPasParser.ChangeToken FTokenBufferSize=',FTokenRingStart,' FTokenBufferIndex=',FTokenRingCur);
   //writeln('TPasParser.ChangeToken FTokenBufferSize=',FTokenRingStart,' FTokenBufferIndex=',FTokenRingCur);
   IsLast:=((FTokenRingCur+1) mod FTokenRingSize)=FTokenRingEnd;
   IsLast:=((FTokenRingCur+1) mod FTokenRingSize)=FTokenRingEnd;
-  if (CurToken=tkshr) and (tk=tkGreaterThan) and IsLast then
+  if (CurToken=tkGreaterEqualThan) and (tk=tkGreaterThan) and IsLast then
     begin
     begin
-    // change last token '>>' into two '>'
-    Cur:=@FTokenRing[FTokenRingCur];
-    Cur^.Token:=tkGreaterThan;
-    Cur^.AsString:='>';
-    Last:=@FTokenRing[FTokenRingEnd];
-    Last^.Token:=tkGreaterThan;
-    Last^.AsString:='>';
-    if Last^.Comments<>nil then
-      Last^.Comments.Clear;
-    Last^.SourcePos:=Cur^.SourcePos;
-    dec(Cur^.SourcePos.Column);
-    Last^.TokenPos:=Cur^.TokenPos;
-    inc(Last^.TokenPos.Column);
-    FTokenRingEnd:=(FTokenRingEnd+1) mod FTokenRingSize;
-    if FTokenRingStart=FTokenRingEnd then
-      FTokenRingStart:=(FTokenRingStart+1) mod FTokenRingSize;
-    FCurToken:=tkGreaterThan;
-    FCurTokenString:='>';
+    DoChange(tkGreaterThan,tkEqual);
+    end
+  else if (CurToken=tkshr) and (tk=tkGreaterThan) and IsLast then
+    begin
+    DoChange(tkGreaterThan,tkGreaterThan);
     end
     end
   else
   else
     CheckToken(tk);
     CheckToken(tk);
@@ -1382,6 +1393,11 @@ begin
     Result:=true;
     Result:=true;
     PTM:=ptmVarargs;
     PTM:=ptmVarargs;
     end
     end
+  else if CompareText(S,ProcTypeModifiers[ptmFar])=0 then
+    begin
+    Result:=true;
+    PTM:=ptmFar;
+    end
   else if CompareText(S,ProcTypeModifiers[ptmStatic])=0 then
   else if CompareText(S,ProcTypeModifiers[ptmStatic])=0 then
     begin
     begin
     Result:=true;
     Result:=true;
@@ -1770,7 +1786,7 @@ begin
   Try
   Try
     // only allowed: ^dottedidentifer
     // only allowed: ^dottedidentifer
     // forbidden: ^^identifier, ^array of word, ^A<B>
     // forbidden: ^^identifier, ^array of word, ^A<B>
-    ExpectIdentifier;
+    ExpectTokens([tkIdentifier,tkFile]);
     Name:=CurTokenString;
     Name:=CurTokenString;
     repeat
     repeat
       NextToken;
       NextToken;
@@ -1782,7 +1798,14 @@ begin
       else
       else
         break;
         break;
     until false;
     until false;
-    UngetToken;
+    if CurToken=tkLessThan then
+      begin
+      Repeat
+        NextToken; // We should do something with this.
+      Until CurToken=tkGreaterThan;
+      end
+    else
+      UngetToken;
     Result.DestType:=ResolveTypeReference(Name,Result);
     Result.DestType:=ResolveTypeReference(Name,Result);
     Engine.FinishScope(stTypeDef,Result);
     Engine.FinishScope(stTypeDef,Result);
     ok:=true;
     ok:=true;
@@ -3605,6 +3628,7 @@ begin
       pt:=GetProcTypeFromToken(CurToken,True);
       pt:=GetProcTypeFromToken(CurToken,True);
       AddProcOrFunction(Declarations,ParseProcedureOrFunctionDecl(Declarations, pt, MustBeGeneric));
       AddProcOrFunction(Declarations,ParseProcedureOrFunctionDecl(Declarations, pt, MustBeGeneric));
       end;
       end;
+    tkAbsolute,
     tkIdentifier:
     tkIdentifier:
       begin
       begin
       Scanner.UnSetTokenOption(toOperatorToken);
       Scanner.UnSetTokenOption(toOperatorToken);
@@ -4196,8 +4220,12 @@ begin
       until CurToken<>tkComma;
       until CurToken<>tkComma;
     Engine.FinishScope(stTypeDef,T);
     Engine.FinishScope(stTypeDef,T);
   until not (CurToken in [tkSemicolon,tkComma]);
   until not (CurToken in [tkSemicolon,tkComma]);
-  if CurToken<>tkGreaterThan then
-    ParseExcExpectedAorB(TokenInfos[tkComma], TokenInfos[tkGreaterThan]);
+  if Not (CurToken in [tkGreaterThan,tkGreaterEqualThan]) then
+    ParseExcExpectedAorB(TokenInfos[tkComma], TokenInfos[tkGreaterThan])
+  else if CurToken=tkGreaterEqualThan then
+    begin
+    ChangeToken(tkGreaterThan);
+    end;
 end;
 end;
 {$warn 5043 on}
 {$warn 5043 on}
 
 
@@ -4549,8 +4577,16 @@ begin
     begin
     begin
     Result:=True;
     Result:=True;
     NextToken;
     NextToken;
-    Location:=ReadDottedIdentifier(Parent,AbsoluteExpr,true);
-    UnGetToken;
+    if Curtoken=tkNumber then
+      begin
+      AbsoluteExpr:=CreatePrimitiveExpr(Parent,pekNumber,CurTokenString);
+      Location:=CurTokenString
+      end
+    else
+      begin
+      Location:=ReadDottedIdentifier(Parent,AbsoluteExpr,true);
+      UnGetToken;
+      end
     end
     end
   else
   else
     UngetToken;
     UngetToken;
@@ -4611,6 +4647,8 @@ begin
     Result := Result + ' ' + CurTokenText;
     Result := Result + ' ' + CurTokenText;
     LibName:=DoParseExpression(Parent);
     LibName:=DoParseExpression(Parent);
     end;
     end;
+  if CurToken=tkSemiColon then
+    exit;
   if not CurTokenIsIdentifier('name') then
   if not CurTokenIsIdentifier('name') then
     ParseExcSyntaxError;
     ParseExcSyntaxError;
   NextToken;
   NextToken;
@@ -5357,8 +5395,8 @@ begin
       begin
       begin
       if IsAnonymous then
       if IsAnonymous then
         CheckToken(tkbegin); // begin expected, but ; found
         CheckToken(tkbegin); // begin expected, but ; found
-      if LastToken=tkSemicolon then
-        ParseExcSyntaxError;
+      // if LastToken=tkSemicolon then
+      //  ParseExcSyntaxError;
       continue;
       continue;
       end
       end
     else if TokenIsCallingConvention(CurTokenString,cc) then
     else if TokenIsCallingConvention(CurTokenString,cc) then
@@ -5373,9 +5411,9 @@ begin
         else
         else
           // remove legacy or basesysv on MorphOS syscalls
           // remove legacy or basesysv on MorphOS syscalls
           begin
           begin
-          if CurTokenIsIdentifier('legacy') or CurTokenIsIdentifier('BaseSysV') then
+          if CurTokenIsIdentifier('legacy') or CurTokenIsIdentifier('consoledevice')
+             or (Curtoken=tkIdentifier) and (Pos('base',LowerCase(CurtokenText))>0) then
             NextToken;
             NextToken;
-          NextToken; // remove offset
           end;
           end;
       end;
       end;
       if IsProcType then
       if IsProcType then
@@ -5391,7 +5429,12 @@ begin
     else if IsAnonymous and TokenIsAnonymousProcedureModifier(Parent,CurTokenString,PM) then
     else if IsAnonymous and TokenIsAnonymousProcedureModifier(Parent,CurTokenString,PM) then
       HandleProcedureModifier(Parent,PM)
       HandleProcedureModifier(Parent,PM)
     else if TokenIsProcedureTypeModifier(Parent,CurTokenString,PTM) then
     else if TokenIsProcedureTypeModifier(Parent,CurTokenString,PTM) then
-      HandleProcedureTypeModifier(Element,PTM)
+      begin
+      HandleProcedureTypeModifier(Element,PTM);
+      // Backwards compatibility
+      if (PTM=ptmFar) and (Parent is TPasProcedure) then
+        (Parent as TPasProcedure).AddModifier(pmFar)
+      end
     else if (not IsProcType) and (not IsAnonymous)
     else if (not IsProcType) and (not IsAnonymous)
         and TokenIsProcedureModifier(Parent,CurTokenString,PM) then
         and TokenIsProcedureModifier(Parent,CurTokenString,PM) then
       HandleProcedureModifier(Parent,PM)
       HandleProcedureModifier(Parent,PM)
@@ -6992,18 +7035,20 @@ begin
   end;
   end;
 end;
 end;
 
 
-Function IsVisibility(S : String;  var AVisibility :TPasMemberVisibility) : Boolean;
+Function IsVisibility(S : String;  var AVisibility :TPasMemberVisibility; IsObjCProtocol : Boolean) : Boolean;
 
 
 Const
 Const
   VNames : array[TPasMemberVisibility] of string =
   VNames : array[TPasMemberVisibility] of string =
-    ('', 'private', 'protected', 'public', 'published', 'automated', '', '');
+    ('', 'private', 'protected', 'public', 'published', 'automated', '', '','required','optional');
+  VLast : Array[Boolean] of TPasMemberVisibility = (visAutomated,visOptional);
+
 Var
 Var
   V : TPasMemberVisibility;
   V : TPasMemberVisibility;
 
 
 begin
 begin
   Result:=False;
   Result:=False;
   S:=lowerCase(S);
   S:=lowerCase(S);
-  For V :=Low(TPasMemberVisibility) to High(TPasMemberVisibility) do
+  For V :=Low(TPasMemberVisibility) to VLast[isObjCProtocol] do
     begin
     begin
     Result:=(VNames[V]<>'') and (S=VNames[V]);
     Result:=(VNames[V]<>'') and (S=VNames[V]);
     if Result then
     if Result then
@@ -7014,8 +7059,7 @@ begin
     end;
     end;
 end;
 end;
 
 
-function TPasParser.CheckVisibility(S: String;
-  var AVisibility: TPasMemberVisibility): Boolean;
+function TPasParser.CheckVisibility(S: String; var AVisibility: TPasMemberVisibility; IsObjCProtocol : Boolean = false): Boolean;
 
 
 Var
 Var
   B : Boolean;
   B : Boolean;
@@ -7028,7 +7072,7 @@ begin
     NextToken;
     NextToken;
     s:=LowerCase(CurTokenString);
     s:=LowerCase(CurTokenString);
     end;
     end;
-  Result:=isVisibility(S,AVisibility);
+  Result:=isVisibility(S,AVisibility,isObjCProtocol);
   if Result then
   if Result then
     begin
     begin
     if (AVisibility=visPublished) and (msOmitRTTI in Scanner.CurrentModeSwitches) then
     if (AVisibility=visPublished) and (msOmitRTTI in Scanner.CurrentModeSwitches) then
@@ -7264,7 +7308,7 @@ begin
           CurSection:=stVar;
           CurSection:=stVar;
         end;
         end;
     tkIdentifier:
     tkIdentifier:
-      if CheckVisibility(CurTokenString,CurVisibility) then
+      if CheckVisibility(CurTokenString,CurVisibility,(AType.ObjKind=okObjcProtocol)) then
         CurSection:=stNone
         CurSection:=stNone
       else
       else
         begin
         begin
@@ -7282,6 +7326,8 @@ begin
           if not (AType.ObjKind in okWithFields) then
           if not (AType.ObjKind in okWithFields) then
             ParseExc(nParserNoFieldsAllowed,SParserNoFieldsAllowedInX,[ObjKindNames[AType.ObjKind]]);
             ParseExc(nParserNoFieldsAllowed,SParserNoFieldsAllowedInX,[ObjKindNames[AType.ObjKind]]);
           ParseClassFields(AType,CurVisibility,CurSection=stClassVar);
           ParseClassFields(AType,CurVisibility,CurSection=stClassVar);
+          if Curtoken=tkEnd then // case Ta = Class x : String end;
+            UngetToken;
           HaveClass:=False;
           HaveClass:=False;
           end;
           end;
         stClassVar:
         stClassVar:
@@ -7433,7 +7479,7 @@ begin
       CheckToken(tkend);
       CheckToken(tkend);
     NextToken;
     NextToken;
     AType.AncestorType := ParseTypeReference(AType,false,Expr);
     AType.AncestorType := ParseTypeReference(AType,false,Expr);
-    if AType.ObjKind in [okClass,okObjCClass] then
+    if AType.ObjKind in [okClass,okObjCClass,okObjcProtocol] then
       while CurToken=tkComma do
       while CurToken=tkComma do
         begin
         begin
         NextToken;
         NextToken;
@@ -7469,7 +7515,7 @@ end;
 function TPasParser.DoParseClassExternalHeader(AObjKind: TPasObjKind; out AExternalNameSpace, AExternalName: string): Boolean;
 function TPasParser.DoParseClassExternalHeader(AObjKind: TPasObjKind; out AExternalNameSpace, AExternalName: string): Boolean;
 begin
 begin
   Result:=False;
   Result:=False;
-  if ((aObjKind in [okObjcCategory,okObjcClass]) or
+  if ((aObjKind in [okObjcCategory,okObjcClass,okObjcProtocol]) or
       ((AObjKind in [okClass,okInterface]) and (msExternalClass in CurrentModeswitches)))
       ((AObjKind in [okClass,okInterface]) and (msExternalClass in CurrentModeswitches)))
       and CurTokenIsIdentifier('external') then
       and CurTokenIsIdentifier('external') then
     begin
     begin
@@ -7481,7 +7527,7 @@ begin
       AExternalNameSpace:=CurTokenString;
       AExternalNameSpace:=CurTokenString;
     if (aObjKind in [okObjcCategory,okObjcClass]) then
     if (aObjKind in [okObjcCategory,okObjcClass]) then
       begin
       begin
-      // Name is optional in objcclass/category
+      // Name is optional in objcclass/category/protocol
       NextToken;
       NextToken;
       if CurToken=tkBraceOpen then
       if CurToken=tkBraceOpen then
         exit;
         exit;

+ 77 - 24
packages/fcl-passrc/src/pscanner.pp

@@ -490,12 +490,15 @@ type
   TBaseFileResolver = class
   TBaseFileResolver = class
   private
   private
     FBaseDirectory: string;
     FBaseDirectory: string;
+    FMode: TModeSwitch;
+    FModuleDirectory: string;
     FResourcePaths,
     FResourcePaths,
     FIncludePaths: TStringList;
     FIncludePaths: TStringList;
     FStrictFileCase : Boolean;
     FStrictFileCase : Boolean;
   Protected
   Protected
     function FindIncludeFileName(const aFilename: string): String; virtual; abstract;
     function FindIncludeFileName(const aFilename: string): String; virtual; abstract;
     procedure SetBaseDirectory(AValue: string); virtual;
     procedure SetBaseDirectory(AValue: string); virtual;
+    procedure SetModuleDirectory(AValue: string); virtual;
     procedure SetStrictFileCase(AValue: Boolean); virtual;
     procedure SetStrictFileCase(AValue: Boolean); virtual;
     Property IncludePaths: TStringList Read FIncludePaths;
     Property IncludePaths: TStringList Read FIncludePaths;
     Property ResourcePaths: TStringList Read FResourcePaths;
     Property ResourcePaths: TStringList Read FResourcePaths;
@@ -507,8 +510,10 @@ type
     function FindResourceFileName(const AName: string): String; virtual; abstract;
     function FindResourceFileName(const AName: string): String; virtual; abstract;
     function FindSourceFile(const AName: string): TLineReader; virtual; abstract;
     function FindSourceFile(const AName: string): TLineReader; virtual; abstract;
     function FindIncludeFile(const AName: string): TLineReader; virtual; abstract;
     function FindIncludeFile(const AName: string): TLineReader; virtual; abstract;
-    Property StrictFileCase : Boolean Read FStrictFileCase Write SetStrictFileCase;
-    property BaseDirectory: string read FBaseDirectory write SetBaseDirectory;
+    property BaseDirectory: string read FBaseDirectory write SetBaseDirectory; // e.g. current path of include file
+    property Mode: TModeSwitch read FMode write FMode;
+    property ModuleDirectory: string read FModuleDirectory write SetModuleDirectory; // e.g. path of module file
+    property StrictFileCase : Boolean Read FStrictFileCase Write SetStrictFileCase;
   end;
   end;
   TBaseFileResolverClass = Class of TBaseFileResolver;
   TBaseFileResolverClass = Class of TBaseFileResolver;
 
 
@@ -821,6 +826,7 @@ type
     procedure HandleWarn(Param: String); virtual;
     procedure HandleWarn(Param: String); virtual;
     procedure HandleWarnIdentifier(Identifier, Value: String); virtual;
     procedure HandleWarnIdentifier(Identifier, Value: String); virtual;
     procedure PushStackItem; virtual;
     procedure PushStackItem; virtual;
+    procedure PopStackItem; virtual;
     function DoFetchTextToken: TToken;
     function DoFetchTextToken: TToken;
     function DoFetchToken: TToken;
     function DoFetchToken: TToken;
     procedure ClearFiles;
     procedure ClearFiles;
@@ -1637,6 +1643,7 @@ begin
   '$':
   '$':
     begin
     begin
     FToken:=tkNumber;
     FToken:=tkNumber;
+    inc(FTokenEnd);
     {$ifdef UsePChar}
     {$ifdef UsePChar}
     while FTokenEnd^ in HexDigits do inc(FTokenEnd);
     while FTokenEnd^ in HexDigits do inc(FTokenEnd);
     {$else}
     {$else}
@@ -2453,22 +2460,30 @@ end;
 
 
 procedure TBaseFileResolver.SetBaseDirectory(AValue: string);
 procedure TBaseFileResolver.SetBaseDirectory(AValue: string);
 begin
 begin
+  AValue:=IncludeTrailingPathDelimiter(AValue);
   if FBaseDirectory=AValue then Exit;
   if FBaseDirectory=AValue then Exit;
   FBaseDirectory:=AValue;
   FBaseDirectory:=AValue;
 end;
 end;
 
 
+procedure TBaseFileResolver.SetModuleDirectory(AValue: string);
+begin
+  AValue:=IncludeTrailingPathDelimiter(AValue);
+  if FModuleDirectory=AValue then Exit;
+  FModuleDirectory:=AValue;
+end;
+
 procedure TBaseFileResolver.SetStrictFileCase(AValue: Boolean);
 procedure TBaseFileResolver.SetStrictFileCase(AValue: Boolean);
 begin
 begin
   if FStrictFileCase=AValue then Exit;
   if FStrictFileCase=AValue then Exit;
   FStrictFileCase:=AValue;
   FStrictFileCase:=AValue;
 end;
 end;
 
 
-
 constructor TBaseFileResolver.Create;
 constructor TBaseFileResolver.Create;
 begin
 begin
   inherited Create;
   inherited Create;
   FIncludePaths := TStringList.Create;
   FIncludePaths := TStringList.Create;
   FResourcePaths := TStringList.Create;
   FResourcePaths := TStringList.Create;
+  FMode:=msFPC;
 end;
 end;
 
 
 destructor TBaseFileResolver.Destroy;
 destructor TBaseFileResolver.Destroy;
@@ -2555,15 +2570,27 @@ function TFileResolver.FindIncludeFileName(const AName: string): String;
 
 
   begin
   begin
     Result:='';
     Result:='';
+    // search in BaseDirectory (not in mode Delphi)
+    if (BaseDirectory<>'')
+        and ((ModuleDirectory='') or not (Mode in [msDelphi,msDelphiUnicode])) then
+      begin
+      Result:=SearchLowUpCase(BaseDirectory+FN);
+      if Result<>'' then exit;
+      end;
+    // search in ModuleDirectory
+    if (ModuleDirectory<>'') then
+      begin
+      Result:=SearchLowUpCase(ModuleDirectory+FN);
+      if Result<>'' then exit;
+      end;
+    // search in include paths
     I:=0;
     I:=0;
-    While (Result='') and (I<FIncludePaths.Count) do
+    While (I<FIncludePaths.Count) do
       begin
       begin
       Result:=SearchLowUpCase(FIncludePaths[i]+FN);
       Result:=SearchLowUpCase(FIncludePaths[i]+FN);
+      if Result<>'' then exit;
       Inc(I);
       Inc(I);
       end;
       end;
-    // search in BaseDirectory
-    if (Result='') and (BaseDirectory<>'') then
-      Result:=SearchLowUpCase(BaseDirectory+FN);
   end;
   end;
 
 
 var
 var
@@ -2757,6 +2784,8 @@ begin
       Inc(J);
       Inc(J);
       end;
       end;
     end;
     end;
+  if (I=-1) and (BaseDirectory<>'') then
+    I:=FStreams.IndexOf(IncludeTrailingPathDelimiter(BaseDirectory)+aName);
   If (I<>-1) then
   If (I<>-1) then
     Result:=FStreams.Objects[i] as TStream;
     Result:=FStreams.Objects[i] as TStream;
 end;
 end;
@@ -2914,13 +2943,21 @@ begin
 end;
 end;
 
 
 procedure TPascalScanner.OpenFile(AFilename: string);
 procedure TPascalScanner.OpenFile(AFilename: string);
+
+Var
+  aPath : String;
+
 begin
 begin
   Clearfiles;
   Clearfiles;
   FCurSourceFile := FileResolver.FindSourceFile(AFilename);
   FCurSourceFile := FileResolver.FindSourceFile(AFilename);
   FCurFilename := AFilename;
   FCurFilename := AFilename;
   AddFile(FCurFilename);
   AddFile(FCurFilename);
   {$IFDEF HASFS}
   {$IFDEF HASFS}
-  FileResolver.BaseDirectory := IncludeTrailingPathDelimiter(ExtractFilePath(FCurFilename));
+  aPath:=ExtractFilePath(FCurFilename);
+  if (aPath<>'') then
+    aPath:=IncludeTrailingPathDelimiter(aPath);
+  FileResolver.ModuleDirectory := aPath;
+  FileResolver.BaseDirectory := aPath;
   {$ENDIF}
   {$ENDIF}
   if LogEvent(sleFile) then
   if LogEvent(sleFile) then
     DoLog(mtInfo,nLogOpeningFile,SLogOpeningFile,[FormatPath(AFileName)],True);
     DoLog(mtInfo,nLogOpeningFile,SLogOpeningFile,[FormatPath(AFileName)],True);
@@ -2970,9 +3007,29 @@ begin
       Result:=tkoperator;
       Result:=tkoperator;
 end;
 end;
 
 
-function TPascalScanner.FetchToken: TToken;
+Procedure TPascalScanner.PopStackItem;
+
 var
 var
   IncludeStackItem: TIncludeStackItem;
   IncludeStackItem: TIncludeStackItem;
+begin
+  IncludeStackItem :=
+    TIncludeStackItem(FIncludeStack[FIncludeStack.Count - 1]);
+  FIncludeStack.Delete(FIncludeStack.Count - 1);
+  CurSourceFile.{$ifdef pas2js}Destroy{$else}Free{$endif};
+  FCurSourceFile := IncludeStackItem.SourceFile;
+  FCurFilename := IncludeStackItem.Filename;
+  FileResolver.BaseDirectory:=ExtractFilePath(FCurFilename);
+  FCurToken := IncludeStackItem.Token;
+  FCurTokenString := IncludeStackItem.TokenString;
+  FCurLine := IncludeStackItem.Line;
+  FCurRow := IncludeStackItem.Row;
+  FCurColumnOffset := IncludeStackItem.ColumnOffset;
+  FTokenPos := IncludeStackItem.TokenPos;
+  IncludeStackItem.Free;
+end;
+
+function TPascalScanner.FetchToken: TToken;
+
 begin
 begin
   FPreviousToken:=FCurToken;
   FPreviousToken:=FCurToken;
   while true do
   while true do
@@ -2983,19 +3040,7 @@ begin
       begin
       begin
       if FIncludeStack.Count > 0 then
       if FIncludeStack.Count > 0 then
         begin
         begin
-        IncludeStackItem :=
-          TIncludeStackItem(FIncludeStack[FIncludeStack.Count - 1]);
-        FIncludeStack.Delete(FIncludeStack.Count - 1);
-        CurSourceFile.{$ifdef pas2js}Destroy{$else}Free{$endif};
-        FCurSourceFile := IncludeStackItem.SourceFile;
-        FCurFilename := IncludeStackItem.Filename;
-        FCurToken := IncludeStackItem.Token;
-        FCurTokenString := IncludeStackItem.TokenString;
-        FCurLine := IncludeStackItem.Line;
-        FCurRow := IncludeStackItem.Row;
-        FCurColumnOffset := IncludeStackItem.ColumnOffset;
-        FTokenPos := IncludeStackItem.TokenPos;
-        IncludeStackItem.Free;
+        PopStackitem;
         Result := FCurToken;
         Result := FCurToken;
         end
         end
       else
       else
@@ -3330,6 +3375,8 @@ procedure TPascalScanner.HandleIncludeFile(Param: String);
 
 
 var
 var
   NewSourceFile: TLineReader;
   NewSourceFile: TLineReader;
+  aFileName : string;
+
 begin
 begin
   Param:=Trim(Param);
   Param:=Trim(Param);
   if Length(Param)>1 then
   if Length(Param)>1 then
@@ -3345,11 +3392,16 @@ begin
   if not Assigned(NewSourceFile) then
   if not Assigned(NewSourceFile) then
     Error(nErrIncludeFileNotFound, SErrIncludeFileNotFound, [Param]);
     Error(nErrIncludeFileNotFound, SErrIncludeFileNotFound, [Param]);
 
 
+
   PushStackItem;
   PushStackItem;
   FCurSourceFile:=NewSourceFile;
   FCurSourceFile:=NewSourceFile;
   FCurFilename := Param;
   FCurFilename := Param;
-  if FCurSourceFile is TFileLineReader then
-    FCurFilename := TFileLineReader(FCurSourceFile).Filename; // nicer error messages
+  if FCurSourceFile is TLineReader then
+    begin
+    aFileName:=TLineReader(FCurSourceFile).Filename;
+    FileResolver.BaseDirectory := ExtractFilePath(aFileName);
+    FCurFilename := aFileName; // nicer error messages
+    end;
   AddFile(FCurFilename);
   AddFile(FCurFilename);
   If LogEvent(sleFile) then
   If LogEvent(sleFile) then
     DoLog(mtInfo,nLogOpeningFile,SLogOpeningFile,[FormatPath(FCurFileName)],True);
     DoLog(mtInfo,nLogOpeningFile,SLogOpeningFile,[FormatPath(FCurFileName)],True);
@@ -3690,6 +3742,7 @@ procedure TPascalScanner.HandleMode(const Param: String);
         SetNonToken(tkotherwise);
         SetNonToken(tkotherwise);
       end;
       end;
     Handled:=false;
     Handled:=false;
+    FileResolver.Mode:=LangMode;
     if Assigned(OnModeChanged) then
     if Assigned(OnModeChanged) then
       OnModeChanged(Self,LangMode,false,Handled);
       OnModeChanged(Self,LangMode,false,Handled);
   end;
   end;

+ 70 - 3
packages/fcl-passrc/tests/tcclasstype.pas

@@ -33,7 +33,7 @@ type
     Procedure StartClass (AncestorName : String = 'TObject'; InterfaceList : String = ''; aClassType : TClassDeclType = cdtClass);
     Procedure StartClass (AncestorName : String = 'TObject'; InterfaceList : String = ''; aClassType : TClassDeclType = cdtClass);
     Procedure StartExternalClass (AParent : String; AExternalName,AExternalNameSpace : String );
     Procedure StartExternalClass (AParent : String; AExternalName,AExternalNameSpace : String );
     Procedure StartClassHelper (ForType : String = 'TOriginal'; AParent : String = 'TObject');
     Procedure StartClassHelper (ForType : String = 'TOriginal'; AParent : String = 'TObject');
-    Procedure StartInterface (AParent : String = 'IInterface'; UUID : String = ''; Disp : Boolean = False; UseObjcClass : Boolean = False);
+    Procedure StartInterface (AParent : String = 'IInterface'; UUID : String = ''; Disp : Boolean = False; UseObjcClass : Boolean = False; UseExternal : Boolean = False);
     Procedure StartRecordHelper (ForType : String = 'TOriginal'; AParent : String = 'TObject');
     Procedure StartRecordHelper (ForType : String = 'TOriginal'; AParent : String = 'TObject');
     Procedure StartVisibility(A : TPasMemberVisibility);
     Procedure StartVisibility(A : TPasMemberVisibility);
     Procedure EndClass(AEnd : String = 'end');
     Procedure EndClass(AEnd : String = 'end');
@@ -105,6 +105,7 @@ type
     Procedure TestMethodWithDotFails;
     Procedure TestMethodWithDotFails;
     Procedure TestMethodWithDotOK;
     Procedure TestMethodWithDotOK;
     Procedure TestMethodFunctionWithDotOK;
     Procedure TestMethodFunctionWithDotOK;
+    Procedure TestNoSemicolon;
     Procedure TestClassMethodSimple;
     Procedure TestClassMethodSimple;
     Procedure TestClassMethodSimpleComment;
     Procedure TestClassMethodSimpleComment;
     Procedure TestConstructor;
     Procedure TestConstructor;
@@ -170,6 +171,10 @@ type
     procedure TestClassHelperOneMethod;
     procedure TestClassHelperOneMethod;
     procedure TestInterfaceEmpty;
     procedure TestInterfaceEmpty;
     procedure TestObjcProtocolEmpty;
     procedure TestObjcProtocolEmpty;
+    procedure TestObjcProtocolEmptyExternal;
+    procedure TestObjcProtocolMultiParent;
+    procedure TestObjcProtocolOptional;
+    procedure TestObjcProtocolRequired;
     procedure TestInterfaceDisp;
     procedure TestInterfaceDisp;
     procedure TestInterfaceParentedEmpty;
     procedure TestInterfaceParentedEmpty;
     procedure TestInterfaceOneMethod;
     procedure TestInterfaceOneMethod;
@@ -320,7 +325,7 @@ begin
 end;
 end;
 
 
 procedure TTestClassType.StartInterface(AParent: String; UUID: String;
 procedure TTestClassType.StartInterface(AParent: String; UUID: String;
-  Disp: Boolean = False; UseObjcClass : Boolean = False);
+  Disp: Boolean = False; UseObjcClass : Boolean = False; UseExternal : Boolean = False);
 Var
 Var
   S : String;
   S : String;
 begin
 begin
@@ -328,7 +333,9 @@ begin
   if UseObjCClass then
   if UseObjCClass then
     begin
     begin
     FDecl.Add('{$modeswitch objectivec1}');
     FDecl.Add('{$modeswitch objectivec1}');
-    S:='TMyClass = objcprotocol'
+    S:='TMyClass = objcprotocol';
+    if UseExternal then
+      S:=S+' external name ''abc'' ';
     end
     end
   else if Disp then
   else if Disp then
     S:='TMyClass = DispInterface'
     S:='TMyClass = DispInterface'
@@ -971,6 +978,13 @@ begin
   AssertNotNull('1 method resolution procedure',TPasMethodResolution(members[0]).ImplementationProc);
   AssertNotNull('1 method resolution procedure',TPasMethodResolution(members[0]).ImplementationProc);
 end;
 end;
 
 
+procedure TTestClassType.TestNoSemicolon;
+begin
+  StartClass;
+  fDecl.Add('Y : String');
+  ParseClass;
+end;
+
 procedure TTestClassType.TestClassMethodSimple;
 procedure TTestClassType.TestClassMethodSimple;
 
 
 begin
 begin
@@ -1929,6 +1943,59 @@ begin
   AssertNull('No UUID',TheClass.GUIDExpr);
   AssertNull('No UUID',TheClass.GUIDExpr);
 end;
 end;
 
 
+procedure TTestClassType.TestObjcProtocolEmptyExternal;
+begin
+  StartInterface('','',False,True,true);
+  EndClass();
+  ParseClass;
+  AssertEquals('Is interface',okObjcProtocol,TheClass.ObjKind);
+  AssertTrue('Is objectivec',TheClass.IsObjCClass);
+  AssertEquals('No members',0,TheClass.Members.Count);
+  AssertNull('No UUID',TheClass.GUIDExpr);
+end;
+
+procedure TTestClassType.TestObjcProtocolMultiParent;
+begin
+  StartInterface('A, B','',False,True,true);
+  FParent:='A';
+  EndClass();
+  ParseClass;
+  AssertEquals('Is interface',okObjcProtocol,TheClass.ObjKind);
+  AssertTrue('Is objectivec',TheClass.IsObjCClass);
+  AssertEquals('No members',0,TheClass.Members.Count);
+  AssertNull('No UUID',TheClass.GUIDExpr);
+  AssertEquals('Have 1 interface',1,TheClass.Interfaces.Count);
+  AssertNotNull('Correct class',TheClass.Interfaces[0]);
+  AssertEquals('Correct class',TPasUnresolvedTypeRef,TObject(TheClass.Interfaces[0]).ClassType);
+  AssertEquals('Interface name','B',TPasUnresolvedTypeRef(TheClass.Interfaces[0]).Name);
+end;
+
+procedure TTestClassType.TestObjcProtocolOptional;
+begin
+  StartInterface('','',False,True);
+  FDecl.Add('    optional');
+  AddMember('Procedure DoSomething(A : Integer)');
+  EndClass();
+  ParseClass;
+  AssertEquals('Is interface',okObjcProtocol,TheClass.ObjKind);
+  AssertTrue('Is objectivec',TheClass.IsObjCClass);
+  AssertEquals('No members',1,TheClass.Members.Count);
+  AssertNull('No UUID',TheClass.GUIDExpr);
+end;
+
+procedure TTestClassType.TestObjcProtocolRequired;
+begin
+  StartInterface('','',False,True);
+  FDecl.Add('    required');
+  AddMember('Procedure DoSomething(A : Integer)');
+  EndClass();
+  ParseClass;
+  AssertEquals('Is interface',okObjcProtocol,TheClass.ObjKind);
+  AssertTrue('Is objectivec',TheClass.IsObjCClass);
+  AssertEquals('No members',1,TheClass.Members.Count);
+  AssertNull('No UUID',TheClass.GUIDExpr);
+end;
+
 procedure TTestClassType.TestInterfaceDisp;
 procedure TTestClassType.TestInterfaceDisp;
 
 
 begin
 begin

+ 25 - 0
packages/fcl-passrc/tests/tcgenerics.pp

@@ -21,6 +21,7 @@ Type
     Procedure TestProcTypeGenerics;
     Procedure TestProcTypeGenerics;
     Procedure TestDeclarationDelphi;
     Procedure TestDeclarationDelphi;
     Procedure TestDeclarationFPC;
     Procedure TestDeclarationFPC;
+    Procedure TestDeclarationFPCNoSpaces;
     Procedure TestMethodImplementation;
     Procedure TestMethodImplementation;
 
 
     // generic constraints
     // generic constraints
@@ -108,6 +109,9 @@ begin
   Source.Add('  TSomeClass<T,T2> = Class(TObject)');
   Source.Add('  TSomeClass<T,T2> = Class(TObject)');
   Source.Add('    b : T;');
   Source.Add('    b : T;');
   Source.Add('    b2 : T2;');
   Source.Add('    b2 : T2;');
+  Source.Add('    FItems: ^TArray<T>;');
+  Source.Add('  type');
+  Source.Add('    TDictionaryEnumerator = TDictionary<T, TEmptyRecord>.TKeyEnumerator;');
   Source.Add('  end;');
   Source.Add('  end;');
   ParseDeclarations;
   ParseDeclarations;
   AssertNotNull('have generic definition',Declarations.Classes);
   AssertNotNull('have generic definition',Declarations.Classes);
@@ -141,6 +145,27 @@ begin
   AssertSame('Parent 1 is class',T,TPasElement(T.GenericTemplateTypes[1]).Parent);
   AssertSame('Parent 1 is class',T,TPasElement(T.GenericTemplateTypes[1]).Parent);
 end;
 end;
 
 
+procedure TTestGenerics.TestDeclarationFPCNoSpaces;
+Var
+  T : TPasClassType;
+begin
+  Scanner.CurrentModeSwitches:=[msDelphi]+Scanner.CurrentModeSwitches;
+  Source.Add('Type');
+  Source.Add('  TSomeClass<T;T2>=Class(TObject)');
+  Source.Add('    b : T;');
+  Source.Add('    b2 : T2;');
+  Source.Add('  end;');
+  ParseDeclarations;
+  AssertNotNull('have generic definition',Declarations.Classes);
+  AssertEquals('have generic definition',1,Declarations.Classes.Count);
+  AssertEquals('Pascal class',TPasClassType,TObject(Declarations.Classes[0]).ClassType);
+  T:=TPasClassType(Declarations.Classes[0]);
+  AssertNotNull('have generic templates',T.GenericTemplateTypes);
+  AssertEquals('2 template types',2,T.GenericTemplateTypes.Count);
+  AssertSame('Parent 0 is class',T,TPasElement(T.GenericTemplateTypes[0]).Parent);
+  AssertSame('Parent 1 is class',T,TPasElement(T.GenericTemplateTypes[1]).Parent);
+end;
+
 procedure TTestGenerics.TestMethodImplementation;
 procedure TTestGenerics.TestMethodImplementation;
 begin
 begin
   With source do
   With source do

+ 14 - 0
packages/fcl-passrc/tests/tconstparser.pas

@@ -43,6 +43,7 @@ Type
     Procedure TestSimpleIdentifierConst;
     Procedure TestSimpleIdentifierConst;
     Procedure TestSimpleSetConst;
     Procedure TestSimpleSetConst;
     Procedure TestSimpleExprConst;
     Procedure TestSimpleExprConst;
+    Procedure TestSimpleAbsoluteConst;
     Procedure TestSimpleIntConstDeprecatedMsg;
     Procedure TestSimpleIntConstDeprecatedMsg;
     Procedure TestSimpleIntConstDeprecated;
     Procedure TestSimpleIntConstDeprecated;
     Procedure TestSimpleFloatConstDeprecated;
     Procedure TestSimpleFloatConstDeprecated;
@@ -255,6 +256,19 @@ begin
   DoTestSimpleExprConst;
   DoTestSimpleExprConst;
 end;
 end;
 
 
+procedure TTestConstParser.TestSimpleAbsoluteConst;
+
+// Found in xi.pp
+
+begin
+  Add('Const');
+  Add('  Absolute = 1;');
+  ParseDeclarations;
+  AssertEquals('One constant definition',1,Declarations.Consts.Count);
+  AssertEquals('First declaration is constant definition.',TPasConst,TObject(Declarations.Consts[0]).ClassType);
+
+end;
+
 procedure TTestConstParser.TestSimpleIntConstDeprecatedMsg;
 procedure TTestConstParser.TestSimpleIntConstDeprecatedMsg;
 begin
 begin
   Hint:='deprecated ''this is old''' ;
   Hint:='deprecated ''this is old''' ;

+ 30 - 2
packages/fcl-passrc/tests/tcprocfunc.pas

@@ -122,6 +122,10 @@ type
     procedure TestCallingConventionSysV_ABI_CDec;
     procedure TestCallingConventionSysV_ABI_CDec;
     procedure TestCallingConventionSysV_ABI_Default;
     procedure TestCallingConventionSysV_ABI_Default;
     procedure TestCallingConventionVectorCall;
     procedure TestCallingConventionVectorCall;
+    procedure TestCallingConventionSysCall;
+    procedure TestCallingConventionSysCallExecbase;
+    procedure TestCallingConventionSysCallUtilitybase;
+    procedure TestCallingConventionSysCallConsoleDevice;
     Procedure TestProcedurePublic;
     Procedure TestProcedurePublic;
     Procedure TestProcedurePublicIdent;
     Procedure TestProcedurePublicIdent;
     Procedure TestFunctionPublic;
     Procedure TestFunctionPublic;
@@ -812,6 +816,30 @@ begin
   AssertProc([],[],ccVectorCall,0);
   AssertProc([],[],ccVectorCall,0);
 end;
 end;
 
 
+procedure TTestProcedureFunction.TestCallingConventionSysCall;
+begin
+  ParseProcedure('; syscall abc');
+  AssertProc([],[],ccSysCall,0);
+end;
+
+procedure TTestProcedureFunction.TestCallingConventionSysCallExecbase;
+begin
+  ParseProcedure('; syscall _execBase 123');
+  AssertProc([],[],ccSysCall,0);
+end;
+
+procedure TTestProcedureFunction.TestCallingConventionSysCallUtilitybase;
+begin
+  ParseProcedure('; syscall _utilityBase 123');
+  AssertProc([],[],ccSysCall,0);
+end;
+
+procedure TTestProcedureFunction.TestCallingConventionSysCallConsoleDevice;
+begin
+  ParseProcedure('; syscall ConsoleDevice 123');
+  AssertProc([],[],ccSysCall,0);
+end;
+
 procedure TTestProcedureFunction.TestCallingConventionHardFloat;
 procedure TTestProcedureFunction.TestCallingConventionHardFloat;
 begin
 begin
   ParseProcedure('; HardFloat');
   ParseProcedure('; HardFloat');
@@ -1005,14 +1033,14 @@ procedure TTestProcedureFunction.TestProcedureFar;
 begin
 begin
   AddDeclaration('procedure A; far;');
   AddDeclaration('procedure A; far;');
   ParseProcedure;
   ParseProcedure;
-  AssertProc([pmfar],[],ccDefault,0);
+  AssertProc([pmfar],[ptmfar],ccDefault,0);
 end;
 end;
 
 
 procedure TTestProcedureFunction.TestFunctionFar;
 procedure TTestProcedureFunction.TestFunctionFar;
 begin
 begin
   AddDeclaration('function A : integer; far;');
   AddDeclaration('function A : integer; far;');
   ParseFunction;
   ParseFunction;
-  AssertFunc([pmfar],[],ccDefault,0);
+  AssertFunc([pmfar],[ptmfar],ccDefault,0);
 end;
 end;
 
 
 procedure TTestProcedureFunction.TestProcedureCdeclForward;
 procedure TTestProcedureFunction.TestProcedureCdeclForward;

+ 25 - 2
packages/fcl-passrc/tests/tcscanner.pas

@@ -57,6 +57,7 @@ type
     FResolver : TStreamResolver;
     FResolver : TStreamResolver;
     FDoCommentCalled : Boolean;
     FDoCommentCalled : Boolean;
     FComment: string;
     FComment: string;
+    FPathPrefix : String;
   protected
   protected
     procedure DoComment(Sender: TObject; aComment: String);
     procedure DoComment(Sender: TObject; aComment: String);
     procedure SetUp; override;
     procedure SetUp; override;
@@ -65,12 +66,15 @@ type
     Procedure AssertEquals(Msg : String; Expected,Actual : TToken); overload;
     Procedure AssertEquals(Msg : String; Expected,Actual : TToken); overload;
     Procedure AssertEquals(Msg : String; Expected,Actual : TModeSwitch); overload;
     Procedure AssertEquals(Msg : String; Expected,Actual : TModeSwitch); overload;
     Procedure AssertEquals(Msg : String; Expected,Actual : TModeSwitches); overload;
     Procedure AssertEquals(Msg : String; Expected,Actual : TModeSwitches); overload;
+    // creates a virtual source file with name 'afile.pp', prepended with PathPrefix
     procedure NewSource(Const Source : string; DoClear : Boolean = True);
     procedure NewSource(Const Source : string; DoClear : Boolean = True);
     Procedure DoTestToken(t : TToken; Const ASource : String; Const CheckEOF : Boolean = True);
     Procedure DoTestToken(t : TToken; Const ASource : String; Const CheckEOF : Boolean = True);
     Procedure TestToken(t : TToken; Const ASource : String; Const CheckEOF : Boolean = True);
     Procedure TestToken(t : TToken; Const ASource : String; Const CheckEOF : Boolean = True);
     Procedure TestTokens(t : array of TToken; Const ASource : String; Const CheckEOF : Boolean = True;Const DoClear : Boolean = True);
     Procedure TestTokens(t : array of TToken; Const ASource : String; Const CheckEOF : Boolean = True;Const DoClear : Boolean = True);
     Property LastIDentifier : String Read FLI Write FLi;
     Property LastIDentifier : String Read FLI Write FLi;
     Property Scanner : TPascalScanner Read FScanner;
     Property Scanner : TPascalScanner Read FScanner;
+    // Path for source filename.
+    Property PathPrefix : String Read FPathPrefix Write FPathPrefix;
   published
   published
     Procedure TestEmpty;
     Procedure TestEmpty;
     procedure TestEOF;
     procedure TestEOF;
@@ -235,6 +239,7 @@ type
     Procedure TestDefine14;
     Procedure TestDefine14;
     Procedure TestInclude;
     Procedure TestInclude;
     Procedure TestInclude2;
     Procedure TestInclude2;
+    Procedure TestInclude3;
     Procedure TestUnDefine1;
     Procedure TestUnDefine1;
     Procedure TestMacro1;
     Procedure TestMacro1;
     procedure TestMacro2;
     procedure TestMacro2;
@@ -444,17 +449,25 @@ begin
 end;
 end;
 
 
 procedure TTestScanner.NewSource(const Source: string; DoClear : Boolean = True);
 procedure TTestScanner.NewSource(const Source: string; DoClear : Boolean = True);
+
+Var
+  aFile : String;
+
 begin
 begin
+  aFile:='';
   if DoClear then
   if DoClear then
     FResolver.Clear;
     FResolver.Clear;
-  FResolver.AddStream('afile.pp',TStringStream.Create(Source));
+  if (FPathPrefix<>'') then
+     aFile:=IncludeTrailingPathDelimiter(FPathPrefix);
+  aFile:=aFile+'afile.pp';
+  FResolver.AddStream(aFile,TStringStream.Create(Source));
   {$ifndef NOCONSOLE} // JC: To get the tests to run with GUI
   {$ifndef NOCONSOLE} // JC: To get the tests to run with GUI
   Writeln('// '+TestName);
   Writeln('// '+TestName);
   Writeln(Source);
   Writeln(Source);
   {$EndIf}
   {$EndIf}
 //  FreeAndNil(FScanner);
 //  FreeAndNil(FScanner);
 //  FScanner:=TTestingPascalScanner.Create(FResolver);
 //  FScanner:=TTestingPascalScanner.Create(FResolver);
-  FScanner.OpenFile('afile.pp');
+  FScanner.OpenFile(aFile);
 end;
 end;
 
 
 procedure TTestScanner.DoTestToken(t: TToken; const ASource: String;
 procedure TTestScanner.DoTestToken(t: TToken; const ASource: String;
@@ -1625,6 +1638,16 @@ begin
   TestTokens([tkIf,tkTrue,tkThen,tkElse],'{$I myinclude.inc} else',True,False);
   TestTokens([tkIf,tkTrue,tkThen,tkElse],'{$I myinclude.inc} else',True,False);
 end;
 end;
 
 
+procedure TTestScanner.TestInclude3;
+begin
+  PathPrefix:='src';
+  FResolver.AddStream('src/myinclude2.inc',TStringStream.Create(' true '));
+  FResolver.AddStream('src/myinclude1.inc',TStringStream.Create('if {$i myinclude2.inc} then '));
+  FScanner.SkipWhiteSpace:=True;
+  FScanner.SkipComments:=True;
+  TestTokens([tkIf,tkTrue,tkThen,tkElse],'{$I src/myinclude1.inc} else',True,False);
+end;
+
 procedure TTestScanner.TestUnDefine1;
 procedure TTestScanner.TestUnDefine1;
 begin
 begin
   FSCanner.Defines.Add('ALWAYS');
   FSCanner.Defines.Add('ALWAYS');

+ 21 - 0
packages/fcl-passrc/tests/tctypeparser.pas

@@ -50,6 +50,7 @@ type
     Procedure DoTestClassOf(Const AHint : string);
     Procedure DoTestClassOf(Const AHint : string);
   Published
   Published
     Procedure TestAliasType;
     Procedure TestAliasType;
+    procedure TestAbsoluteAliasType;
     Procedure TestCrossUnitAliasType;
     Procedure TestCrossUnitAliasType;
     Procedure TestAliasTypeDeprecated;
     Procedure TestAliasTypeDeprecated;
     Procedure TestAliasTypePlatform;
     Procedure TestAliasTypePlatform;
@@ -168,6 +169,7 @@ type
     Procedure TestTypeHelperWithParent;
     Procedure TestTypeHelperWithParent;
     procedure TestPointerReference;
     procedure TestPointerReference;
     Procedure TestPointerKeyWord;
     Procedure TestPointerKeyWord;
+    Procedure TestPointerFile;
   end;
   end;
 
 
   { TTestRecordTypeParser }
   { TTestRecordTypeParser }
@@ -2893,11 +2895,21 @@ begin
 end;
 end;
 
 
 procedure TTestTypeParser.TestAliasType;
 procedure TTestTypeParser.TestAliasType;
+
 begin
 begin
   DoTestAliasType('othertype','');
   DoTestAliasType('othertype','');
   AssertEquals('Unresolved type name ','othertype',TPasUnresolvedTypeRef(TPasAliasType(TheType).DestType).name);
   AssertEquals('Unresolved type name ','othertype',TPasUnresolvedTypeRef(TPasAliasType(TheType).DestType).name);
 end;
 end;
 
 
+procedure TTestTypeParser.TestAbsoluteAliasType;
+begin
+  Add('Type');
+  Add('  Absolute = Integer;');
+  ParseDeclarations;
+  AssertEquals('First declaration is type definition.',TPasAliasType,TPasElement(Declarations.Types[0]).ClassType);
+  AssertEquals('First declaration has correct name.','Absolute',TPasElement(Declarations.Types[0]).Name);
+end;
+
 procedure TTestTypeParser.TestCrossUnitAliasType;
 procedure TTestTypeParser.TestCrossUnitAliasType;
 begin
 begin
   DoTestAliasType('otherunit.othertype','');
   DoTestAliasType('otherunit.othertype','');
@@ -3674,6 +3686,15 @@ begin
   AssertEquals('object definition count',1,Declarations.Classes.Count);
   AssertEquals('object definition count',1,Declarations.Classes.Count);
 end;
 end;
 
 
+procedure TTestTypeParser.TestPointerFile;
+begin
+  Add('type');
+  Add('  pfile = ^file;');
+  ParseDeclarations;
+  AssertEquals('object definition count',1,Declarations.Types.Count);
+end;
+
+
 
 
 initialization
 initialization
   RegisterTests([TTestTypeParser,TTestRecordTypeParser,TTestProcedureTypeParser]);
   RegisterTests([TTestTypeParser,TTestRecordTypeParser,TTestProcedureTypeParser]);

+ 50 - 0
packages/fcl-passrc/tests/tcvarparser.pas

@@ -26,6 +26,7 @@ Type
     Procedure TearDown; override;
     Procedure TearDown; override;
   Published
   Published
     Procedure TestSimpleVar;
     Procedure TestSimpleVar;
+    Procedure TestSimpleVarAbsoluteName;
     Procedure TestSimpleVarHelperName;
     Procedure TestSimpleVarHelperName;
     procedure TestSimpleVarHelperType;
     procedure TestSimpleVarHelperType;
     Procedure TestSimpleVarDeprecated;
     Procedure TestSimpleVarDeprecated;
@@ -34,9 +35,12 @@ Type
     procedure TestSimpleVarInitializedDeprecated;
     procedure TestSimpleVarInitializedDeprecated;
     procedure TestSimpleVarInitializedPlatform;
     procedure TestSimpleVarInitializedPlatform;
     Procedure TestSimpleVarAbsolute;
     Procedure TestSimpleVarAbsolute;
+    Procedure TestSimpleVarAbsoluteAddress;
     Procedure TestSimpleVarAbsoluteDot;
     Procedure TestSimpleVarAbsoluteDot;
     Procedure TestSimpleVarAbsolute2Dots;
     Procedure TestSimpleVarAbsolute2Dots;
     Procedure TestVarProcedure;
     Procedure TestVarProcedure;
+    procedure TestVarProcedureCdecl;
+    procedure TestVarFunctionFar;
     Procedure TestVarFunctionINitialized;
     Procedure TestVarFunctionINitialized;
     Procedure TestVarProcedureDeprecated;
     Procedure TestVarProcedureDeprecated;
     Procedure TestVarRecord;
     Procedure TestVarRecord;
@@ -49,6 +53,7 @@ Type
     Procedure TestVarExternalLib;
     Procedure TestVarExternalLib;
     Procedure TestVarExternalLibName;
     Procedure TestVarExternalLibName;
     procedure TestVarExternalNoSemiColon;
     procedure TestVarExternalNoSemiColon;
+    procedure TestVarExternalLibNoName;
     Procedure TestVarCVar;
     Procedure TestVarCVar;
     Procedure TestVarCVarExternal;
     Procedure TestVarCVarExternal;
     Procedure TestVarPublic;
     Procedure TestVarPublic;
@@ -127,6 +132,21 @@ begin
   AssertVariableType('b');
   AssertVariableType('b');
 end;
 end;
 
 
+procedure TTestVarParser.TestSimpleVarAbsoluteName;
+Var
+  R : TPasVariable;
+
+begin
+  Add('Var');
+  Add('  Absolute : integer;');
+//  Writeln(source.text);
+  ParseDeclarations;
+  AssertEquals('One variable definition',1,Declarations.Variables.Count);
+  AssertEquals('First declaration is type definition.',TPasVariable,TObject(Declarations.Variables[0]).ClassType);
+  R:=TPasVariable(Declarations.Variables[0]);
+  AssertEquals('First declaration has correct name.','Absolute',R.Name);
+end;
+
 procedure TTestVarParser.TestSimpleVarHelperName;
 procedure TTestVarParser.TestSimpleVarHelperName;
 
 
 Var
 Var
@@ -192,6 +212,13 @@ begin
   AssertExpression('correct absolute location',TheVar.AbsoluteExpr,pekIdent,'v');
   AssertExpression('correct absolute location',TheVar.AbsoluteExpr,pekIdent,'v');
 end;
 end;
 
 
+procedure TTestVarParser.TestSimpleVarAbsoluteAddress;
+begin
+  ParseVar('q absolute $123','');
+  AssertVariableType('q');
+  AssertExpression('correct absolute location',TheVar.AbsoluteExpr,pekNumber,'$123');
+end;
+
 procedure TTestVarParser.TestSimpleVarAbsoluteDot;
 procedure TTestVarParser.TestSimpleVarAbsoluteDot;
 var
 var
   B: TBinaryExpr;
   B: TBinaryExpr;
@@ -222,6 +249,18 @@ begin
   AssertVariableType(TPasProcedureType);
   AssertVariableType(TPasProcedureType);
 end;
 end;
 
 
+procedure TTestVarParser.TestVarProcedureCdecl;
+begin
+  ParseVar('procedure; cdecl;','');
+  AssertVariableType(TPasProcedureType);
+end;
+
+procedure TTestVarParser.TestVarFunctionFar;
+begin
+  ParseVar('function (cinfo : j_decompress_ptr) : int; far;','');
+  AssertVariableType(TPasFunctionType);
+end;
+
 procedure TTestVarParser.TestVarFunctionINitialized;
 procedure TTestVarParser.TestVarFunctionINitialized;
 begin
 begin
   ParseVar('function (device: pointer): pointer; cdecl = nil','');
   ParseVar('function (device: pointer): pointer; cdecl = nil','');
@@ -325,6 +364,17 @@ begin
   AssertNotNull('Library symbol',TheVar.ExportName);
   AssertNotNull('Library symbol',TheVar.ExportName);
 end;
 end;
 
 
+
+procedure TTestVarParser.TestVarExternalLibNoName;
+begin
+  // Found in e.g.apache headers
+  ParseVar('integer; external ''mylib''','');
+  AssertEquals('Variable modifiers',[vmexternal],TheVar.VarModifiers);
+  AssertNotNull('Library name',TheVar.LibraryName);
+
+end;
+
+
 procedure TTestVarParser.TestVarExternalLibName;
 procedure TTestVarParser.TestVarExternalLibName;
 begin
 begin
   ParseVar('integer; external ''mylib'' name ''de''','');
   ParseVar('integer; external ''mylib'' name ''de''','');

+ 2 - 2
packages/fcl-pdf/Makefile

@@ -2355,11 +2355,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-process/Makefile

@@ -1503,11 +1503,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-registry/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-registry/tests/Makefile

@@ -1783,11 +1783,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-report/Makefile

@@ -2615,11 +2615,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-res/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-sdo/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 2 - 2
packages/fcl-sound/Makefile

@@ -2189,11 +2189,11 @@ endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
 override FPCOPT+=-XP$(BINUTILSPREFIX)
-endif
-ifneq ($(BINUTILSPREFIX),)
+ifneq ($(RLINKPATH),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSCOMPILE
 ifndef CROSSCOMPILE
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
 override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)

+ 4 - 4
packages/fcl-sound/src/fpwavreader.pas

@@ -97,8 +97,6 @@ begin
   Result := Result and (fmt.ChunkHeader.ID = AUDIO_CHUNK_ID_fmt) and ((fmt.ChunkHeader.Size + 8) >= sizeof(fmt));
   Result := Result and (fmt.ChunkHeader.ID = AUDIO_CHUNK_ID_fmt) and ((fmt.ChunkHeader.Size + 8) >= sizeof(fmt));
   if Result and ((fmt.ChunkHeader.Size + 8) > sizeof(fmt)) then
   if Result and ((fmt.ChunkHeader.Size + 8) > sizeof(fmt)) then
     fStream.Seek((fmt.ChunkHeader.Size + 8) - sizeof(fmt), soCurrent);
     fStream.Seek((fmt.ChunkHeader.Size + 8) - sizeof(fmt), soCurrent);
-  if Result and (fmt.Format <> 1) then 
-    Exit(False);
 end;
 end;
 
 
 function Min(a, b: Integer): Integer;
 function Min(a, b: Integer): Integer;
@@ -123,8 +121,10 @@ begin
       EoF := sz < sizeof(DataChunk);
       EoF := sz < sizeof(DataChunk);
       if not EoF then begin
       if not EoF then begin
         DataChunk.Size := LEtoN(DataChunk.Size);
         DataChunk.Size := LEtoN(DataChunk.Size);
-        if DataChunk.Id <> AUDIO_CHUNK_ID_data then
-          ChunkPos := DataChunk.Size
+        if DataChunk.Id <> AUDIO_CHUNK_ID_data then begin
+          ChunkPos := DataChunk.Size;
+          fstream.Seek(DataChunk.Size, soCurrent);
+        end
         else
         else
           ChunkPos := 0;
           ChunkPos := 0;
       end;
       end;

+ 1 - 1
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16.wav.info.txt

@@ -1 +1 @@
-44100 1 16
+44100 1 16 1

+ 1 - 1
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_16_tag.wav.info.txt

@@ -1 +1 @@
-44100 1 16
+44100 1 16 1

+ 1 - 1
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_24.wav.info.txt

@@ -1 +1 @@
-44100 1 24
+44100 1 24 1

+ 1 - 1
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32.wav.info.txt

@@ -1 +1 @@
-44100 1 32
+44100 1 32 1

BIN
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32float.wav


+ 1 - 0
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32float.wav.info.txt

@@ -0,0 +1 @@
+44100 1 32 3

BIN
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_32float.wav.raw


BIN
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_64float.wav


+ 1 - 0
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_64float.wav.info.txt

@@ -0,0 +1 @@
+44100 1 64 3

BIN
packages/fcl-sound/tests/data/wav/reader/valid/44k_mono_64float.wav.raw


Some files were not shown because too many files changed in this diff