Forráskód Böngészése

Merged revisions 1954-1955,1962-1963,1966-1967,1969,1973,1979,1982,1987-1992,1994-1999,2003-2007,2017,2021,2023,2031-2033,2035,2037,2039-2042,2045-2047,2050,2054-2057,2063,2065-2066,2069,2071-2075,2077-2078,2080-2081,2083,2097-2098,2101,2105-2106,2144-2145,2149,2156-2157,2176,2190,2194-2195,2202,2209-2211,2216,2220,2225-2232,2238 via svnmerge from
http://[email protected]/svn/fpc/trunk

........
r1954 | peter | 2005-12-15 09:58:45 +0100 (Thu, 15 Dec 2005) | 2 lines

* fix sizeof(array of const)

........
r1955 | karoly | 2005-12-15 11:47:14 +0100 (Thu, 15 Dec 2005) | 2 lines

+ Lot of fixes, cleanups and additions for MUI

........
r1962 | florian | 2005-12-15 20:50:58 +0100 (Thu, 15 Dec 2005) | 2 lines

* use 16 byte procedure alignment on windows too

........
r1963 | florian | 2005-12-15 20:51:57 +0100 (Thu, 15 Dec 2005) | 2 lines

+ i386 assembler versions of decr_ansistring and unique_ansistring

........
r1966 | florian | 2005-12-15 23:37:21 +0100 (Thu, 15 Dec 2005) | 2 lines

* optimized generation of fpc_decr_* calls

........
r1967 | florian | 2005-12-15 23:38:11 +0100 (Thu, 15 Dec 2005) | 2 lines

* generate always direct fpc_decr_* calls for strings instead of fpc_finalize

........
r1969 | florian | 2005-12-15 23:55:43 +0100 (Thu, 15 Dec 2005) | 2 lines

* fixed cases

........
r1973 | peter | 2005-12-16 18:19:37 +0100 (Fri, 16 Dec 2005) | 2 lines

* optimize by removing expensive calculations

........
r1979 | joost | 2005-12-18 17:03:34 +0100 (Sun, 18 Dec 2005) | 1 line

+ removed unused libc and libcrypt usage
........
r1982 | tom_at_work | 2005-12-18 22:57:19 +0100 (Sun, 18 Dec 2005) | 2 lines

* new additional C parameter passing test programs
* finally added powerpc64/linux C object files to repository
........
r1987 | peter | 2005-12-19 08:20:01 +0100 (Mon, 19 Dec 2005) | 2 lines

* new .o files

........
r1988 | peter | 2005-12-19 08:35:08 +0100 (Mon, 19 Dec 2005) | 2 lines

* new .o files

........
r1989 | michael | 2005-12-19 09:10:50 +0100 (Mon, 19 Dec 2005) | 1 line

+ Patch from Vincent Snijder to fix multiple content files and use DirectoryExists
........
r1990 | daniel | 2005-12-19 09:21:59 +0100 (Mon, 19 Dec 2005) | 2 lines

* Remove += operators

........
r1991 | jonas | 2005-12-19 12:04:52 +0100 (Mon, 19 Dec 2005) | 2 lines

+ added

........
r1992 | peter | 2005-12-19 13:24:45 +0100 (Mon, 19 Dec 2005) | 2 lines

* refactor reading and setting of parent classes

........
r1994 | peter | 2005-12-20 08:29:12 +0100 (Tue, 20 Dec 2005) | 2 lines

* new test

........
r1995 | peter | 2005-12-20 08:58:38 +0100 (Tue, 20 Dec 2005) | 3 lines

* property index is always a s32int
* property implementations must match parameters equal

........
r1996 | peter | 2005-12-20 08:59:11 +0100 (Tue, 20 Dec 2005) | 2 lines

* support db $01 db $02

........
r1997 | peter | 2005-12-20 09:11:59 +0100 (Tue, 20 Dec 2005) | 2 lines

* remove svn:executable from *.pp and *.pas

........
r1998 | peter | 2005-12-20 10:01:25 +0100 (Tue, 20 Dec 2005) | 2 lines

* set also publishable flag if forward classes are compile within $M+

........
r1999 | peter | 2005-12-20 10:03:43 +0100 (Tue, 20 Dec 2005) | 2 lines

* test for forward class in $M+

........
r2003 | peter | 2005-12-20 11:19:53 +0100 (Tue, 20 Dec 2005) | 2 lines

* fix property mismatch

........
r2004 | peter | 2005-12-20 11:35:08 +0100 (Tue, 20 Dec 2005) | 2 lines

* use NameIndex in GetPropInfos

........
r2005 | peter | 2005-12-20 11:35:53 +0100 (Tue, 20 Dec 2005) | 2 lines

* test also order of properties

........
r2006 | peter | 2005-12-20 11:46:41 +0100 (Tue, 20 Dec 2005) | 2 lines

* renamed to trtti4

........
r2007 | peter | 2005-12-20 15:44:48 +0100 (Tue, 20 Dec 2005) | 2 lines

* write only unique property names in rtti

........
r2017 | florian | 2005-12-20 22:22:06 +0100 (Tue, 20 Dec 2005) | 2 lines

* fixed resetting of ansistrings

........
r2021 | peter | 2005-12-21 12:04:42 +0100 (Wed, 21 Dec 2005) | 2 lines

* don't report name differences after implicit renames

........
r2023 | joost | 2005-12-21 13:33:14 +0100 (Wed, 21 Dec 2005) | 1 line

+ Fixed dyn. loading for mysql 5.0
........
r2031 | florian | 2005-12-22 23:24:02 +0100 (Thu, 22 Dec 2005) | 2 lines

* fixed ie when "converting" double to double and single to single on softemu

........
r2032 | marco | 2005-12-23 10:41:19 +0100 (Fri, 23 Dec 2005) | 2 lines

* removed 255 char limit in extractfilename

........
r2033 | peter | 2005-12-23 11:02:21 +0100 (Fri, 23 Dec 2005) | 2 lines

* remove also 255 limit for ExtractFileExt

........
r2035 | peter | 2005-12-23 15:11:29 +0100 (Fri, 23 Dec 2005) | 2 lines

* fix enum support in vecn in symlists

........
r2037 | jonas | 2005-12-23 21:59:08 +0100 (Fri, 23 Dec 2005) | 3 lines

* changed formal "var" paramters of move, movechar0 and fill* into
"out" parameters to avoid wrong "uninitialized" warnings

........
r2039 | jonas | 2005-12-23 22:20:36 +0100 (Fri, 23 Dec 2005) | 2 lines

+ added

........
r2040 | jonas | 2005-12-23 23:03:21 +0100 (Fri, 23 Dec 2005) | 2 lines

* frexp has out instead of var parameter

........
r2041 | jonas | 2005-12-23 23:25:26 +0100 (Fri, 23 Dec 2005) | 4 lines

* several changes of var parameters into out parameters to avoid
useless warnings: code parameter of val(), destination of str(),
destinations of ansi2wide and wide2ansi

........
r2042 | jonas | 2005-12-23 23:49:15 +0100 (Fri, 23 Dec 2005) | 2 lines

+ support for "return x" as equivalent for "exit(x)" in macpas mode

........
r2045 | jonas | 2005-12-24 02:06:05 +0100 (Sat, 24 Dec 2005) | 3 lines

* reverted r2037 because of braindead "out" semantics for refcounted
types

........
r2046 | jonas | 2005-12-24 02:40:23 +0100 (Sat, 24 Dec 2005) | 3 lines

- reverted ansi2wide and wide2ansi changes, because they affect
third party sources too much

........
r2047 | florian | 2005-12-24 18:43:57 +0100 (Sat, 24 Dec 2005) | 2 lines

* fixed handling of doubles in softemu mode if they are split between register and memory

........
r2050 | peter | 2005-12-25 12:08:23 +0100 (Sun, 25 Dec 2005) | 2 lines

* blksze to blksize

........
r2054 | jonas | 2005-12-26 16:32:40 +0100 (Mon, 26 Dec 2005) | 2 lines

* fixed used of uninitialized variable in VariantToSingle()

........
r2055 | jonas | 2005-12-26 16:52:57 +0100 (Mon, 26 Dec 2005) | 2 lines

* set result of SetPrecisionMode()

........
r2056 | jonas | 2005-12-26 17:01:13 +0100 (Mon, 26 Dec 2005) | 2 lines

- removed unused local conflicting type definition

........
r2057 | oro06 | 2005-12-26 18:58:02 +0100 (Mon, 26 Dec 2005) | 3 lines

+arm/wince more fcl unit : syncobjs


........
r2063 | florian | 2005-12-27 11:41:42 +0100 (Tue, 27 Dec 2005) | 2 lines

* fixed sparc building

........
r2065 | oro06 | 2005-12-27 16:37:15 +0100 (Tue, 27 Dec 2005) | 4 lines

+arm/wince more rtl units : winsock, sockets
+arm/wince more fcl units : resolve, ssockets


........
r2066 | oro06 | 2005-12-27 17:40:56 +0100 (Tue, 27 Dec 2005) | 3 lines

+arm/wince more db, extrapackages


........
r2069 | oro06 | 2005-12-28 10:27:43 +0100 (Wed, 28 Dec 2005) | 3 lines

*arm/wince basepackages


........
r2071 | florian | 2005-12-29 15:36:22 +0100 (Thu, 29 Dec 2005) | 2 lines

* graph and ggigraph unit moved to packages/base

........
r2072 | florian | 2005-12-29 15:41:10 +0100 (Thu, 29 Dec 2005) | 2 lines

+ added missing Makefile

........
r2073 | florian | 2005-12-29 15:48:19 +0100 (Thu, 29 Dec 2005) | 2 lines

* fixed win32 makefile

........
r2074 | florian | 2005-12-29 15:53:59 +0100 (Thu, 29 Dec 2005) | 2 lines

* rebuild Makefile

........
r2075 | florian | 2005-12-29 16:03:58 +0100 (Thu, 29 Dec 2005) | 2 lines

* fixed pathes on win32

........
r2077 | hajny | 2005-12-29 16:56:13 +0100 (Thu, 29 Dec 2005) | 1 line

* backward search hopefully fixed
........
r2078 | oro06 | 2005-12-29 17:07:01 +0100 (Thu, 29 Dec 2005) | 4 lines

*preprocessor can't read files with proc/func declaration



........
r2080 | daniel | 2005-12-30 10:19:23 +0100 (Fri, 30 Dec 2005) | 3 lines

* remove command about quotes in array version of executeprocess, which doesn't
apply there

........
r2081 | florian | 2005-12-30 13:28:08 +0100 (Fri, 30 Dec 2005) | 2 lines

* graph is only built on i386 on linux

........
r2083 | marco | 2005-12-30 19:58:57 +0100 (Fri, 30 Dec 2005) | 2 lines

* setsockopt detail bug

........
r2097 | marco | 2005-12-31 16:39:35 +0100 (Sat, 31 Dec 2005) | 2 lines

* fixed FreeBSD 6 cprt0.as Use -Xf from now on.

........
r2098 | marco | 2005-12-31 16:40:19 +0100 (Sat, 31 Dec 2005) | 2 lines

* Indy fix (freeonterminate workaround)

........
r2101 | florian | 2006-01-01 13:41:39 +0100 (Sun, 01 Jan 2006) | 2 lines

+ new cpus/fpus added

........
r2105 | jonas | 2006-01-01 18:02:34 +0100 (Sun, 01 Jan 2006) | 2 lines

* keep upper bound of loops in a register instead of in memory

........
r2106 | jonas | 2006-01-01 18:42:58 +0100 (Sun, 01 Jan 2006) | 2 lines

- removed code commented out in previous commit

........
r2144 | tom_at_work | 2006-01-03 22:14:45 +0100 (Tue, 03 Jan 2006) | 1 line

* added support for 64 bit integers in variant comparison code, fixes tw2763 on 64 bit platforms
........
r2145 | tom_at_work | 2006-01-03 22:17:36 +0100 (Tue, 03 Jan 2006) | 1 line

* disable tw3893 for 64 bit cpus because it tests some 32 bit specific casting
........
r2149 | daniel | 2006-01-04 00:11:28 +0100 (Wed, 04 Jan 2006) | 3 lines

* Enable recognition of property keyword in all modes now that
they are allowed for objects

........
r2156 | jonas | 2006-01-04 13:07:21 +0100 (Wed, 04 Jan 2006) | 2 lines

* also return 0 when reading an unsigned integer at the end of a file

........
r2157 | jonas | 2006-01-04 13:12:58 +0100 (Wed, 04 Jan 2006) | 2 lines

+ added

........
r2176 | jonas | 2006-01-05 11:10:25 +0100 (Thu, 05 Jan 2006) | 2 lines

* made some Tcpuregisterset parameters const to avoid useless copying

........
r2190 | jonas | 2006-01-05 21:46:20 +0100 (Thu, 05 Jan 2006) | 3 lines

* don't move addresses in a LOC_CREGISTER to another register for
derefnodes

........
r2194 | jonas | 2006-01-06 13:08:43 +0100 (Fri, 06 Jan 2006) | 4 lines

* don't give an IE with extdebug on darwin if a symbol is "re-allocated"
with a wrong type, because we can't know the type of a symbol in the
CG

........
r2195 | karoly | 2006-01-06 15:21:51 +0100 (Fri, 06 Jan 2006) | 3 lines

- fixed system.chdir() to properly return error
+ better, more Amigaish sysutils.DirectoryExists() implementation

........
r2202 | daniel | 2006-01-07 09:43:34 +0100 (Sat, 07 Jan 2006) | 2 lines

* Add extra check for owner of tty

........
r2209 | jonas | 2006-01-07 17:36:04 +0100 (Sat, 07 Jan 2006) | 2 lines

* changed min and max so more efficient code is generated for them

........
r2210 | marco | 2006-01-07 19:41:15 +0100 (Sat, 07 Jan 2006) | 2 lines

* Ales Katona's errors patch

........
r2211 | florian | 2006-01-07 22:10:39 +0100 (Sat, 07 Jan 2006) | 2 lines

* fixed refs book keeping

........
r2216 | jonas | 2006-01-08 09:21:15 +0100 (Sun, 08 Jan 2006) | 2 lines

* added missing ","

........
r2220 | florian | 2006-01-08 13:02:57 +0100 (Sun, 08 Jan 2006) | 2 lines

* fixed (hopefully) problem with dependencies

........
r2225 | jonas | 2006-01-08 16:50:14 +0100 (Sun, 08 Jan 2006) | 2 lines

* fixed refs bookkeeping of jump labels (fix from Florian in popt386)

........
r2226 | florian | 2006-01-08 16:52:30 +0100 (Sun, 08 Jan 2006) | 2 lines

+ added option -i<path> for input path

........
r2227 | florian | 2006-01-08 16:52:43 +0100 (Sun, 08 Jan 2006) | 2 lines

+ make shared

........
r2228 | florian | 2006-01-08 16:56:31 +0100 (Sun, 08 Jan 2006) | 2 lines

* make shared support

........
r2229 | florian | 2006-01-08 17:25:41 +0100 (Sun, 08 Jan 2006) | 2 lines

* regenerated

........
r2230 | florian | 2006-01-08 17:26:07 +0100 (Sun, 08 Jan 2006) | 2 lines

* more shared stuff, still not perfect

........
r2231 | florian | 2006-01-08 17:28:32 +0100 (Sun, 08 Jan 2006) | 2 lines

* comment patch by Vincent Snijders

........
r2232 | tom_at_work | 2006-01-08 19:01:34 +0100 (Sun, 08 Jan 2006) | 1 line

* removed hexstr(), already in RTL (and even supports 64 bit integers)
........
r2238 | hajny | 2006-01-09 03:52:55 +0100 (Mon, 09 Jan 2006) | 1 line

* fix for web bug #4182
........

git-svn-id: branches/fixes_2_0@2248 -

peter 19 éve
szülő
commit
94052210ca
100 módosított fájl, 6002 hozzáadás és 3021 törlés
  1. 57 18
      .gitattributes
  2. 7 7
      .gitignore
  3. 2 1
      compiler/aasmbase.pas
  4. 5 1
      compiler/aoptobj.pas
  5. 13 0
      compiler/cgbase.pas
  6. 27 13
      compiler/cgobj.pas
  7. 12 46
      compiler/cutils.pas
  8. 10 6
      compiler/i386/cpuinfo.pas
  9. 1 0
      compiler/i386/cpuswtch.pas
  10. 5 1
      compiler/i386/popt386.pas
  11. 17 1
      compiler/i386/ra386int.pas
  12. 4 8
      compiler/ncgflw.pas
  13. 1 1
      compiler/ncgmem.pas
  14. 10 1
      compiler/ncnv.pas
  15. 35 8
      compiler/nutils.pas
  16. 192 193
      compiler/pdecobj.pas
  17. 13 9
      compiler/pdecsub.pas
  18. 13 9
      compiler/pdecvar.pas
  19. 9 3
      compiler/pexpr.pas
  20. 26 25
      compiler/ptype.pas
  21. 4 4
      compiler/rgobj.pas
  22. 2 1
      compiler/symconst.pas
  23. 153 179
      compiler/symdef.pas
  24. 1 0
      compiler/symtable.pas
  25. 12 9
      compiler/symtype.pas
  26. 2 4
      compiler/systems/t_go32v2.pas
  27. 2 0
      compiler/tokens.pas
  28. 13 8
      compiler/utils/ppumove.pp
  29. 4 4
      compiler/x86/cgx86.pas
  30. 48 7
      fcl/Makefile
  31. 3 1
      fcl/Makefile.fpc
  32. 51 4
      fcl/db/Makefile
  33. 1 0
      fcl/db/Makefile.fpc
  34. 55 2
      fcl/db/sqldb/Makefile
  35. 1 0
      fcl/db/sqldb/Makefile.fpc
  36. 8 8
      fcl/inc/contnrs.pp
  37. 7 7
      ide/weditor.pas
  38. 114 16
      packages/base/Makefile
  39. 5 4
      packages/base/Makefile.fpc
  40. 2180 0
      packages/base/graph/Makefile
  41. 89 0
      packages/base/graph/Makefile.fpc
  42. 0 0
      packages/base/graph/amiga/graph.pp
  43. 0 0
      packages/base/graph/go32v2/graph.pp
  44. 0 0
      packages/base/graph/inc/clip.inc
  45. 0 0
      packages/base/graph/inc/fills.inc
  46. 0 0
      packages/base/graph/inc/fontdata.inc
  47. 0 0
      packages/base/graph/inc/graph.inc
  48. 0 0
      packages/base/graph/inc/graph.tex
  49. 0 0
      packages/base/graph/inc/graphh.inc
  50. 0 0
      packages/base/graph/inc/gtext.inc
  51. 0 0
      packages/base/graph/inc/makefile.inc
  52. 0 0
      packages/base/graph/inc/modes.inc
  53. 0 0
      packages/base/graph/inc/palette.inc
  54. 0 0
      packages/base/graph/unix/ggigraph.pp
  55. 0 0
      packages/base/graph/unix/graph.pp
  56. 0 0
      packages/base/graph/unix/graph16.inc
  57. 0 0
      packages/base/graph/win32/graph.pp
  58. 0 0
      packages/base/graph/win32/wincrt.pp
  59. 0 0
      packages/base/graph/win32/winmouse.pp
  60. 6 2
      packages/base/ibase/ibase60.inc
  61. 2 2
      packages/base/mysql/mysql.inc
  62. 4 0
      packages/base/postgres/dllistdyn.pp
  63. 79 158
      packages/extra/Makefile
  64. 1 0
      packages/extra/Makefile.fpc
  65. 74 40
      rtl/amiga/Makefile
  66. 1 26
      rtl/amiga/Makefile.fpc
  67. 125 0
      rtl/darwin/errnostr.inc
  68. 38 12
      rtl/freebsd/Makefile
  69. 1 23
      rtl/freebsd/Makefile.fpc
  70. 122 0
      rtl/freebsd/errnostr.inc
  71. 46 20
      rtl/freebsd/i386/cprt0.as
  72. 1 1
      rtl/freebsd/tthread.inc
  73. 1 1
      rtl/freebsd/unixsock.inc
  74. 74 45
      rtl/go32v2/Makefile
  75. 1 10
      rtl/go32v2/Makefile.fpc
  76. 133 45
      rtl/i386/i386.inc
  77. 40 35
      rtl/inc/astrings.inc
  78. 14 14
      rtl/inc/cgeneric.inc
  79. 2 2
      rtl/inc/cgenmath.inc
  80. 38 38
      rtl/inc/compproc.inc
  81. 4 4
      rtl/inc/generic.inc
  82. 1 1
      rtl/inc/genmath.inc
  83. 219 276
      rtl/inc/heap.inc
  84. 0 3
      rtl/inc/objpas.inc
  85. 5 2
      rtl/inc/objpash.inc
  86. 1 1
      rtl/inc/real2str.inc
  87. 17 17
      rtl/inc/sstrings.inc
  88. 8 3
      rtl/inc/text.inc
  89. 2 2
      rtl/inc/wstringh.inc
  90. 12 12
      rtl/inc/wstrings.inc
  91. 187 58
      rtl/linux/Makefile
  92. 9 42
      rtl/linux/Makefile.fpc
  93. 149 0
      rtl/linux/errnostr.inc
  94. 4 4
      rtl/linux/i386/stat.inc
  95. 2 2
      rtl/linux/m68k/stat.inc
  96. 1 1
      rtl/linux/x86_64/stat.inc
  97. 1341 1499
      rtl/morphos/mui.pas
  98. 2 0
      rtl/morphos/sysdir.inc
  99. 21 7
      rtl/morphos/sysutils.pp
  100. 0 4
      rtl/objpas/cvarutil.inc

+ 57 - 18
.gitattributes

@@ -1116,6 +1116,26 @@ packages/base/gdbint/gdbobjs.inc svneol=native#text/plain
 packages/base/gdbint/gdbver.pp svneol=native#text/plain
 packages/base/gdbint/symify.pp svneol=native#text/plain
 packages/base/gdbint/testgdb.pp svneol=native#text/plain
+packages/base/graph/Makefile -text
+packages/base/graph/Makefile.fpc svneol=native#text/plain
+packages/base/graph/amiga/graph.pp svneol=native#text/plain
+packages/base/graph/go32v2/graph.pp svneol=native#text/plain
+packages/base/graph/inc/clip.inc svneol=native#text/plain
+packages/base/graph/inc/fills.inc svneol=native#text/plain
+packages/base/graph/inc/fontdata.inc svneol=native#text/plain
+packages/base/graph/inc/graph.inc svneol=native#text/plain
+packages/base/graph/inc/graph.tex -text
+packages/base/graph/inc/graphh.inc svneol=native#text/plain
+packages/base/graph/inc/gtext.inc svneol=native#text/plain
+packages/base/graph/inc/makefile.inc svneol=native#text/plain
+packages/base/graph/inc/modes.inc svneol=native#text/plain
+packages/base/graph/inc/palette.inc svneol=native#text/plain
+packages/base/graph/unix/ggigraph.pp svneol=native#text/plain
+packages/base/graph/unix/graph.pp svneol=native#text/plain
+packages/base/graph/unix/graph16.inc svneol=native#text/plain
+packages/base/graph/win32/graph.pp svneol=native#text/plain
+packages/base/graph/win32/wincrt.pp svneol=native#text/plain
+packages/base/graph/win32/winmouse.pp svneol=native#text/plain
 packages/base/hash/Makefile svneol=native#text/plain
 packages/base/hash/Makefile.fpc svneol=native#text/plain
 packages/base/hash/crc.pas -text
@@ -3348,7 +3368,6 @@ rtl/amiga/Makefile svneol=native#text/plain
 rtl/amiga/Makefile.fpc svneol=native#text/plain
 rtl/amiga/crt.pp svneol=native#text/plain
 rtl/amiga/dos.pp svneol=native#text/plain
-rtl/amiga/graph.pp svneol=native#text/plain
 rtl/amiga/os.inc svneol=native#text/plain
 rtl/amiga/printer.pp svneol=native#text/plain
 rtl/amiga/prt0.as -text
@@ -3422,6 +3441,7 @@ rtl/darwin/Makefile svneol=native#text/plain
 rtl/darwin/Makefile.fpc svneol=native#text/plain
 rtl/darwin/console.pp svneol=native#text/plain
 rtl/darwin/errno.inc svneol=native#text/plain
+rtl/darwin/errnostr.inc -text
 rtl/darwin/pmutext.inc svneol=native#text/plain
 rtl/darwin/powerpc/sig_cpu.inc svneol=native#text/plain
 rtl/darwin/powerpc/sighnd.inc svneol=native#text/plain
@@ -3460,6 +3480,7 @@ rtl/freebsd/Makefile.fpc svneol=native#text/plain
 rtl/freebsd/bsdport.txt svneol=native#text/plain
 rtl/freebsd/console.pp svneol=native#text/plain
 rtl/freebsd/errno.inc svneol=native#text/plain
+rtl/freebsd/errnostr.inc -text
 rtl/freebsd/i386/bsyscall.inc svneol=native#text/plain
 rtl/freebsd/i386/cprt0.as -text
 rtl/freebsd/i386/gprt0.as -text
@@ -3499,7 +3520,6 @@ rtl/go32v2/exit16.ah -text
 rtl/go32v2/exit16.asm -text
 rtl/go32v2/fpu.as -text
 rtl/go32v2/go32.pp svneol=native#text/plain
-rtl/go32v2/graph.pp svneol=native#text/plain
 rtl/go32v2/initc.pp svneol=native#text/plain
 rtl/go32v2/keyboard.pp svneol=native#text/plain
 rtl/go32v2/mouse.pp svneol=native#text/plain
@@ -3569,16 +3589,6 @@ rtl/inc/genset.inc svneol=native#text/plain
 rtl/inc/genstr.inc svneol=native#text/plain
 rtl/inc/genstrs.inc svneol=native#text/plain
 rtl/inc/getopts.pp svneol=native#text/plain
-rtl/inc/graph/clip.inc svneol=native#text/plain
-rtl/inc/graph/fills.inc svneol=native#text/plain
-rtl/inc/graph/fontdata.inc svneol=native#text/plain
-rtl/inc/graph/graph.inc svneol=native#text/plain
-rtl/inc/graph/graph.tex -text
-rtl/inc/graph/graphh.inc svneol=native#text/plain
-rtl/inc/graph/gtext.inc svneol=native#text/plain
-rtl/inc/graph/makefile.inc svneol=native#text/plain
-rtl/inc/graph/modes.inc svneol=native#text/plain
-rtl/inc/graph/palette.inc svneol=native#text/plain
 rtl/inc/heap.inc svneol=native#text/plain
 rtl/inc/heaph.inc svneol=native#text/plain
 rtl/inc/heaptrc.pp svneol=native#text/plain
@@ -3648,6 +3658,7 @@ rtl/linux/arm/syscallh.inc svneol=native#text/plain
 rtl/linux/arm/sysnr.inc svneol=native#text/plain
 rtl/linux/bunxsysc.inc svneol=native#text/plain
 rtl/linux/errno.inc svneol=native#text/plain
+rtl/linux/errnostr.inc -text
 rtl/linux/fpcylix.pp svneol=native#text/plain
 rtl/linux/gpm.pp svneol=native#text/plain
 rtl/linux/i386/bsyscall.inc svneol=native#text/plain
@@ -4200,9 +4211,6 @@ rtl/unix/errors.pp svneol=native#text/plain
 rtl/unix/genfdset.inc svneol=native#text/plain
 rtl/unix/genfuncs.inc svneol=native#text/plain
 rtl/unix/gensigset.inc svneol=native#text/plain
-rtl/unix/ggigraph.pp svneol=native#text/plain
-rtl/unix/graph.pp svneol=native#text/plain
-rtl/unix/graph16.inc svneol=native#text/plain
 rtl/unix/initc.pp svneol=native#text/plain
 rtl/unix/ipc.pp svneol=native#text/plain
 rtl/unix/ipccdecl.inc svneol=native#text/plain
@@ -4255,7 +4263,6 @@ rtl/win32/crt.pp svneol=native#text/plain
 rtl/win32/dos.pp svneol=native#text/plain
 rtl/win32/dynlibs.inc svneol=native#text/plain
 rtl/win32/gprt0.as -text
-rtl/win32/graph.pp svneol=native#text/plain
 rtl/win32/initc.pp svneol=native#text/plain
 rtl/win32/keyboard.pp svneol=native#text/plain
 rtl/win32/messages.pp svneol=native#text/plain
@@ -4280,7 +4287,6 @@ rtl/win32/wcygprt0.as -text
 rtl/win32/wdllprt0.as -text
 rtl/win32/win32.inc svneol=native#text/plain
 rtl/win32/win32res.inc svneol=native#text/plain
-rtl/win32/wincrt.pp svneol=native#text/plain
 rtl/win32/windows.pp svneol=native#text/plain
 rtl/win32/winevent.pp svneol=native#text/plain
 rtl/win32/wininc/Makefile svneol=native#text/plain
@@ -4298,7 +4304,6 @@ rtl/win32/wininc/struct.inc svneol=native#text/plain
 rtl/win32/wininc/unidef.inc svneol=native#text/plain
 rtl/win32/wininc/unidef.sed -text
 rtl/win32/wininc/unifun.inc svneol=native#text/plain
-rtl/win32/winmouse.pp svneol=native#text/plain
 rtl/win32/winsock.pp svneol=native#text/plain
 rtl/win32/winsysut.pp svneol=native#text/plain
 rtl/win32/wprt0.as -text
@@ -5047,6 +5052,7 @@ tests/tbs/tb0496.pp svneol=native#text/plain
 tests/tbs/tb0497a.pp -text
 tests/tbs/tb0497b.pp -text
 tests/tbs/tb0497c.pp -text
+tests/tbs/tb0498.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain
@@ -5091,19 +5097,32 @@ tests/test/cg/cdecl/taoc6.pp svneol=native#text/plain
 tests/test/cg/obj/amiga/m68k/ctest.o -text
 tests/test/cg/obj/ctest.c -text
 tests/test/cg/obj/darwin/powerpc/ctest.o -text
+tests/test/cg/obj/darwin/powerpc/tcext3.o -text
+tests/test/cg/obj/darwin/powerpc/tcext4.o -text
 tests/test/cg/obj/freebsd/i386/ctest.o -text
 tests/test/cg/obj/go32v2/i386/ctest.o -text
 tests/test/cg/obj/linux/arm/ctest.o -text
 tests/test/cg/obj/linux/i386/ctest.o -text
+tests/test/cg/obj/linux/i386/tcext3.o -text
+tests/test/cg/obj/linux/i386/tcext4.o -text
 tests/test/cg/obj/linux/m68k/ctest.o -text
 tests/test/cg/obj/linux/powerpc/ctest.o -text
+tests/test/cg/obj/linux/powerpc/tcext3.o -text
+tests/test/cg/obj/linux/powerpc/tcext4.o -text
+tests/test/cg/obj/linux/powerpc64/ctest.o -text
+tests/test/cg/obj/linux/powerpc64/tcext3.o -text
+tests/test/cg/obj/linux/powerpc64/tcext4.o -text
 tests/test/cg/obj/linux/sparc/ctest.o -text
 tests/test/cg/obj/linux/x86_64/ctest.o -text
 tests/test/cg/obj/macos/powerpc/ctest.o -text
 tests/test/cg/obj/netbsd/m68k/ctest.o -text
 tests/test/cg/obj/os2/i386/ctest.o -text
 tests/test/cg/obj/readme.txt svneol=native#text/plain
+tests/test/cg/obj/tcext3.c -text
+tests/test/cg/obj/tcext4.c -text
 tests/test/cg/obj/win32/i386/ctest.o -text
+tests/test/cg/obj/win32/i386/tcext3.o -text
+tests/test/cg/obj/win32/i386/tcext4.o -text
 tests/test/cg/ptest.pp svneol=native#text/plain
 tests/test/cg/taddbool.pp svneol=native#text/plain
 tests/test/cg/taddcard.pp svneol=native#text/plain
@@ -5131,6 +5150,8 @@ tests/test/cg/tcalcst8.pp svneol=native#text/plain
 tests/test/cg/tcalcst9.pp svneol=native#text/plain
 tests/test/cg/tcalext.pp svneol=native#text/plain
 tests/test/cg/tcalext2.pp svneol=native#text/plain
+tests/test/cg/tcalext3.pp -text
+tests/test/cg/tcalext4.pp -text
 tests/test/cg/tcalfun1.pp svneol=native#text/plain
 tests/test/cg/tcalfun2.pp svneol=native#text/plain
 tests/test/cg/tcalfun3.pp svneol=native#text/plain
@@ -5360,6 +5381,8 @@ tests/test/tresstr.pp svneol=native#text/plain
 tests/test/trtti1.pp svneol=native#text/plain
 tests/test/trtti2.pp svneol=native#text/plain
 tests/test/trtti3.pp svneol=native#text/plain
+tests/test/trtti4.pp svneol=native#text/plain
+tests/test/trtti5.pp svneol=native#text/plain
 tests/test/tset1.pp svneol=native#text/plain
 tests/test/tset2.pp svneol=native#text/plain
 tests/test/tstack.pp svneol=native#text/plain
@@ -5633,6 +5656,14 @@ tests/webtbf/tw4256.pp svneol=native#text/plain
 tests/webtbf/tw4359.pp svneol=native#text/plain
 tests/webtbf/tw4445.pp svneol=native#text/plain
 tests/webtbf/tw4529.pp svneol=native#text/plain
+tests/webtbf/tw4554a.pp svneol=native#text/plain
+tests/webtbf/tw4554b.pp svneol=native#text/plain
+tests/webtbf/tw4554c.pp svneol=native#text/plain
+tests/webtbf/tw4554d.pp svneol=native#text/plain
+tests/webtbf/tw4569a.pp svneol=native#text/plain
+tests/webtbf/tw4569b.pp svneol=native#text/plain
+tests/webtbf/tw4619a.pp -text svneol=unset#text/plain
+tests/webtbf/tw4619b.pp svneol=native#text/plain
 tests/webtbf/tw4647.pp svneol=native#text/plain
 tests/webtbf/tw4651.pp svneol=native#text/plain
 tests/webtbf/uw0744.pp svneol=native#text/plain
@@ -6294,6 +6325,7 @@ tests/webtbs/tw4100.pp svneol=native#text/plain
 tests/webtbs/tw4104.pp svneol=native#text/plain
 tests/webtbs/tw4115.pp svneol=native#text/plain
 tests/webtbs/tw4119.pp svneol=native#text/plain
+tests/webtbs/tw4136.pp svneol=native#text/plain
 tests/webtbs/tw4140.pp svneol=native#text/plain
 tests/webtbs/tw4150.pp svneol=native#text/plain
 tests/webtbs/tw4151.pp svneol=native#text/plain
@@ -6351,7 +6383,14 @@ tests/webtbs/tw4540.pp -text svneol=unset#text/plain
 tests/webtbs/tw4557.pp svneol=native#text/plain
 tests/webtbs/tw4566.pp -text svneol=unset#text/plain
 tests/webtbs/tw4574.pp svneol=native#text/plain
+tests/webtbs/tw4599.pp svneol=native#text/plain
+tests/webtbs/tw4613.pp -text svneol=unset#text/plain
+tests/webtbs/tw4616.pp svneol=native#text/plain
+tests/webtbs/tw4632.pp svneol=native#text/plain
+tests/webtbs/tw4633.pp svneol=native#text/plain
 tests/webtbs/tw4634.pp -text
+tests/webtbs/tw4635.pp svneol=native#text/plain
+tests/webtbs/tw4640.pp svneol=native#text/plain
 tests/webtbs/tw4669.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain

+ 7 - 7
.gitignore

@@ -512,6 +512,13 @@ packages/base/gdbint/*.ppu
 packages/base/gdbint/*.s
 packages/base/gdbint/fpcmade.*
 packages/base/gdbint/units
+packages/base/graph/inc/*.bak
+packages/base/graph/inc/*.exe
+packages/base/graph/inc/*.o
+packages/base/graph/inc/*.ppu
+packages/base/graph/inc/*.s
+packages/base/graph/inc/fpcmade.*
+packages/base/graph/inc/units
 packages/base/hash/*.bak
 packages/base/hash/*.exe
 packages/base/hash/*.o
@@ -1766,13 +1773,6 @@ rtl/inc/*.o
 rtl/inc/*.ppu
 rtl/inc/*.s
 rtl/inc/fpcmade.*
-rtl/inc/graph/*.bak
-rtl/inc/graph/*.exe
-rtl/inc/graph/*.o
-rtl/inc/graph/*.ppu
-rtl/inc/graph/*.s
-rtl/inc/graph/fpcmade.*
-rtl/inc/graph/units
 rtl/inc/units
 rtl/linux/*.bak
 rtl/linux/*.exe

+ 2 - 1
compiler/aasmbase.pas

@@ -771,7 +771,8 @@ implementation
            {$IFDEF EXTDEBUG}
            if (_typ <> AT_NONE) and
               (hp.typ <> _typ) and
-              not(cs_compilesystem in aktmoduleswitches) then
+              not(cs_compilesystem in aktmoduleswitches) and
+              (target_info.system <> system_powerpc_darwin) then
              begin
                //Writeln('Error symbol '+hp.name+' type is ',Ord(_typ),', should be ',Ord(hp.typ));
                InternalError(2004031501);

+ 5 - 1
compiler/aoptobj.pas

@@ -1050,7 +1050,11 @@ Unit AoptObj;
                                       taicpu(p).condition:=inverse_cond(taicpu(p).condition);
                                       tai_label(hp2).l.decrefs;
                                       taicpu(p).oper[0]^.ref^.symbol:=taicpu(hp1).oper[0]^.ref^.symbol;
-                                      taicpu(p).oper[0]^.ref^.symbol.increfs;
+                                      { when freeing hp1, the reference count 
+                                        isn't decreased, so don't increase
+ 
+                                       taicpu(p).oper[0]^.ref^.symbol.increfs;
+                                      }
 {$ifdef SPARC}
                                       hp2:=tai(hp1.next);
                                       asml.remove(hp2);

+ 13 - 0
compiler/cgbase.pas

@@ -284,6 +284,9 @@ interface
     { return the inverse condition of opcmp }
     function inverse_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
 
+    { return the opcmp needed when swapping the operands }
+    function swap_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
+
     { return whether op is commutative }
     function commutativeop(op: topcg): boolean;{$ifdef USEINLINE}inline;{$endif}
 
@@ -526,6 +529,16 @@ implementation
       end;
 
 
+    function swap_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
+      const
+        list: array[TOpCmp] of TOpCmp =
+          (OC_NONE,OC_EQ,OC_LT,OC_GT,OC_LTE,OC_GTE,OC_NE,OC_AE,OC_A,
+           OC_BE,OC_B);
+      begin
+        swap_opcmp := list[opcmp];
+      end;
+
+
     function commutativeop(op: topcg): boolean;{$ifdef USEINLINE}inline;{$endif}
       const
         list: array[topcg] of boolean =

+ 27 - 13
compiler/cgobj.pas

@@ -93,9 +93,9 @@ unit cgobj;
           procedure getcpuregister(list:Taasmoutput;r:Tregister);virtual;
           procedure ungetcpuregister(list:Taasmoutput;r:Tregister);virtual;
           {# Get multiple registers specified.}
-          procedure alloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);virtual;
+          procedure alloccpuregisters(list:Taasmoutput;rt:Tregistertype;const r:Tcpuregisterset);virtual;
           {# Free multiple registers specified.}
-          procedure dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);virtual;
+          procedure dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;const r:Tcpuregisterset);virtual;
 
           procedure do_register_allocation(list:Taasmoutput;headertai:tai);virtual;
 
@@ -263,6 +263,7 @@ unit cgobj;
           procedure a_cmp_ref_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp; const ref: treference; reg : tregister; l : tasmlabel); virtual;
           procedure a_cmp_reg_ref_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp;reg : tregister; const ref: treference; l : tasmlabel); virtual;
           procedure a_cmp_loc_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp; const loc: tlocation; reg : tregister; l : tasmlabel);
+          procedure a_cmp_reg_loc_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp; reg: tregister; const loc: tlocation; l : tasmlabel);
           procedure a_cmp_ref_loc_label(list: taasmoutput; size: tcgsize;cmp_op: topcmp; const ref: treference; const loc: tlocation;
             l : tasmlabel);
 
@@ -610,7 +611,7 @@ implementation
       end;
 
 
-    procedure tcg.alloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);
+    procedure tcg.alloccpuregisters(list:Taasmoutput;rt:Tregistertype;const r:Tcpuregisterset);
       begin
         if assigned(rg[rt]) then
           rg[rt].alloccpuregisters(list,r)
@@ -619,7 +620,7 @@ implementation
       end;
 
 
-    procedure tcg.dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);
+    procedure tcg.dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;const r:Tcpuregisterset);
       begin
         if assigned(rg[rt]) then
           rg[rt].dealloccpuregisters(list,r)
@@ -1207,6 +1208,12 @@ implementation
       end;
 
 
+    procedure tcg.a_cmp_reg_loc_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp; reg: tregister; const loc: tlocation; l : tasmlabel);
+      begin
+        a_cmp_loc_reg_label(list,size,swap_opcmp(cmp_op),loc,reg,l);
+      end;
+
+
     procedure tcg.a_cmp_loc_reg_label(list : taasmoutput;size : tcgsize;cmp_op : topcmp; const loc: tlocation; reg : tregister; l : tasmlabel);
       begin
         case loc.loc of
@@ -1478,6 +1485,7 @@ implementation
         decrfunc : string;
         needrtti : boolean;
         cgpara1,cgpara2 : TCGPara;
+        tempreg1,tempreg2 : TRegister;
       begin
         cgpara1.init;
         cgpara2.init;
@@ -1516,14 +1524,20 @@ implementation
             if needrtti then
              begin
                reference_reset_symbol(href,tstoreddef(t).get_rtti_label(initrtti),0);
-               paramanager.allocparaloc(list,cgpara2);
-               a_paramaddr_ref(list,href,cgpara2);
+               tempreg2:=getaddressregister(list);
+               a_loadaddr_ref_reg(list,href,tempreg2);
              end;
+            tempreg1:=getaddressregister(list);
+            a_loadaddr_ref_reg(list,ref,tempreg1);
+            if needrtti then
+              begin
+                paramanager.allocparaloc(list,cgpara2);
+                a_param_reg(list,OS_ADDR,tempreg2,cgpara2);
+                paramanager.freeparaloc(list,cgpara2);
+              end;
             paramanager.allocparaloc(list,cgpara1);
-            a_paramaddr_ref(list,ref,cgpara1);
+            a_param_reg(list,OS_ADDR,tempreg1,cgpara1);
             paramanager.freeparaloc(list,cgpara1);
-            if needrtti then
-              paramanager.freeparaloc(list,cgpara2);
             alloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
             a_call_name(list,decrfunc);
             dealloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
@@ -1592,10 +1606,10 @@ implementation
          if is_ansistring(t) or
             is_widestring(t) or
             is_interfacecom(t) then
-           begin
-             g_decrrefcount(list,t,ref);
-             a_load_const_ref(list,OS_ADDR,0,ref);
-           end
+            begin
+              g_decrrefcount(list,t,ref);
+              a_load_const_ref(list,OS_ADDR,0,ref);
+            end
          else
            begin
               reference_reset_symbol(href,tstoreddef(t).get_rtti_label(initrtti),0);

+ 12 - 46
compiler/cutils.pas

@@ -67,7 +67,6 @@ interface
     function PadSpace(const s:string;len:longint):string;
     function GetToken(var s:string;endchar:char):string;
     procedure uppervar(var s : string);
-    function hexstr(val : cardinal;cnt : cardinal) : string;
     function realtostr(e:extended):string;{$ifdef USEINLINE}inline;{$endif}
     function tostr(i : qword) : string;{$ifdef USEINLINE}inline;{$endif}overload;
     function tostr(i : int64) : string;{$ifdef USEINLINE}inline;{$endif}overload;
@@ -152,10 +151,10 @@ uses
       return the minimal of a and b
     }
       begin
-         if a>b then
-           min:=b
+         if a<=b then
+           min:=a
          else
-           min:=a;
+           min:=b;
       end;
 
 
@@ -164,10 +163,10 @@ uses
       return the minimal of a and b
     }
       begin
-         if a>b then
-           min:=b
+         if a<=b then
+           min:=a
          else
-           min:=a;
+           min:=b;
       end;
 
 
@@ -176,10 +175,10 @@ uses
       return the maximum of a and b
     }
       begin
-         if a<b then
-           max:=b
+         if a>=b then
+           max:=a
          else
-           max:=a;
+           max:=b;
       end;
 
 
@@ -188,10 +187,10 @@ uses
       return the maximum of a and b
     }
       begin
-         if a<b then
-           max:=b
+         if a>=b then
+           max:=a
          else
-           max:=a;
+           max:=b;
       end;
 
 
@@ -398,39 +397,6 @@ uses
       end;
 
 
-    function hexstr(val : cardinal;cnt : cardinal) : string;
-      const
-        HexTbl : array[0..15] of char='0123456789ABCDEF';
-      var
-        i,j : cardinal;
-      begin
-        { calculate required length }
-        i:=0;
-        j:=val;
-        while (j>0) do
-         begin
-           inc(i);
-           j:=j shr 4;
-         end;
-        { generate fillers }
-        j:=0;
-        while (i+j<cnt) do
-         begin
-           inc(j);
-           hexstr[j]:='0';
-         end;
-        { generate hex }
-        inc(j,i);
-        hexstr[0]:=chr(j);
-        while (val>0) do
-         begin
-           hexstr[j]:=hextbl[val and $f];
-           dec(j);
-           val:=val shr 4;
-         end;
-      end;
-
-
     function DStr(l:longint):string;
       var
         TmpStr : string[32];

+ 10 - 6
compiler/i386/cpuinfo.pas

@@ -45,7 +45,8 @@ Type
        ClassPentium,
        ClassPentium2,
        ClassPentium3,
-       ClassPentium4
+       ClassPentium4,
+       ClassPentiumM
       );
 
    tfputype =
@@ -53,7 +54,8 @@ Type
       fpu_soft,
       fpu_x87,
       fpu_sse,
-      fpu_sse2
+      fpu_sse2,
+      fpu_sse3
      );
 
 
@@ -76,18 +78,20 @@ Const
      'PENTIUM',
      'PENTIUM2',
      'PENTIUM3',
-     'PENTIUM4'
+     'PENTIUM4',
+     'PENTIUMM'
    );
 
    fputypestr : array[tfputype] of string[6] = ('',
      'SOFT',
      'X87',
      'SSE',
-     'SSE2'
+     'SSE2',
+     'SSE3'
    );
 
-   sse_singlescalar : set of tfputype = [fpu_sse,fpu_sse2];
-   sse_doublescalar : set of tfputype = [fpu_sse2];
+   sse_singlescalar : set of tfputype = [fpu_sse,fpu_sse2,fpu_sse3];
+   sse_doublescalar : set of tfputype = [fpu_sse2,fpu_sse3];
 
 Implementation
 

+ 1 - 0
compiler/i386/cpuswtch.pas

@@ -82,6 +82,7 @@ begin
                            '2': initoptprocessor := ClassPentium;
                            '3': initoptprocessor := ClassPentium2;
                            '4': initoptprocessor := ClassPentium4;
+                           '5': initoptprocessor := ClassPentiumM;
                            Else IllegalPara(Opt)
                          End;
                          Inc(j);

+ 5 - 1
compiler/i386/popt386.pas

@@ -629,7 +629,11 @@ begin
                                 taicpu(p).condition:=inverse_cond(taicpu(p).condition);
                                 tai_label(hp2).l.decrefs;
                                 taicpu(p).oper[0]^.ref^.symbol:=taicpu(hp1).oper[0]^.ref^.symbol;
-                                taicpu(p).oper[0]^.ref^.symbol.increfs;
+                                { when free'ing hp1, the ref. isn't decresed, so we don't
+                                  increase it (FK)
+
+                                  taicpu(p).oper[0]^.ref^.symbol.increfs;
+                                }
                                 asml.remove(hp1);
                                 hp1.free;
                                 GetFinalDestination(asml, taicpu(p),0);

+ 17 - 1
compiler/i386/ra386int.pas

@@ -920,6 +920,11 @@ Unit Ra386int;
                 def:=nil;
                 tempstr:=actasmpattern;
                 prevtok:=prevasmtoken;
+                { stop parsing a constant expression if we find an opcode after a
+                  non-operator like "db $66 mov eax,ebx" }
+                if (prevtok in [AS_ID,AS_INTNUM,AS_RPAREN]) and
+                   is_asmopcode(actasmpattern) then
+                  break;
                 consume(AS_ID);
                 if SearchIConstant(tempstr,l) then
                  begin
@@ -1038,6 +1043,10 @@ Unit Ra386int;
                 if (hs<>'') and not(actasmtoken in [AS_MINUS,AS_PLUS,AS_COMMA,AS_SEPARATOR,AS_END,AS_RBRACKET]) then
                  Message(asmr_e_only_add_relocatable_symbol);
               end;
+            AS_ALIGN,
+            AS_DB,
+            AS_DW,
+            AS_DD,
             AS_END,
             AS_RBRACKET,
             AS_SEPARATOR,
@@ -1961,7 +1970,14 @@ Unit Ra386int;
                  ConcatConstant(curlist,value,constsize);
               end;
             AS_COMMA:
-              Consume(AS_COMMA);
+              begin
+                Consume(AS_COMMA);
+              end;
+            AS_ALIGN,
+            AS_DB,
+            AS_DW,
+            AS_DD,
+            AS_OPCODE,
             AS_END,
             AS_SEPARATOR:
               break;

+ 4 - 8
compiler/ncgflw.pas

@@ -332,7 +332,6 @@ implementation
       var
          l3,oldclabel,oldblabel : tasmlabel;
          temptovalue : boolean;
-         temp1 : treference;
          hop : topcg;
          hcond : topcmp;
          opsize : tcgsize;
@@ -363,10 +362,8 @@ implementation
          if t1.nodetype<>ordconstn then
            begin
               do_loopvar_at_end:=false;
-              tg.GetTemp(exprasmlist,t1.resulttype.def.size,tt_normal,temp1);
+              location_force_reg(exprasmlist,t1.location,t1.location.size,true);
               temptovalue:=true;
-              cg.a_load_loc_ref(exprasmlist,opsize,t1.location,temp1);
-              location_freetemp(exprasmlist,t1.location);
            end
          else
            temptovalue:=false;
@@ -402,8 +399,8 @@ implementation
 
          if temptovalue then
            begin
-             cg.a_cmp_ref_loc_label(exprasmlist,opsize,hcond,
-               temp1,left.location,aktbreaklabel);
+             cg.a_cmp_reg_loc_label(exprasmlist,opsize,hcond,
+               t1.location.register,left.location,aktbreaklabel);
            end
          else
            begin
@@ -499,9 +496,8 @@ implementation
          { jump                                     }
          if temptovalue then
            begin
-             cg.a_cmp_ref_loc_label(exprasmlist,opsize,hcond,temp1,
+             cg.a_cmp_reg_loc_label(exprasmlist,opsize,hcond,t1.location.register,
                left.location,l3);
-             tg.ungetiftemp(exprasmlist,temp1);
            end
          else
            begin

+ 1 - 1
compiler/ncgmem.pas

@@ -184,6 +184,7 @@ implementation
          secondpass(left);
          location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
          case left.location.loc of
+            LOC_CREGISTER,
             LOC_REGISTER:
               begin
               {$ifdef cpu_uses_separate_address_registers}
@@ -197,7 +198,6 @@ implementation
               {$endif}
                   location.reference.base := left.location.register;
               end;
-            LOC_CREGISTER,
             LOC_CREFERENCE,
             LOC_REFERENCE:
               begin

+ 10 - 1
compiler/ncnv.pas

@@ -1881,6 +1881,11 @@ implementation
                     case tfloatdef(resulttype.def).typ of
                       s64real:
                         result:=ccallnode.createintern('STOD',ccallparanode.create(left,nil));
+                      s32real:
+                        begin
+                          result:=left;
+                          left:=nil;
+                        end;
                       else
                         internalerror(2005082704);
                     end;
@@ -1888,6 +1893,11 @@ implementation
                     case tfloatdef(resulttype.def).typ of
                       s32real:
                         result:=ccallnode.createintern('DTOS',ccallparanode.create(left,nil));
+                      s64real:
+                        begin
+                          result:=left;
+                          left:=nil;
+                        end;
                       else
                         internalerror(2005082703);
                     end;
@@ -1908,7 +1918,6 @@ implementation
 {$endif cpufpemu}
           begin
             first_real_to_real:=nil;
-            { comp isn't a floating type }
             if registersfpu<1 then
               registersfpu:=1;
             expectloc:=LOC_FPUREGISTER;

+ 35 - 8
compiler/nutils.pas

@@ -446,17 +446,44 @@ implementation
 
 
     function finalize_data_node(p:tnode):tnode;
+      var
+        newstatement : tstatementnode;
       begin
         if not assigned(p.resulttype.def) then
           resulttypepass(p);
-        result:=ccallnode.createintern('fpc_finalize',
-              ccallparanode.create(
-                  caddrnode.create_internal(
-                      crttinode.create(
-                          tstoreddef(p.resulttype.def),initrtti)),
-              ccallparanode.create(
-                  caddrnode.create_internal(p),
-              nil)));
+        if is_ansistring(p.resulttype.def) then
+          begin
+            result:=internalstatements(newstatement);
+            addstatement(newstatement,ccallnode.createintern('fpc_ansistr_decr_ref',
+                  ccallparanode.create(
+                    ctypeconvnode.create_internal(p,voidpointertype),
+                  nil)));
+            addstatement(newstatement,cassignmentnode.create(
+               ctypeconvnode.create_internal(p.getcopy,voidpointertype),
+               cnilnode.create
+               ));
+          end
+        else if is_widestring(p.resulttype.def) then
+          begin
+            result:=internalstatements(newstatement);
+            addstatement(newstatement,ccallnode.createintern('fpc_widestr_decr_ref',
+                  ccallparanode.create(
+                    ctypeconvnode.create_internal(p,voidpointertype),
+                  nil)));
+            addstatement(newstatement,cassignmentnode.create(
+               ctypeconvnode.create_internal(p.getcopy,voidpointertype),
+               cnilnode.create
+               ));
+          end
+        else
+          result:=ccallnode.createintern('fpc_finalize',
+                ccallparanode.create(
+                    caddrnode.create_internal(
+                        crttinode.create(
+                            tstoreddef(p.resulttype.def),initrtti)),
+                ccallparanode.create(
+                    caddrnode.create_internal(p),
+                nil)));
       end;
 
 

+ 192 - 193
compiler/pdecobj.pas

@@ -54,8 +54,7 @@ implementation
       var
          there_is_a_destructor : boolean;
          classtype : tobjectdeftype;
-         childof : tobjectdef;
-         aktclass : tobjectdef;
+//         childof : tobjectdef;
 
       function constructor_head:tprocdef;
         var
@@ -63,7 +62,7 @@ implementation
         begin
            consume(_CONSTRUCTOR);
            { must be at same level as in implementation }
-           parse_proc_head(aktclass,potype_constructor,pd);
+           parse_proc_head(aktobjectdef,potype_constructor,pd);
            if not assigned(pd) then
              begin
                consume(_SEMICOLON);
@@ -73,7 +72,7 @@ implementation
               (pd.procsym.name<>'INIT') then
              Message(parser_e_constructorname_must_be_init);
            consume(_SEMICOLON);
-           include(aktclass.objectoptions,oo_has_constructor);
+           include(aktobjectdef.objectoptions,oo_has_constructor);
            { Set return type, class constructors return the
              created instance, object constructors return boolean }
            if is_class(pd._class) then
@@ -89,17 +88,17 @@ implementation
           p : tpropertysym;
         begin
            { check for a class }
-           if not((is_class_or_interface(aktclass)) or
-              (not(m_tp7 in aktmodeswitches) and (is_object(aktclass)))) then
+           if not((is_class_or_interface(aktobjectdef)) or
+              (not(m_tp7 in aktmodeswitches) and (is_object(aktobjectdef)))) then
              Message(parser_e_syntax_error);
            consume(_PROPERTY);
-           p:=read_property_dec(aktclass);
+           p:=read_property_dec(aktobjectdef);
            consume(_SEMICOLON);
            if try_to_consume(_DEFAULT) then
              begin
-               if oo_has_default_property in aktclass.objectoptions then
+               if oo_has_default_property in aktobjectdef.objectoptions then
                  message(parser_e_only_one_default_property);
-               include(aktclass.objectoptions,oo_has_default_property);
+               include(aktobjectdef.objectoptions,oo_has_default_property);
                include(p.propoptions,ppo_defaultproperty);
                if not(ppo_hasparameters in p.propoptions) then
                  message(parser_e_property_need_paras);
@@ -117,7 +116,7 @@ implementation
           pd : tprocdef;
         begin
            consume(_DESTRUCTOR);
-           parse_proc_head(aktclass,potype_destructor,pd);
+           parse_proc_head(aktobjectdef,potype_destructor,pd);
            if not assigned(pd) then
              begin
                consume(_SEMICOLON);
@@ -130,7 +129,7 @@ implementation
               (m_fpc in aktmodeswitches) then
              Message(parser_e_no_paras_for_destructor);
            consume(_SEMICOLON);
-           include(aktclass.objectoptions,oo_has_destructor);
+           include(aktobjectdef.objectoptions,oo_has_destructor);
            { no return value }
            pd.rettype:=voidtype;
            destructor_head:=pd;
@@ -149,44 +148,20 @@ implementation
            { publishable }
            if classtype in [odt_interfacecom,odt_class] then
              begin
-                aktclass.objecttype:=classtype;
+                aktobjectdef.objecttype:=classtype;
+                { set published flag in $M+ mode or it is inherited }
                 if (cs_generate_rtti in aktlocalswitches) or
-                    (assigned(aktclass.childof) and
-                     (oo_can_have_published in aktclass.childof.objectoptions)) then
-                  begin
-                     include(aktclass.objectoptions,oo_can_have_published);
-                     { in "publishable" classes the default access type is published }
-                     current_object_option:=[sp_published];
-                  end;
+                    (assigned(aktobjectdef.childof) and
+                     (oo_can_have_published in aktobjectdef.childof.objectoptions)) then
+                  include(aktobjectdef.objectoptions,oo_can_have_published);
+                { in "publishable" classes the default access type is published, this is
+                  done separate from above if-statement because the option can be
+                  inherited from the forward class definition }
+                if (oo_can_have_published in aktobjectdef.objectoptions) then
+                  current_object_option:=[sp_published];
              end;
         end;
 
-     procedure setclassparent;
-
-        begin
-           if assigned(fd) then
-             aktclass:=fd
-           else
-             aktclass:=tobjectdef.create(classtype,n,nil);
-           { is the current class tobject?   }
-           { so you could define your own tobject }
-           if (cs_compilesystem in aktmoduleswitches) and (classtype=odt_class) and (upper(n)='TOBJECT') then
-             class_tobject:=aktclass
-           else if (cs_compilesystem in aktmoduleswitches) and (classtype=odt_interfacecom) and (upper(n)='IUNKNOWN') then
-             interface_iunknown:=aktclass
-           else
-             begin
-                case classtype of
-                  odt_class:
-                    childof:=class_tobject;
-                  odt_interfacecom:
-                    childof:=interface_iunknown;
-                end;
-                if (oo_is_forward in childof.objectoptions) then
-                  Message1(parser_e_forward_declaration_must_be_resolved,childof.objrealname^);
-                aktclass.set_parent(childof);
-             end;
-         end;
 
       procedure setinterfacemethodoptions;
 
@@ -195,15 +170,15 @@ implementation
           defs: TIndexArray;
           pd: tdef;
         begin
-          include(aktclass.objectoptions,oo_has_virtual);
-          defs:=aktclass.symtable.defindex;
+          include(aktobjectdef.objectoptions,oo_has_virtual);
+          defs:=aktobjectdef.symtable.defindex;
           for i:=1 to defs.count do
             begin
               pd:=tdef(defs.search(i));
               if pd.deftype=procdef then
                 begin
-                  tprocdef(pd).extnumber:=aktclass.lastvtableindex;
-                  inc(aktclass.lastvtableindex);
+                  tprocdef(pd).extnumber:=aktobjectdef.lastvtableindex;
+                  inc(aktobjectdef.lastvtableindex);
                   include(tprocdef(pd).procoptions,po_virtualmethod);
                   tprocdef(pd).forwarddef:=false;
                 end;
@@ -243,12 +218,15 @@ implementation
                        { also anonym objects aren't allow (o : object a : longint; end;) }
                        if n='' then
                          Message(parser_f_no_anonym_objects);
-                       aktclass:=tobjectdef.create(classtype,n,nil);
+                       aktobjectdef:=tobjectdef.create(classtype,n,nil);
                        if (cs_compilesystem in aktmoduleswitches) and
                           (classtype=odt_interfacecom) and (upper(n)='IUNKNOWN') then
-                         interface_iunknown:=aktclass;
-                       include(aktclass.objectoptions,oo_is_forward);
-                       object_dec:=aktclass;
+                         interface_iunknown:=aktobjectdef;
+                       include(aktobjectdef.objectoptions,oo_is_forward);
+                       if (cs_generate_rtti in aktlocalswitches) and
+                          (classtype=odt_interfacecom) then
+                         include(aktobjectdef.objectoptions,oo_can_have_published);
+                       object_dec:=aktobjectdef;
                        typecanbeforward:=storetypecanbeforward;
                        readobjecttype:=false;
                        exit;
@@ -294,16 +272,17 @@ implementation
                         { also anonym objects aren't allow (o : object a : longint; end;) }
                         if n='' then
                           Message(parser_f_no_anonym_objects);
-                        aktclass:=tobjectdef.create(odt_class,n,nil);
+                        aktobjectdef:=tobjectdef.create(odt_class,n,nil);
                         if (cs_compilesystem in aktmoduleswitches) and (upper(n)='TOBJECT') then
-                          class_tobject:=aktclass;
-                        aktclass.objecttype:=odt_class;
-                        include(aktclass.objectoptions,oo_is_forward);
+                          class_tobject:=aktobjectdef;
+                        aktobjectdef.objecttype:=odt_class;
+                        include(aktobjectdef.objectoptions,oo_is_forward);
+                        if (cs_generate_rtti in aktlocalswitches) then
+                          include(aktobjectdef.objectoptions,oo_can_have_published);
                         { all classes must have a vmt !!  at offset zero }
-                        if not(oo_has_vmt in aktclass.objectoptions) then
-                          aktclass.insertvmt;
-
-                        object_dec:=aktclass;
+                        if not(oo_has_vmt in aktobjectdef.objectoptions) then
+                          aktobjectdef.insertvmt;
+                        object_dec:=aktobjectdef;
                         typecanbeforward:=storetypecanbeforward;
                         readobjecttype:=false;
                         exit;
@@ -325,16 +304,16 @@ implementation
                  Message1(type_e_interface_type_expected,implintf.typename);
                  exit;
               end;
-            if aktclass.implementedinterfaces.searchintf(implintf)<>-1 then
+            if aktobjectdef.implementedinterfaces.searchintf(implintf)<>-1 then
               Message1(sym_e_duplicate_id,implintf.name)
             else
               begin
                  { allocate and prepare the GUID only if the class
                    implements some interfaces.
                  }
-                 if aktclass.implementedinterfaces.count = 0 then
-                   aktclass.prepareguid;
-                 aktclass.implementedinterfaces.addintf(implintf);
+                 if aktobjectdef.implementedinterfaces.count = 0 then
+                   aktobjectdef.prepareguid;
+                 aktobjectdef.implementedinterfaces.addintf(implintf);
               end;
         end;
 
@@ -362,11 +341,11 @@ implementation
           p:=comp_expr(true);
           if p.nodetype=stringconstn then
             begin
-              stringdispose(aktclass.iidstr);
-              aktclass.iidstr:=stringdup(strpas(tstringconstnode(p).value_str)); { or upper? }
+              stringdispose(aktobjectdef.iidstr);
+              aktobjectdef.iidstr:=stringdup(strpas(tstringconstnode(p).value_str)); { or upper? }
               p.free;
-              valid:=string2guid(aktclass.iidstr^,aktclass.iidguid^);
-              if (classtype=odt_interfacecom) and not assigned(aktclass.iidguid) and not valid then
+              valid:=string2guid(aktobjectdef.iidstr^,aktobjectdef.iidguid^);
+              if (classtype=odt_interfacecom) and not assigned(aktobjectdef.iidguid) and not valid then
                 Message(parser_e_improper_guid_syntax);
             end
           else
@@ -379,88 +358,106 @@ implementation
 
       procedure readparentclasses;
         var
-           hp : tobjectdef;
+           intfchildof,
+           childof : tobjectdef;
+           tt : ttype;
+           hasparentdefined : boolean;
         begin
-           hp:=nil;
-           { reads the parent class }
-           if try_to_consume(_LKLAMMER) then
-             begin
-                id_type(tt,false);
-                childof:=tobjectdef(tt.def);
-                if (not assigned(childof)) or
-                   (childof.deftype<>objectdef) then
-                 begin
-                   if assigned(childof) then
-                     Message1(type_e_class_type_expected,childof.typename);
-                   childof:=nil;
-                   aktclass:=tobjectdef.create(classtype,n,nil);
-                 end
-                else
-                 begin
-                   { a mix of class, interfaces, objects and cppclasses
-                     isn't allowed }
-                   case classtype of
-                      odt_class:
-                        if not(is_class(childof)) then
-                          begin
-                             if is_interface(childof) then
-                               begin
-                                  { we insert the interface after the child
-                                    is set, see below
-                                  }
-                                  hp:=childof;
-                                  childof:=class_tobject;
-                               end
-                             else
-                               Message(parser_e_mix_of_classes_and_objects);
-                          end;
-                      odt_interfacecorba,
-                      odt_interfacecom:
-                        if not(is_interface(childof)) then
-                          Message(parser_e_mix_of_classes_and_objects);
-                      odt_cppclass:
-                        if not(is_cppclass(childof)) then
-                          Message(parser_e_mix_of_classes_and_objects);
-                      odt_object:
-                        if not(is_object(childof)) then
-                          Message(parser_e_mix_of_classes_and_objects);
-                   end;
-                   { the forward of the child must be resolved to get
-                     correct field addresses }
-                   if assigned(fd) then
-                    begin
-                      if (oo_is_forward in childof.objectoptions) then
-                       Message1(parser_e_forward_declaration_must_be_resolved,childof.objrealname^);
-                      aktclass:=fd;
-                      { we must inherit several options !!
-                        this was missing !!
-                        all is now done in set_parent
-                        including symtable datasize setting PM }
-                      fd.set_parent(childof);
-                    end
-                   else
-                    aktclass:=tobjectdef.create(classtype,n,childof);
-                   if aktclass.objecttype=odt_class then
-                     begin
-                        if assigned(hp) then
-                          handleimplementedinterface(hp);
-                        readimplementedinterfaces;
-                     end;
-                 end;
-                consume(_RKLAMMER);
-             end
-           { if no parent class, then a class get tobject as parent }
-           else if classtype in [odt_class,odt_interfacecom] then
-             setclassparent
-           else
-             aktclass:=tobjectdef.create(classtype,n,nil);
-           { read GUID }
-             if (classtype in [odt_interfacecom,odt_interfacecorba]) and
-                try_to_consume(_LECKKLAMMER) then
-               begin
-                 readinterfaceiid;
-                 consume(_RECKKLAMMER);
-               end;
+          childof:=nil;
+          intfchildof:=nil;
+          hasparentdefined:=false;
+
+          { reads the parent class }
+          if try_to_consume(_LKLAMMER) then
+            begin
+              id_type(tt,false);
+              if (not assigned(tt.def)) or
+                 (tt.def.deftype<>objectdef) then
+                begin
+                  if assigned(tt.def) then
+                    Message1(type_e_class_type_expected,childof.typename);
+                end
+              else
+                begin
+                  childof:=tobjectdef(tt.def);
+                  { a mix of class, interfaces, objects and cppclasses
+                    isn't allowed }
+                  case classtype of
+                     odt_class:
+                       if not(is_class(childof)) then
+                         begin
+                            if is_interface(childof) then
+                              begin
+                                 { we insert the interface after the child
+                                   is set, see below
+                                 }
+                                 intfchildof:=childof;
+                                 childof:=class_tobject;
+                              end
+                            else
+                              Message(parser_e_mix_of_classes_and_objects);
+                         end;
+                     odt_interfacecorba,
+                     odt_interfacecom:
+                       if not(is_interface(childof)) then
+                         Message(parser_e_mix_of_classes_and_objects);
+                     odt_cppclass:
+                       if not(is_cppclass(childof)) then
+                         Message(parser_e_mix_of_classes_and_objects);
+                     odt_object:
+                       if not(is_object(childof)) then
+                         Message(parser_e_mix_of_classes_and_objects);
+                  end;
+                end;
+              hasparentdefined:=true;
+            end;
+
+          { if no parent class, then a class get tobject as parent }
+          if not assigned(childof) then
+            begin
+              case classtype of
+                odt_class:
+                  if aktobjectdef<>class_tobject then
+                    childof:=class_tobject;
+                odt_interfacecom:
+                  if aktobjectdef<>interface_iunknown then
+                    childof:=interface_iunknown;
+              end;
+            end;
+
+          if assigned(childof) then
+            begin
+              { Forbid not completly defined objects to be used as parents. This will
+                also prevent circular loops of classes, because we set the forward flag
+                at the start of the new definition and will reset it below after the
+                parent has been set }
+              if not(oo_is_forward in childof.objectoptions) then
+                aktobjectdef.set_parent(childof)
+              else
+                Message1(parser_e_forward_declaration_must_be_resolved,childof.objrealname^);
+            end;
+
+          { remove forward flag, is resolved }
+          exclude(aktobjectdef.objectoptions,oo_is_forward);
+
+          if hasparentdefined then
+            begin
+              if aktobjectdef.objecttype=odt_class then
+                begin
+                  if assigned(intfchildof) then
+                    handleimplementedinterface(intfchildof);
+                  readimplementedinterfaces;
+                end;
+              consume(_RKLAMMER);
+            end;
+
+          { read GUID }
+          if (classtype in [odt_interfacecom,odt_interfacecorba]) and
+             try_to_consume(_LECKKLAMMER) then
+            begin
+              readinterfaceiid;
+              consume(_RECKKLAMMER);
+            end;
         end;
 
         procedure chkcpp(pd:tprocdef);
@@ -478,10 +475,6 @@ implementation
       begin
          old_object_option:=current_object_option;
 
-         { forward is resolved }
-         if assigned(fd) then
-           exclude(fd.objectoptions,oo_is_forward);
-
          { objects and class types can't be declared local }
          if not(symtablestack.symtabletype in [globalsymtable,staticsymtable]) then
            Message(parser_e_no_local_objects);
@@ -494,9 +487,18 @@ implementation
          if not(readobjecttype) then
            exit;
 
-         { also anonym objects aren't allow (o : object a : longint; end;) }
-         if n='' then
-           Message(parser_f_no_anonym_objects);
+         if assigned(fd) then
+           aktobjectdef:=fd
+         else
+           begin
+             { anonym objects aren't allow (o : object a : longint; end;) }
+             if n='' then
+               Message(parser_f_no_anonym_objects);
+             aktobjectdef:=tobjectdef.create(classtype,n,nil);
+             { include forward flag, it'll be removed after the parent class have been
+               added. This is to prevent circular childof loops }
+             include(aktobjectdef.objectoptions,oo_is_forward);
+           end;
 
          { read list of parent classes }
          readparentclasses;
@@ -508,11 +510,9 @@ implementation
          { set class flags and inherits published }
          setclassattributes;
 
-         aktobjectdef:=aktclass;
-         aktclass.symtable.next:=symtablestack;
-         symtablestack:=aktclass.symtable;
+         aktobjectdef.symtable.next:=symtablestack;
+         symtablestack:=aktobjectdef.symtable;
          testcurobject:=1;
-         curobjectname:=Upper(n);
 
          { short class declaration ? }
          if (classtype<>odt_class) or (token<>_SEMICOLON) then
@@ -525,23 +525,23 @@ implementation
                     case idtoken of
                       _PRIVATE :
                         begin
-                          if is_interface(aktclass) then
+                          if is_interface(aktobjectdef) then
                              Message(parser_e_no_access_specifier_in_interfaces);
                            consume(_PRIVATE);
                            current_object_option:=[sp_private];
-                           include(aktclass.objectoptions,oo_has_private);
+                           include(aktobjectdef.objectoptions,oo_has_private);
                          end;
                        _PROTECTED :
                          begin
-                           if is_interface(aktclass) then
+                           if is_interface(aktobjectdef) then
                              Message(parser_e_no_access_specifier_in_interfaces);
                            consume(_PROTECTED);
                            current_object_option:=[sp_protected];
-                           include(aktclass.objectoptions,oo_has_protected);
+                           include(aktobjectdef.objectoptions,oo_has_protected);
                          end;
                        _PUBLIC :
                          begin
-                           if is_interface(aktclass) then
+                           if is_interface(aktobjectdef) then
                              Message(parser_e_no_access_specifier_in_interfaces);
                            consume(_PUBLIC);
                            current_object_option:=[sp_public];
@@ -551,14 +551,14 @@ implementation
                            { we've to check for a pushlished section in non-  }
                            { publishable classes later, if a real declaration }
                            { this is the way, delphi does it                  }
-                           if is_interface(aktclass) then
+                           if is_interface(aktobjectdef) then
                              Message(parser_e_no_access_specifier_in_interfaces);
                            consume(_PUBLISHED);
                            current_object_option:=[sp_published];
                          end;
                        _STRICT :
                          begin
-                           if is_interface(aktclass) then
+                           if is_interface(aktobjectdef) then
                               Message(parser_e_no_access_specifier_in_interfaces);
                             consume(_STRICT);
                             if token=_ID then
@@ -568,13 +568,13 @@ implementation
                                     begin
                                       consume(_PRIVATE);
                                       current_object_option:=[sp_strictprivate];
-                                      include(aktclass.objectoptions,oo_has_strictprivate);
+                                      include(aktobjectdef.objectoptions,oo_has_strictprivate);
                                     end;
                                   _PROTECTED:
                                     begin
                                       consume(_PROTECTED);
                                       current_object_option:=[sp_strictprotected];
-                                      include(aktclass.objectoptions,oo_has_strictprotected);
+                                      include(aktobjectdef.objectoptions,oo_has_strictprotected);
                                     end;
                                   else
                                     message(parser_e_protected_or_private_expected);
@@ -585,11 +585,11 @@ implementation
                           end;
                         else
                           begin
-                            if is_interface(aktclass) then
+                            if is_interface(aktobjectdef) then
                               Message(parser_e_no_vars_in_interfaces);
 
                             if (sp_published in current_object_option) and
-                              not(oo_can_have_published in aktclass.objectoptions) then
+                              not(oo_can_have_published in aktobjectdef.objectoptions) then
                               Message(parser_e_cant_have_published);
 
                             read_var_decs(false,true,false);
@@ -605,12 +605,12 @@ implementation
                 _CLASS :
                   begin
                     if (sp_published in current_object_option) and
-                       not(oo_can_have_published in aktclass.objectoptions) then
+                       not(oo_can_have_published in aktobjectdef.objectoptions) then
                       Message(parser_e_cant_have_published);
 
                     oldparse_only:=parse_only;
                     parse_only:=true;
-                    pd:=parse_proc_dec(aktclass);
+                    pd:=parse_proc_dec(aktobjectdef);
 
                     { this is for error recovery as well as forward }
                     { interface mappings, i.e. mapping to a method  }
@@ -632,11 +632,11 @@ implementation
 
                        { add procdef options to objectdef options }
                        if (po_msgint in pd.procoptions) then
-                        include(aktclass.objectoptions,oo_has_msgint);
+                        include(aktobjectdef.objectoptions,oo_has_msgint);
                        if (po_msgstr in pd.procoptions) then
-                         include(aktclass.objectoptions,oo_has_msgstr);
+                         include(aktobjectdef.objectoptions,oo_has_msgstr);
                        if (po_virtualmethod in pd.procoptions) then
-                         include(aktclass.objectoptions,oo_has_virtual);
+                         include(aktobjectdef.objectoptions,oo_has_virtual);
 
                        chkcpp(pd);
                      end;
@@ -653,14 +653,14 @@ implementation
                 _CONSTRUCTOR :
                   begin
                     if (sp_published in current_object_option) and
-                      not(oo_can_have_published in aktclass.objectoptions) then
+                      not(oo_can_have_published in aktobjectdef.objectoptions) then
                       Message(parser_e_cant_have_published);
 
                     if not(sp_public in current_object_option) and
                        not(sp_published in current_object_option) then
                       Message(parser_w_constructor_should_be_public);
 
-                    if is_interface(aktclass) then
+                    if is_interface(aktobjectdef) then
                       Message(parser_e_no_con_des_in_interfaces);
 
                     oldparse_only:=parse_only;
@@ -674,7 +674,7 @@ implementation
 
                     { add procdef options to objectdef options }
                     if (po_virtualmethod in pd.procoptions) then
-                      include(aktclass.objectoptions,oo_has_virtual);
+                      include(aktobjectdef.objectoptions,oo_has_virtual);
                     chkcpp(pd);
 
                     { Support hint directives }
@@ -689,13 +689,13 @@ implementation
                 _DESTRUCTOR :
                   begin
                     if (sp_published in current_object_option) and
-                      not(oo_can_have_published in aktclass.objectoptions) then
+                      not(oo_can_have_published in aktobjectdef.objectoptions) then
                       Message(parser_e_cant_have_published);
 
                     if there_is_a_destructor then
                       Message(parser_n_only_one_destructor);
 
-                    if is_interface(aktclass) then
+                    if is_interface(aktobjectdef) then
                       Message(parser_e_no_con_des_in_interfaces);
 
                     if not(sp_public in current_object_option) then
@@ -713,7 +713,7 @@ implementation
 
                     { add procdef options to objectdef options }
                     if (po_virtualmethod in pd.procoptions) then
-                      include(aktclass.objectoptions,oo_has_virtual);
+                      include(aktobjectdef.objectoptions,oo_has_virtual);
 
                     chkcpp(pd);
 
@@ -738,25 +738,24 @@ implementation
           end;
 
          { generate vmt space if needed }
-         if not(oo_has_vmt in aktclass.objectoptions) and
-            (([oo_has_virtual,oo_has_constructor,oo_has_destructor]*aktclass.objectoptions<>[]) or
+         if not(oo_has_vmt in aktobjectdef.objectoptions) and
+            (([oo_has_virtual,oo_has_constructor,oo_has_destructor]*aktobjectdef.objectoptions<>[]) or
              (classtype in [odt_class])
             ) then
-           aktclass.insertvmt;
+           aktobjectdef.insertvmt;
 
-         if is_interface(aktclass) then
+         if is_interface(aktobjectdef) then
            setinterfacemethodoptions;
 
-         { reset }
+         { return defined objectdef }
+         result:=aktobjectdef;
+
+         { restore old state }
+         aktobjectdef:=nil;
          testcurobject:=0;
-         curobjectname:='';
          typecanbeforward:=storetypecanbeforward;
-         { restore old state }
          symtablestack:=symtablestack.next;
-         aktobjectdef:=nil;
          current_object_option:=old_object_option;
-
-         object_dec:=aktclass;
       end;
 
 end.

+ 13 - 9
compiler/pdecsub.pas

@@ -2346,15 +2346,19 @@ const
                         if not assigned(ad) or not assigned(fd) then
                          break;
                         { retrieve names, remove reg for register parameters }
-                        s1:=ad.name;
-                        s2:=fd.name;
-                        { compare names }
-                        if (s1<>s2) then
-                         begin
-                           MessagePos3(pd.fileinfo,parser_e_header_different_var_names,
-                                       aprocsym.name,s1,s2);
-                           break;
-                         end;
+                        if not(sp_implicitrename in ad.symoptions) and
+                           not(sp_implicitrename in fd.symoptions) then
+                          begin
+                            s1:=ad.name;
+                            s2:=fd.name;
+                            { compare names }
+                            if (s1<>s2) then
+                             begin
+                               MessagePos3(pd.fileinfo,parser_e_header_different_var_names,
+                                           aprocsym.name,s1,s2);
+                               break;
+                             end;
+                          end;
                         ad:=tsym(ad.indexnext);
                         fd:=tsym(fd.indexnext);
                       until false;

+ 13 - 9
compiler/pdecvar.pas

@@ -172,7 +172,7 @@ implementation
                                 Message(type_e_ordinal_expr_expected)
                              end;
                             p.free;
-                            pl.addconst(sl_vec,idx);
+                            pl.addconst(sl_vec,idx,p.resulttype);
                             def:=tarraydef(def).elementtype.def;
                           end
                          else
@@ -342,19 +342,23 @@ implementation
                 begin
                    consume(_INDEX);
                    pt:=comp_expr(true);
+                   { Only allow enum and integer indexes. Convert all integer
+                     values to s32int to be compatible with delphi, because the
+                     procedure matching requires equal parameters }
                    if is_constnode(pt) and
                       is_ordinal(pt.resulttype.def)
-{$ifndef cpu64bit}
-                      and (not is_64bitint(pt.resulttype.def))
-{$endif}
-                      then
-                     p.index:=tordconstnode(pt).value
+                      and (not is_64bitint(pt.resulttype.def)) then
+                     begin
+                       if is_integer(pt.resulttype.def) then
+                         inserttypeconv_internal(pt,s32inttype);
+                       p.index:=tordconstnode(pt).value;
+                     end
                    else
                      begin
                        Message(parser_e_invalid_property_index_value);
                        p.index:=0;
                      end;
-                   p.indextype.setdef(pt.resulttype.def);
+                   p.indextype:=pt.resulttype;
                    include(p.propoptions,ppo_indexed);
                    { concat a longint to the para templates }
                    inc(paranr);
@@ -400,7 +404,7 @@ implementation
                      { we ignore hidden stuff here because the property access symbol might have
                        non default calling conventions which might change the hidden stuff;
                        see tw3216.pp (FK) }
-                     p.readaccess.procdef:=Tprocsym(sym).search_procdef_bypara(readprocdef.paras,p.proptype.def,[cpo_allowdefaults,cpo_ignorehidden,cpo_allowconvert]);
+                     p.readaccess.procdef:=Tprocsym(sym).search_procdef_bypara(readprocdef.paras,p.proptype.def,[cpo_allowdefaults,cpo_ignorehidden]);
                      if not assigned(p.readaccess.procdef) then
                        Message(parser_e_ill_property_access_sym);
                    end;
@@ -444,7 +448,7 @@ implementation
                      { Insert hidden parameters }
                      handle_calling_convention(writeprocdef);
                      { search procdefs matching writeprocdef }
-                     p.writeaccess.procdef:=Tprocsym(sym).search_procdef_bypara(writeprocdef.paras,writeprocdef.rettype.def,[cpo_allowdefaults,cpo_allowconvert]);
+                     p.writeaccess.procdef:=Tprocsym(sym).search_procdef_bypara(writeprocdef.paras,writeprocdef.rettype.def,[cpo_allowdefaults]);
                      if not assigned(p.writeaccess.procdef) then
                        Message(parser_e_ill_property_access_sym);
                    end;

+ 9 - 3
compiler/pexpr.pas

@@ -197,7 +197,7 @@ implementation
                  include(p1.flags,nf_absolute);
                end;
              sl_vec :
-               p1:=cvecnode.create(p1,cordconstnode.create(plist^.value,s32inttype,true));
+               p1:=cvecnode.create(p1,cordconstnode.create(plist^.value,plist^.valuett,true));
              else
                internalerror(200110205);
            end;
@@ -230,12 +230,12 @@ implementation
               begin
                 addnode(tvecnode(p).left);
                 if tvecnode(p).right.nodetype=ordconstn then
-                  sl.addconst(sl_vec,tordconstnode(tvecnode(p).right).value)
+                  sl.addconst(sl_vec,tordconstnode(tvecnode(p).right).value,tvecnode(p).right.resulttype)
                 else
                   begin
                     Message(parser_e_illegal_expression);
                     { recovery }
-                    sl.addconst(sl_vec,0);
+                    sl.addconst(sl_vec,0,tvecnode(p).right.resulttype);
                   end;
              end;
             loadn :
@@ -493,6 +493,7 @@ implementation
                   (is_object(p1.resulttype.def) and
                    (oo_has_constructor in tobjectdef(p1.resulttype.def).objectoptions)) or
                   is_open_array(p1.resulttype.def) or
+                  is_array_of_const(p1.resulttype.def) or
                   is_open_string(p1.resulttype.def)
                  ) then
                statement_syssym:=geninlinenode(in_sizeof_x,false,p1)
@@ -2036,6 +2037,11 @@ implementation
          end
         else
          case token of
+           _RETURN :
+              begin
+                consume(_RETURN);
+                p1 := cexitnode.create(comp_expr(true));
+              end;
            _INHERITED :
              begin
                again:=true;

+ 26 - 25
compiler/ptype.pas

@@ -36,7 +36,6 @@ interface
        { hack, which allows to use the current parsed }
        { object type as function argument type  }
        testcurobject : byte;
-       curobjectname : stringid;
 
     { reads a string, file type or a type id and returns a name and }
     { tdef }
@@ -85,19 +84,20 @@ implementation
          s:=pattern;
          sorg:=orgpattern;
          pos:=akttokenpos;
-         { classes can be used also in classes }
-         if (curobjectname=pattern) and is_class_or_interface(aktobjectdef) then
+         { use of current parsed object:
+            - classes can be used also in classes
+            - objects can be parameters }
+         if (token=_ID) and
+            assigned(aktobjectdef) and
+            (aktobjectdef.objname^=pattern) and
+            (
+             (testcurobject=2) or
+             is_class_or_interface(aktobjectdef)
+            )then
            begin
-              tt.setdef(aktobjectdef);
-              consume(_ID);
-              exit;
-           end;
-         { objects can be parameters }
-         if (testcurobject=2) and (curobjectname=pattern) then
-           begin
-              tt.setdef(aktobjectdef);
-              consume(_ID);
-              exit;
+             consume(_ID);
+             tt.setdef(aktobjectdef);
+             exit;
            end;
          { try to load the symbol to see if it's a unitsym. Use the
            special searchsym_type that ignores records,objects and
@@ -260,19 +260,20 @@ implementation
            pt1,pt2 : tnode;
            lv,hv   : TConstExprInt;
         begin
-           { use of current parsed object ? }
-           if (token=_ID) and (testcurobject=2) and (curobjectname=pattern) then
-             begin
-                consume(_ID);
-                tt.setdef(aktobjectdef);
-                exit;
-             end;
-           { classes can be used also in classes }
-           if (curobjectname=pattern) and is_class_or_interface(aktobjectdef) then
+           { use of current parsed object:
+              - classes can be used also in classes
+              - objects can be parameters }
+           if (token=_ID) and
+              assigned(aktobjectdef) and
+              (aktobjectdef.objname^=pattern) and
+              (
+               (testcurobject=2) or
+               is_class_or_interface(aktobjectdef)
+              )then
              begin
-                tt.setdef(aktobjectdef);
-                consume(_ID);
-                exit;
+               consume(_ID);
+               tt.setdef(aktobjectdef);
+               exit;
              end;
            { we can't accept a equal in type }
            pt1:=comp_expr(not(ignore_equal));

+ 4 - 4
compiler/rgobj.pas

@@ -139,9 +139,9 @@ unit rgobj;
         procedure getcpuregister(list:Taasmoutput;r:Tregister);virtual;
         procedure ungetcpuregister(list:Taasmoutput;r:Tregister);virtual;
         {# Get multiple registers specified.}
-        procedure alloccpuregisters(list:Taasmoutput;r:Tcpuregisterset);virtual;
+        procedure alloccpuregisters(list:Taasmoutput;const r:Tcpuregisterset);virtual;
         {# Free multiple registers specified.}
-        procedure dealloccpuregisters(list:Taasmoutput;r:Tcpuregisterset);virtual;
+        procedure dealloccpuregisters(list:Taasmoutput;const r:Tcpuregisterset);virtual;
         function uses_registers:boolean;virtual;
         procedure add_reg_instruction(instr:Tai;r:tregister);
         procedure add_move_instruction(instr:Taicpu);
@@ -498,7 +498,7 @@ unit rgobj;
       end;
 
 
-    procedure trgobj.alloccpuregisters(list:Taasmoutput;r:Tcpuregisterset);
+    procedure trgobj.alloccpuregisters(list:Taasmoutput;const r:Tcpuregisterset);
 
     var i:Tsuperregister;
 
@@ -509,7 +509,7 @@ unit rgobj;
     end;
 
 
-    procedure trgobj.dealloccpuregisters(list:Taasmoutput;r:Tcpuregisterset);
+    procedure trgobj.dealloccpuregisters(list:Taasmoutput;const r:Tcpuregisterset);
 
     var i:Tsuperregister;
 

+ 2 - 1
compiler/symconst.pas

@@ -148,7 +148,8 @@ type
     sp_has_overloaded,
     sp_internal,  { internal symbol, not reported as unused }
     sp_strictprivate,
-    sp_strictprotected
+    sp_strictprotected,
+    sp_implicitrename
   );
   tsymoptions=set of tsymoption;
 

+ 153 - 179
compiler/symdef.pas

@@ -269,6 +269,7 @@ interface
           procedure proc_concatstabto(p :tnamedindexitem;arg:pointer);
 {$endif GDB}
           procedure count_published_properties(sym:tnamedindexitem;arg:pointer);
+          procedure collect_published_properties(sym:tnamedindexitem;arg:pointer);
           procedure write_property_info(sym : tnamedindexitem;arg:pointer);
           procedure generate_published_child_rtti(sym : tnamedindexitem;arg:pointer);
           procedure count_published_fields(sym:tnamedindexitem;arg:pointer);
@@ -312,7 +313,6 @@ interface
           function  rtti_name : string;
           procedure check_forwards;
           function  is_related(d : tdef) : boolean;override;
-          function  next_free_name_index : longint;
           procedure insertvmt;
           procedure set_parent(c : tobjectdef);
           function searchdestructor : tprocdef;
@@ -5011,6 +5011,55 @@ implementation
                               TOBJECTDEF
 ***************************************************************************}
 
+    type
+       tproptablelistitem = class(TLinkedListItem)
+          index : longint;
+          def   : tobjectdef;
+       end;
+
+       tpropnamelistitem = class(TLinkedListItem)
+          index : longint;
+          name  : stringid;
+          owner : tsymtable;
+       end;
+
+    var
+       proptablelist  : tlinkedlist;
+       propnamelist   : tlinkedlist;
+
+    function searchproptablelist(p : tobjectdef) : tproptablelistitem;
+      var
+         hp : tproptablelistitem;
+      begin
+         hp:=tproptablelistitem(proptablelist.first);
+         while assigned(hp) do
+           if hp.def=p then
+             begin
+                result:=hp;
+                exit;
+             end
+           else
+             hp:=tproptablelistitem(hp.next);
+         result:=nil;
+      end;
+
+
+    function searchpropnamelist(const n:string) : tpropnamelistitem;
+      var
+         hp : tpropnamelistitem;
+      begin
+         hp:=tpropnamelistitem(propnamelist.first);
+         while assigned(hp) do
+           if hp.name=n then
+             begin
+                result:=hp;
+                exit;
+             end
+           else
+             hp:=tpropnamelistitem(hp.next);
+         result:=nil;
+      end;
+
 
    constructor tobjectdef.create(ot : tobjectdeftype;const n : string;c : tobjectdef);
      begin
@@ -5340,41 +5389,16 @@ implementation
      end;
 
 
-(*   procedure tobjectdef._searchdestructor(sym : tnamedindexitem;arg:pointer);
-
-     var
-        p : pprocdeflist;
-
-     begin
-        { if we found already a destructor, then we exit }
-        if assigned(sd) then
-          exit;
-        if tsym(sym).typ=procsym then
-          begin
-             p:=tprocsym(sym).defs;
-             while assigned(p) do
-               begin
-                  if p^.def.proctypeoption=potype_destructor then
-                    begin
-                       sd:=p^.def;
-                       exit;
-                    end;
-                  p:=p^.next;
-               end;
-          end;
-     end;*)
-
     procedure _searchdestructor(sym:Tnamedindexitem;sd:pointer);
-
-    begin
+      begin
         { if we found already a destructor, then we exit }
         if (ppointer(sd)^=nil) and
            (Tsym(sym).typ=procsym) then
           ppointer(sd)^:=Tprocsym(sym).search_procdef_bytype(potype_destructor);
-    end;
+      end;
 
-   function tobjectdef.searchdestructor : tprocdef;
 
+   function tobjectdef.searchdestructor : tprocdef;
      var
         o : tobjectdef;
         sd : tprocdef;
@@ -5714,17 +5738,38 @@ implementation
       end;
 
 
+    procedure tobjectdef.collect_published_properties(sym:tnamedindexitem;arg:pointer);
+      var
+        hp : tpropnamelistitem;
+      begin
+         if (tsym(sym).typ=propertysym) and
+            (sp_published in tsym(sym).symoptions) then
+           begin
+             hp:=searchpropnamelist(tsym(sym).name);
+             if not(assigned(hp)) then
+               begin
+                  hp:=tpropnamelistitem.create;
+                  hp.name:=tsym(sym).name;
+                  hp.index:=propnamelist.count;
+                  hp.owner:=tsym(sym).owner;
+                  propnamelist.concat(hp);
+               end;
+          end;
+      end;
+
+
     procedure tobjectdef.count_published_properties(sym:tnamedindexitem;arg:pointer);
       begin
-         if needs_prop_entry(tsym(sym)) and
-            (tsym(sym).typ<>fieldvarsym) then
-           inc(count);
+         if (tsym(sym).typ=propertysym) and
+            (sp_published in tsym(sym).symoptions) then
+           inc(plongint(arg)^);
       end;
 
 
     procedure tobjectdef.write_property_info(sym : tnamedindexitem;arg:pointer);
       var
          proctypesinfo : byte;
+         propnameitem  : tpropnamelistitem;
 
       procedure writeproc(proc : tsymlist; shiftvalue : byte);
 
@@ -5794,62 +5839,37 @@ implementation
         end;
 
       begin
-         if needs_prop_entry(tsym(sym)) then
-           case tsym(sym).typ of
-              fieldvarsym:
-                begin
-{$ifdef dummy}
-                   if not(tvarsym(sym).vartype.def.deftype=objectdef) or
-                     not(tobjectdef(tvarsym(sym).vartype.def).is_class) then
-                     internalerror(1509992);
-                   { access to implicit class property as field }
-                   proctypesinfo:=(0 shl 0) or (0 shl 2) or (0 shl 4);
-                   rttiList.concat(Tai_const_symbol.Createname(tvarsym(sym.vartype.def.get_rtti_label),AT_DATA,0));
-                   rttiList.concat(Tai_const.create(ait_const_ptr,tvarsym(sym.address)));
-                   rttiList.concat(Tai_const.create(ait_const_ptr,tvarsym(sym.address)));
-                   { by default stored }
-                   rttiList.concat(Tai_const.Create_32bit(1));
-                   { index as well as ... }
-                   rttiList.concat(Tai_const.Create_32bit(0));
-                   { default value are zero }
-                   rttiList.concat(Tai_const.Create_32bit(0));
-                   rttiList.concat(Tai_const.Create_16bit(count));
-                   inc(count);
-                   rttiList.concat(Tai_const.Create_8bit(proctypesinfo));
-                   rttiList.concat(Tai_const.Create_8bit(length(tvarsym(sym.realname))));
-                   rttiList.concat(Tai_string.Create(tvarsym(sym.realname)));
-{$endif dummy}
-                end;
-              propertysym:
-                begin
-                   if ppo_indexed in tpropertysym(sym).propoptions then
-                     proctypesinfo:=$40
-                   else
-                     proctypesinfo:=0;
-                   rttiList.concat(Tai_const.Create_sym(tstoreddef(tpropertysym(sym).proptype.def).get_rtti_label(fullrtti)));
-                   writeproc(tpropertysym(sym).readaccess,0);
-                   writeproc(tpropertysym(sym).writeaccess,2);
-                   { isn't it stored ? }
-                   if not(ppo_stored in tpropertysym(sym).propoptions) then
-                     begin
-                        rttiList.concat(Tai_const.create_sym(nil));
-                        proctypesinfo:=proctypesinfo or (3 shl 4);
-                     end
-                   else
-                     writeproc(tpropertysym(sym).storedaccess,4);
-                   rttiList.concat(Tai_const.Create_32bit(tpropertysym(sym).index));
-                   rttiList.concat(Tai_const.Create_32bit(tpropertysym(sym).default));
-                   rttiList.concat(Tai_const.Create_16bit(count));
-                   inc(count);
-                   rttiList.concat(Tai_const.Create_8bit(proctypesinfo));
-                   rttiList.concat(Tai_const.Create_8bit(length(tpropertysym(sym).realname)));
-                   rttiList.concat(Tai_string.Create(tpropertysym(sym).realname));
+         if (tsym(sym).typ=propertysym) and
+            (sp_published in tsym(sym).symoptions) then
+           begin
+             if ppo_indexed in tpropertysym(sym).propoptions then
+               proctypesinfo:=$40
+             else
+               proctypesinfo:=0;
+             rttilist.concat(Tai_const.Create_sym(tstoreddef(tpropertysym(sym).proptype.def).get_rtti_label(fullrtti)));
+             writeproc(tpropertysym(sym).readaccess,0);
+             writeproc(tpropertysym(sym).writeaccess,2);
+             { isn't it stored ? }
+             if not(ppo_stored in tpropertysym(sym).propoptions) then
+               begin
+                  rttilist.concat(Tai_const.create_sym(nil));
+                  proctypesinfo:=proctypesinfo or (3 shl 4);
+               end
+             else
+               writeproc(tpropertysym(sym).storedaccess,4);
+             rttilist.concat(Tai_const.Create_32bit(tpropertysym(sym).index));
+             rttilist.concat(Tai_const.Create_32bit(tpropertysym(sym).default));
+             propnameitem:=searchpropnamelist(tpropertysym(sym).name);
+             if not assigned(propnameitem) then
+               internalerror(200512201);
+             rttilist.concat(Tai_const.Create_16bit(propnameitem.index));
+             rttilist.concat(Tai_const.Create_8bit(proctypesinfo));
+             rttilist.concat(Tai_const.Create_8bit(length(tpropertysym(sym).realname)));
+             rttilist.concat(Tai_string.Create(tpropertysym(sym).realname));
 {$ifdef cpurequiresproperalignment}
-                   rttilist.concat(Tai_align.Create(sizeof(TConstPtrUInt)));
+             rttilist.concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
-                end;
-              else internalerror(1509992);
-           end;
+          end;
       end;
 
 
@@ -5883,61 +5903,31 @@ implementation
       end;
 
 
-    type
-       tclasslistitem = class(TLinkedListItem)
-          index : longint;
-          p : tobjectdef;
-       end;
-
-    var
-       classtablelist : tlinkedlist;
-       tablecount : longint;
-
-    function searchclasstablelist(p : tobjectdef) : tclasslistitem;
-
-      var
-         hp : tclasslistitem;
-
-      begin
-         hp:=tclasslistitem(classtablelist.first);
-         while assigned(hp) do
-           if hp.p=p then
-             begin
-                searchclasstablelist:=hp;
-                exit;
-             end
-           else
-             hp:=tclasslistitem(hp.next);
-         searchclasstablelist:=nil;
-      end;
-
-
     procedure tobjectdef.count_published_fields(sym:tnamedindexitem;arg:pointer);
       var
-         hp : tclasslistitem;
+         hp : tproptablelistitem;
       begin
-         if needs_prop_entry(tsym(sym)) and
-          (tsym(sym).typ=fieldvarsym) then
+         if (tsym(sym).typ=fieldvarsym) and
+            (sp_published in tsym(sym).symoptions) then
           begin
              if tfieldvarsym(sym).vartype.def.deftype<>objectdef then
                internalerror(0206001);
-             hp:=searchclasstablelist(tobjectdef(tfieldvarsym(sym).vartype.def));
+             hp:=searchproptablelist(tobjectdef(tfieldvarsym(sym).vartype.def));
              if not(assigned(hp)) then
                begin
-                  hp:=tclasslistitem.create;
-                  hp.p:=tobjectdef(tfieldvarsym(sym).vartype.def);
-                  hp.index:=tablecount;
-                  classtablelist.concat(hp);
-                  inc(tablecount);
+                  hp:=tproptablelistitem.create;
+                  hp.def:=tobjectdef(tfieldvarsym(sym).vartype.def);
+                  hp.index:=proptablelist.count+1;
+                  proptablelist.concat(hp);
                end;
-             inc(count);
+             inc(plongint(arg)^);
           end;
       end;
 
 
     procedure tobjectdef.writefields(sym:tnamedindexitem;arg:pointer);
       var
-         hp : tclasslistitem;
+         hp : tproptablelistitem;
       begin
          if needs_prop_entry(tsym(sym)) and
           (tsym(sym).typ=fieldvarsym) then
@@ -5946,7 +5936,7 @@ implementation
              rttilist.concat(Tai_align.Create(sizeof(AInt)));
 {$endif cpurequiresproperalignment}
              rttiList.concat(Tai_const.Create_aint(tfieldvarsym(sym).fieldoffset));
-             hp:=searchclasstablelist(tobjectdef(tfieldvarsym(sym).vartype.def));
+             hp:=searchproptablelist(tobjectdef(tfieldvarsym(sym).vartype.def));
              if not(assigned(hp)) then
                internalerror(0206002);
              rttiList.concat(Tai_const.Create_16bit(hp.index));
@@ -5960,62 +5950,57 @@ implementation
       var
          fieldtable,
          classtable : tasmlabel;
-         hp : tclasslistitem;
-
+         hp : tproptablelistitem;
+         fieldcount : longint;
       begin
-         classtablelist:=TLinkedList.Create;
+         proptablelist:=TLinkedList.Create;
          objectlibrary.getdatalabel(fieldtable);
          objectlibrary.getdatalabel(classtable);
-         count:=0;
-         tablecount:=0;
          maybe_new_object_file(rttiList);
          new_section(rttiList,sec_rodata,classtable.name,const_align(sizeof(aint)));
          { fields }
-         symtable.foreach({$ifdef FPC}@{$endif}count_published_fields,nil);
-         rttiList.concat(Tai_label.Create(fieldtable));
-         rttiList.concat(Tai_const.Create_16bit(count));
+         fieldcount:=0;
+         symtable.foreach(@count_published_fields,@fieldcount);
+         rttilist.concat(Tai_label.Create(fieldtable));
+         rttilist.concat(Tai_const.Create_16bit(fieldcount));
 {$ifdef cpurequiresproperalignment}
          rttilist.concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
          rttiList.concat(Tai_const.Create_sym(classtable));
-         symtable.foreach({$ifdef FPC}@{$endif}writefields,nil);
+         symtable.foreach(@writefields,nil);
 
          { generate the class table }
          rttilist.concat(tai_align.create(const_align(sizeof(aint))));
-         rttiList.concat(Tai_label.Create(classtable));
-         rttiList.concat(Tai_const.Create_16bit(tablecount));
+         rttilist.concat(Tai_label.Create(classtable));
+         rttilist.concat(Tai_const.Create_16bit(proptablelist.count));
 {$ifdef cpurequiresproperalignment}
          rttilist.concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
-         hp:=tclasslistitem(classtablelist.first);
+         hp:=tproptablelistitem(proptablelist.first);
          while assigned(hp) do
            begin
-              rttiList.concat(Tai_const.Createname(tobjectdef(hp.p).vmt_mangledname,AT_DATA,0));
-              hp:=tclasslistitem(hp.next);
+              rttilist.concat(Tai_const.Createname(tobjectdef(hp.def).vmt_mangledname,AT_DATA,0));
+              hp:=tproptablelistitem(hp.next);
            end;
 
          generate_field_table:=fieldtable;
-         classtablelist.free;
+         proptablelist.free;
+         proptablelist:=nil;
       end;
 
 
-    function tobjectdef.next_free_name_index : longint;
-      var
-         i : longint;
-      begin
-         if assigned(childof) and (oo_can_have_published in childof.objectoptions) then
-           i:=childof.next_free_name_index
-         else
-           i:=0;
-         count:=0;
-         symtable.foreach(@count_published_properties,nil);
-         next_free_name_index:=i+count;
-      end;
+    procedure tobjectdef.write_rtti_data(rt:trttitype);
 
+        procedure collect_unique_published_props(pd:tobjectdef);
+        begin
+          if assigned(pd.childof) then
+            collect_unique_published_props(pd.childof);
+          pd.symtable.foreach(@collect_published_properties,nil);
+        end;
 
-    procedure tobjectdef.write_rtti_data(rt:trttitype);
       var
         i : longint;
+        propcount : longint;
       begin
          case objecttype of
             odt_class:
@@ -6051,6 +6036,10 @@ implementation
              end;
            fullrtti :
              begin
+               { Collect unique property names with nameindex }
+               propnamelist:=TLinkedList.Create;
+               collect_unique_published_props(self);
+
                if not(objecttype in [odt_interfacecom,odt_interfacecorba]) then
                  begin
                    if (oo_has_vmt in objectoptions) then
@@ -6068,15 +6057,8 @@ implementation
 
                if objecttype in [odt_object,odt_class] then
                  begin
-                   { count total number of properties }
-                   if assigned(childof) and (oo_can_have_published in childof.objectoptions) then
-                     count:=childof.next_free_name_index
-                   else
-                     count:=0;
-
-                   { write it }
-                   symtable.foreach(@count_published_properties,nil);
-                   rttiList.concat(Tai_const.Create_16bit(count));
+                   { total number of unique properties }
+                   rttilist.concat(Tai_const.Create_16bit(propnamelist.count));
                  end
                else
                  { interface: write flags, iid and iidstr }
@@ -6124,28 +6106,20 @@ implementation
 {$endif cpurequiresproperalignment}
                  end;
 
+               { write published properties for this object }
                if objecttype in [odt_object,odt_class] then
                  begin
-                   { write published properties count }
-                   count:=0;
-                   symtable.foreach(@count_published_properties,nil);
-                   rttiList.concat(Tai_const.Create_16bit(count));
-
+                   propcount:=0;
+                   symtable.foreach(@count_published_properties,@propcount);
+                   rttilist.concat(Tai_const.Create_16bit(propcount));
 {$ifdef cpurequiresproperalignment}
                    rttilist.concat(Tai_align.Create(sizeof(TConstPtrUInt)));
 {$endif cpurequiresproperalignment}
                  end;
-
-               { count is used to write nameindex   }
-
-               { but we need an offset of the owner }
-               { to give each property an own slot  }
-               if assigned(childof) and (oo_can_have_published in childof.objectoptions) then
-                 count:=childof.next_free_name_index
-               else
-                 count:=0;
-
                symtable.foreach(@write_property_info,nil);
+
+               propnamelist.free;
+               propnamelist:=nil;
              end;
          end;
       end;

+ 1 - 0
compiler/symtable.pas

@@ -1815,6 +1815,7 @@ implementation
           begin
             inc(dupnr);
             dupsym.name:='dup'+tostr(dupnr)+dupsym.name;
+            include(tsym(dupsym).symoptions,sp_implicitrename);
           end;
       end;
 

+ 12 - 9
compiler/symtype.pas

@@ -165,7 +165,7 @@ interface
         next   : psymlistitem;
         case byte of
           0 : (sym : tsym; symderef : tderef);
-          1 : (value  : TConstExprInt);
+          1 : (value  : TConstExprInt; valuett: ttype);
           2 : (tt : ttype);
       end;
 
@@ -179,7 +179,7 @@ interface
         function  empty:boolean;
         procedure addsym(slt:tsltype;p:tsym);
         procedure addsymderef(slt:tsltype;const d:tderef);
-        procedure addconst(slt:tsltype;v:TConstExprInt);
+        procedure addconst(slt:tsltype;v:TConstExprInt;const tt:ttype);
         procedure addtype(slt:tsltype;const tt:ttype);
         procedure clear;
         function  getcopy:tsymlist;
@@ -707,7 +707,7 @@ implementation
       end;
 
 
-    procedure tsymlist.addconst(slt:tsltype;v:TConstExprInt);
+    procedure tsymlist.addconst(slt:tsltype;v:TConstExprInt;const tt:ttype);
       var
         hp : psymlistitem;
       begin
@@ -715,6 +715,7 @@ implementation
         fillchar(hp^,sizeof(tsymlistitem),0);
         hp^.sltype:=slt;
         hp^.value:=v;
+        hp^.valuett:=tt;
         if assigned(lastsym) then
          lastsym^.next:=hp
         else
@@ -777,11 +778,10 @@ implementation
              sl_load,
              sl_subscript :
                hp^.sym:=tsym(hp^.symderef.resolve);
+             sl_vec,
              sl_absolutetype,
              sl_typeconv :
                hp^.tt.resolve;
-             sl_vec :
-               ;
              else
               internalerror(200110205);
            end;
@@ -803,11 +803,10 @@ implementation
              sl_load,
              sl_subscript :
                hp^.symderef.build(hp^.sym);
+             sl_vec,
              sl_absolutetype,
              sl_typeconv :
                hp^.tt.buildderef;
-             sl_vec :
-               ;
              else
               internalerror(200110205);
            end;
@@ -1263,7 +1262,8 @@ implementation
             sl_vec :
               begin
                 idx:=getlongint;
-                p.addconst(slt,idx);
+                gettype(tt);
+                p.addconst(slt,idx,tt);
               end;
             else
               internalerror(200110204);
@@ -1423,7 +1423,10 @@ implementation
              sl_typeconv :
                puttype(hp^.tt);
              sl_vec :
-               putlongint(hp^.value);
+               begin
+                 putlongint(hp^.value);
+                 puttype(hp^.valuett);
+               end;
              else
               internalerror(200110205);
            end;

+ 2 - 4
compiler/systems/t_go32v2.pas

@@ -231,10 +231,8 @@ begin
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
   Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
-  if source_info.system=system_i386_go32v2 then
-    Replace(cmdstr,'$RES','@'+maybequoted(outputexedir+Info.ResName))
-  else
-    Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
+  Replace(cmdstr,'$RES','@'+maybequoted(outputexedir+Info.ResName));
+(* Potential issues with older ld version??? *)
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$SCRIPT','--script='+maybequoted(outputexedir+Info.ScriptName));
   success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);

+ 2 - 0
compiler/tokens.pas

@@ -165,6 +165,7 @@ type
     _RECORD,
     _REPEAT,
     _RESULT,
+    _RETURN,
     _STATIC,
     _STORED,
     _STRICT,
@@ -402,6 +403,7 @@ const
       (str:'RECORD'        ;special:false;keyword:m_all;op:NOTOKEN),
       (str:'REPEAT'        ;special:false;keyword:m_all;op:NOTOKEN),
       (str:'RESULT'        ;special:false;keyword:m_none;op:NOTOKEN),
+      (str:'RETURN'        ;special:false;keyword:m_mac;op:NOTOKEN),
       (str:'STATIC'        ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'STORED'        ;special:false;keyword:m_none;op:NOTOKEN),
       (str:'STRICT'        ;special:false;keyword:m_none;op:NOTOKEN),

+ 13 - 8
compiler/utils/ppumove.pp

@@ -36,7 +36,7 @@ const
   Title     = 'PPU-Mover';
   Copyright = 'Copyright (c) 1998-2005 by the Free Pascal Development Team';
 
-  ShortOpts = 'o:e:d:qhsvbw';
+  ShortOpts = 'o:e:d:i:qhsvbw';
   BufSize = 4096;
   PPUExt = 'ppu';
   ObjExt = 'o';
@@ -67,6 +67,7 @@ Var
   ArBin,LDBin,StripBin,
   OutputFile,
   OutputFileForLink,  { the name of the output file needed when linking }
+  InputPath,
   DestPath,
   PPLExt,
   LibExt      : string;
@@ -422,13 +423,13 @@ var
 {$endif}
 begin
 {$ifdef unix}
-  DoFile:=DoPPU(FileName,ForceExtension(FileName,PPLExt));
+  DoFile:=DoPPU(InputPath+FileName,InputPath+ForceExtension(FileName,PPLExt));
 {$else}
   DoFile:=false;
   findfirst(filename,$20,dir);
   while doserror=0 do
    begin
-     if not DoPPU(Dir.Name,ForceExtension(Dir.Name,PPLExt)) then
+     if not DoPPU(InputPath+Dir.Name,InputPath+ForceExtension(Dir.Name,PPLExt)) then
       exit;
      findnext(dir);
    end;
@@ -440,11 +441,10 @@ end;
 
 Procedure DoLink;
 {
-  Link the object files together to form a (shared) library, the only
-  problem here is the 255 char limit of Names
+  Link the object files together to form a (shared) library
 }
 Var
-  Names : String;
+  Names : ansistring;
   f     : file;
   Err   : boolean;
   P     : PLinkOEnt;
@@ -456,9 +456,9 @@ begin
   While p<>nil do
    begin
      if Names<>'' then
-      Names:=Names+' '+P^.name
+      Names:=Names+' '+InputPath+P^.name
      else
-      Names:=p^.Name;
+      Names:=InputPath+p^.Name;
      p:=p^.next;
    end;
   if Names='' then
@@ -530,6 +530,11 @@ begin
       'S' : MakeStatic:=True;
       'o' : OutputFile:=OptArg;
       'd' : DestPath:=OptArg;
+      'i' : begin
+              InputPath:=OptArg;
+              if InputPath[length(InputPath)]<>DirectorySeparator then
+                InputPath:=InputPath+DirectorySeparator;
+            end;
       'e' : PPLext:=OptArg;
       'q' : Quiet:=True;
       'w' : begin

+ 4 - 4
compiler/x86/cgx86.pas

@@ -44,8 +44,8 @@ unit cgx86;
 
         procedure getcpuregister(list:Taasmoutput;r:Tregister);override;
         procedure ungetcpuregister(list:Taasmoutput;r:Tregister);override;
-        procedure alloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);override;
-        procedure dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);override;
+        procedure alloccpuregisters(list:Taasmoutput;rt:Tregistertype;const r:Tcpuregisterset);override;
+        procedure dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;const r:Tcpuregisterset);override;
         function  uses_registers(rt:Tregistertype):boolean;override;
         procedure add_reg_instruction(instr:Tai;r:tregister);override;
         procedure dec_fpu_stack;
@@ -210,14 +210,14 @@ unit cgx86;
       end;
 
 
-    procedure Tcgx86.alloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);
+    procedure Tcgx86.alloccpuregisters(list:Taasmoutput;rt:Tregistertype;const r:Tcpuregisterset);
       begin
         if rt<>R_FPUREGISTER then
           inherited alloccpuregisters(list,rt,r);
       end;
 
 
-    procedure Tcgx86.dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;r:Tcpuregisterset);
+    procedure Tcgx86.dealloccpuregisters(list:Taasmoutput;rt:Tregistertype;const r:Tcpuregisterset);
       begin
         if rt<>R_FPUREGISTER then
           inherited dealloccpuregisters(list,rt,r);

+ 48 - 7
fcl/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/10]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -231,7 +231,7 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 override PACKAGE_NAME=fcl
-override PACKAGE_VERSION=2.0.3
+override PACKAGE_VERSION=2.0.0
 ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
 CLASSES10=classes
 endif
@@ -392,7 +392,7 @@ ifeq ($(FULL_TARGET),i386-netwlibc)
 override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex  resolve ssockets syncobjs
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex
+override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex  process fileinfo resolve ssockets syncobjs simpleipc msgintf dbugintf
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex  process resolve ssockets fpasync syncobjs simpleipc msgintf dbugintf
@@ -452,7 +452,7 @@ ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex  process resolve ssockets fpasync syncobjs simpleipc msgintf dbugintf
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex
+override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex  process fileinfo resolve ssockets syncobjs simpleipc msgintf dbugintf
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_UNITS+=$(CLASSES10) contnrs inifiles ezcgi pipes rtfpars idea base64 gettext iostream zstream cachecls avl_tree xmlreg registry eventlog custapp cgiapp wformat whtml wtex rttiutils bufstream streamex  process resolve ssockets fpasync syncobjs simpleipc msgintf dbugintf
@@ -1353,6 +1353,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -2030,8 +2031,11 @@ ifeq ($(FULL_TARGET),i386-wince)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_PASZLIB=1
-REQUIRE_PACKAGES_PASJPEG=1
 REQUIRE_PACKAGES_NETDB=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_IBASE=1
+REQUIRE_PACKAGES_POSTGRES=1
+REQUIRE_PACKAGES_SQLITE=1
 REQUIRE_PACKAGES_LIBASYNC=1
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
@@ -2258,8 +2262,11 @@ ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_PASZLIB=1
-REQUIRE_PACKAGES_PASJPEG=1
 REQUIRE_PACKAGES_NETDB=1
+REQUIRE_PACKAGES_PASJPEG=1
+REQUIRE_PACKAGES_IBASE=1
+REQUIRE_PACKAGES_POSTGRES=1
+REQUIRE_PACKAGES_SQLITE=1
 REQUIRE_PACKAGES_LIBASYNC=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
@@ -2695,6 +2702,12 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 endif
 endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
 endif
@@ -2715,6 +2728,14 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
@@ -2795,6 +2816,26 @@ vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef $(SHARED_LIBNAME)
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef LIB_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS)
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME)
+else
+	@$(ECHO) Shared Libraries not supported
+endif
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 ifdef INSTALL_UNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
@@ -3930,7 +3971,7 @@ smart: fpc_smart
 release: fpc_release
 units: fpc_units $(addsuffix _units,$(TARGET_DIRS))
 examples: fpc_examples $(addsuffix _examples,$(TARGET_DIRS))
-shared: $(addsuffix _shared,$(TARGET_DIRS))
+shared: fpc_shared
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
 sourceinstall: fpc_sourceinstall
 exampleinstall: fpc_exampleinstall $(addsuffix _exampleinstall,$(TARGET_DIRS))

+ 3 - 1
fcl/Makefile.fpc

@@ -4,7 +4,7 @@
 
 [package]
 name=fcl
-version=2.0.3
+version=2.0.0
 
 [require]
 packages=paszlib hash
@@ -14,6 +14,7 @@ packages_darwin=netdb libasync pthreads
 packages_netbsd=netdb libasync
 packages_openbsd=netdb libasync
 packages_win32=netdb
+packages_wince=netdb
 packages_os2=netdb
 packages_emx=netdb
 
@@ -32,6 +33,7 @@ units_netbsd=process ssockets resolve fpasync simpleipc msgintf dbugintf
 units_openbsd=process ssockets resolve fpasync simpleipc msgintf dbugintf
 units_linux=process resolve ssockets fpasync syncobjs simpleipc msgintf dbugintf
 units_win32=process fileinfo resolve ssockets syncobjs simpleipc msgintf dbugintf
+units_wince=process fileinfo resolve ssockets syncobjs simpleipc msgintf dbugintf
 units_os2=resolve ssockets
 units_emx=resolve ssockets
 units_netware=resolve ssockets

+ 51 - 4
fcl/db/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/10]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -278,7 +278,7 @@ ifeq ($(FULL_TARGET),i386-netwlibc)
 override TARGET_DIRS+=sdf memds sqldb
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_DIRS+=sdf memds sqldb
+override TARGET_DIRS+=sdf memds sqldb  interbase sqlite dbase
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_DIRS+=sdf memds sqldb  mysql interbase sqlite dbase
@@ -338,7 +338,7 @@ ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_DIRS+=sdf memds sqldb  mysql interbase sqlite dbase
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_DIRS+=sdf memds sqldb
+override TARGET_DIRS+=sdf memds sqldb  interbase sqlite dbase
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_DIRS+=sdf memds sqldb  mysql interbase sqlite dbase
@@ -1017,6 +1017,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1615,6 +1616,9 @@ REQUIRE_PACKAGES_RTL=1
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_IBASE=1
+REQUIRE_PACKAGES_POSTGRES=1
+REQUIRE_PACKAGES_SQLITE=1
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -1735,6 +1739,9 @@ REQUIRE_PACKAGES_SQLITE=1
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_IBASE=1
+REQUIRE_PACKAGES_POSTGRES=1
+REQUIRE_PACKAGES_SQLITE=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -2007,6 +2014,12 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 endif
 endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
 endif
@@ -2027,6 +2040,14 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
@@ -2107,6 +2128,26 @@ vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef $(SHARED_LIBNAME)
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef LIB_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS)
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME)
+else
+	@$(ECHO) Shared Libraries not supported
+endif
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 ifdef INSTALL_UNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
@@ -2447,6 +2488,9 @@ ifeq ($(FULL_TARGET),i386-wince)
 TARGET_DIRS_SDF=1
 TARGET_DIRS_MEMDS=1
 TARGET_DIRS_SQLDB=1
+TARGET_DIRS_INTERBASE=1
+TARGET_DIRS_SQLITE=1
+TARGET_DIRS_DBASE=1
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 TARGET_DIRS_SDF=1
@@ -2590,6 +2634,9 @@ ifeq ($(FULL_TARGET),arm-wince)
 TARGET_DIRS_SDF=1
 TARGET_DIRS_MEMDS=1
 TARGET_DIRS_SQLDB=1
+TARGET_DIRS_INTERBASE=1
+TARGET_DIRS_SQLITE=1
+TARGET_DIRS_DBASE=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 TARGET_DIRS_SDF=1
@@ -3077,7 +3124,7 @@ smart: fpc_smart
 release: fpc_release
 units: fpc_units $(addsuffix _units,$(TARGET_DIRS))
 examples: fpc_examples $(addsuffix _examples,$(TARGET_DIRS))
-shared: $(addsuffix _shared,$(TARGET_DIRS))
+shared: fpc_shared
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
 sourceinstall: fpc_sourceinstall
 exampleinstall: fpc_exampleinstall $(addsuffix _exampleinstall,$(TARGET_DIRS))

+ 1 - 0
fcl/db/Makefile.fpc

@@ -14,6 +14,7 @@ dirs_darwin=mysql interbase sqlite
 dirs_netbsd=mysql interbase sqlite
 dirs_openbsd=mysql interbase sqlite
 dirs_win32=mysql interbase sqlite dbase
+dirs_wince=interbase sqlite dbase
 units=dbconst db ddg_ds ddg_rec dbwhtml
 exampledirs=tests
 rsts=dbwhtml dbconst

+ 55 - 2
fcl/db/sqldb/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/10]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -247,6 +247,9 @@ endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 override TARGET_DIRS+=interbase postgres mysql odbc
 endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_DIRS+=interbase postgres
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_DIRS+=interbase postgres mysql odbc
 endif
@@ -283,6 +286,9 @@ endif
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_DIRS+=interbase postgres mysql odbc
 endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_DIRS+=interbase postgres
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_DIRS+=interbase postgres mysql odbc
 endif
@@ -849,6 +855,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1442,6 +1449,8 @@ REQUIRE_PACKAGES_RTL=1
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_IBASE=1
+REQUIRE_PACKAGES_POSTGRES=1
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -1550,6 +1559,8 @@ REQUIRE_PACKAGES_ODBC=1
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_IBASE=1
+REQUIRE_PACKAGES_POSTGRES=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
@@ -1795,6 +1806,12 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 endif
 endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
 endif
@@ -1815,6 +1832,14 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
@@ -1877,6 +1902,26 @@ vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef $(SHARED_LIBNAME)
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef LIB_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS)
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME)
+else
+	@$(ECHO) Shared Libraries not supported
+endif
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 ifdef INSTALL_UNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
@@ -2150,6 +2195,10 @@ TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_MYSQL=1
 TARGET_DIRS_ODBC=1
 endif
+ifeq ($(FULL_TARGET),i386-wince)
+TARGET_DIRS_INTERBASE=1
+TARGET_DIRS_POSTGRES=1
+endif
 ifeq ($(FULL_TARGET),m68k-linux)
 TARGET_DIRS_INTERBASE=1
 TARGET_DIRS_POSTGRES=1
@@ -2222,6 +2271,10 @@ TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_MYSQL=1
 TARGET_DIRS_ODBC=1
 endif
+ifeq ($(FULL_TARGET),arm-wince)
+TARGET_DIRS_INTERBASE=1
+TARGET_DIRS_POSTGRES=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 TARGET_DIRS_INTERBASE=1
 TARGET_DIRS_POSTGRES=1
@@ -2414,7 +2467,7 @@ smart: fpc_smart
 release: fpc_release
 units: fpc_units $(addsuffix _units,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
-shared: $(addsuffix _shared,$(TARGET_DIRS))
+shared: fpc_shared
 install: fpc_install $(addsuffix _install,$(TARGET_DIRS))
 sourceinstall: fpc_sourceinstall
 exampleinstall: fpc_exampleinstall $(addsuffix _exampleinstall,$(TARGET_DIRS))

+ 1 - 0
fcl/db/sqldb/Makefile.fpc

@@ -12,6 +12,7 @@ dirs_darwin=interbase postgres mysql odbc
 dirs_netbsd=interbase postgres mysql odbc
 dirs_openbsd=interbase postgres mysql odbc
 dirs_win32=interbase postgres mysql odbc
+dirs_wince=interbase postgres 
 units=sqldb
 rsts=sqldb
 

+ 8 - 8
fcl/inc/contnrs.pp

@@ -64,7 +64,7 @@ Type
     property List: TFPList read FList;
   end;
 
-  
+
   TObjectList = class(TList)
   private
     ffreeobjects : boolean;
@@ -171,16 +171,16 @@ Type
     Function Pop: TObject;
     Function Peek: TObject;
   end;
-  
+
 { ---------------------------------------------------------------------
     Hash support, implemented by Dean Zobec
   ---------------------------------------------------------------------}
- 
+
 
   { Must return a Longword value in the range 0..TableSize,
    usually via a mod operator;  }
   THashFunction = function(const S: string; const TableSize: Longword): Longword;
-  
+
   TIteratorMethod = procedure(Item: Pointer; const Key: string;
      var Continue: Boolean) of object;
 
@@ -212,7 +212,7 @@ Type
     function GetVoidSlots: Longword;
     function GetLoadFactor: double;
     function GetAVGChainLen: double;
-    function GetMaxChainLength: Longword;
+    function GetMaxChainLength: Int64;
     function Chain(const index: Longword):TFPObjectList;
   protected
     function ChainLength(const ChainIndex: Longword): Longword; virtual;
@@ -256,7 +256,7 @@ ResourceString
   DuplicateMsg = 'An item with key %0:s already exists';
   KeyNotFoundMsg = 'Method: %0:s key [''%1:s''] not found in container';
   NotEmptyMsg = 'Hash table not empty.';
-  
+
 const
   NPRIMES = 28;
 
@@ -828,7 +828,7 @@ begin
  end;
  Result := (Result and $7FFFFFFF) mod TableSize;
 end;
-  
+
 { THTNode }
 
 constructor THTNode.CreateWith(const AString: string);
@@ -1131,7 +1131,7 @@ begin
   result := Count / (FHashTableSize - VoidSlots);
 end;
 
-function TFPHashTable.GetMaxChainLength: Longword;
+function TFPHashTable.GetMaxChainLength: Int64;
 var
   i: Longword;
 begin

+ 7 - 7
ide/weditor.pas

@@ -1167,8 +1167,8 @@ function BMBScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): Sw
 Var
   buffer : Array[0..MaxBufLength-1] of Byte Absolute block;
   s2     : String;
-  len,
-  numb   : Sw_word;
+  len    : Sw_Word;
+  numb   : Sw_Integer;
   found  : Boolean;
 begin
   len:=length(str);
@@ -1179,8 +1179,8 @@ begin
    end;
   s2[0]:=chr(len);       { sets the length to that of the search String }
   found:=False;
-  numb:=size-pred(len);
-  While (not found) and (numb>0) do
+  numb:=size-len;
+  While (not found) and (numb>=0) do
    begin
      { partial match }
      if buffer[numb] = ord(str[1]) then
@@ -1211,8 +1211,8 @@ function BMBIScan(var Block; Size: Sw_Word;const Str: String;const bt:BTable): S
 Var
   buffer : Array[0..MaxBufLength-1] of Char Absolute block;
   len,
-  numb,
-  x      : Sw_word;
+  x      : Sw_Word;
+  numb   : Sw_Integer;
   found  : Boolean;
   p      : pchar;
   c      : char;
@@ -1225,7 +1225,7 @@ begin
    end;
   found:=False;
   numb:=size-len;
-  While (not found) and (numb>0) do
+  While (not found) and (numb>=0) do
    begin
      { partial match }
      c:=buffer[numb];

+ 114 - 16
packages/base/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/10]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -231,19 +231,19 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc graph
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint graph
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint mysql ibase odbc sqlite postgres
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint mysql ibase odbc sqlite postgres graph
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc sqlite pthreads
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync graph mysql ibase postgres oracle odbc sqlite pthreads
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
@@ -276,13 +276,13 @@ ifeq ($(FULL_TARGET),i386-netwlibc)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  ibase sqlite postgres
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc graph
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc sqlite pthreads
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync graph mysql ibase postgres oracle odbc sqlite pthreads
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc
@@ -300,7 +300,7 @@ ifeq ($(FULL_TARGET),m68k-palmos)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc graph
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc
@@ -315,7 +315,7 @@ ifeq ($(FULL_TARGET),powerpc-morphos)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc graph
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc
@@ -324,22 +324,22 @@ ifeq ($(FULL_TARGET),sparc-solaris)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc graph
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc sqlite pthreads
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync graph mysql ibase postgres oracle odbc sqlite pthreads
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc graph
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  ibase sqlite postgres
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite libc graph
 endif
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCSUBDIR=packages/base
@@ -546,6 +546,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1178,6 +1179,12 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 endif
 endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
 ifdef OPT
 override FPCOPT+=$(OPT)
 endif
@@ -1192,6 +1199,14 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
@@ -1204,6 +1219,26 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 endif
+.PHONY: fpc_shared
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef $(SHARED_LIBNAME)
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef LIB_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS)
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME)
+else
+	@$(ECHO) Shared Libraries not supported
+endif
 .PHONY: fpc_clean fpc_cleanall fpc_distclean
 ifdef EXEFILES
 override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
@@ -1393,6 +1428,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_LIBC=1
+TARGET_DIRS_GRAPH=1
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 TARGET_DIRS_HASH=1
@@ -1401,6 +1437,7 @@ TARGET_DIRS_PASJPEG=1
 TARGET_DIRS_REGEXPR=1
 TARGET_DIRS_NETDB=1
 TARGET_DIRS_GDBINT=1
+TARGET_DIRS_GRAPH=1
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 TARGET_DIRS_HASH=1
@@ -1414,6 +1451,7 @@ TARGET_DIRS_IBASE=1
 TARGET_DIRS_ODBC=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_POSTGRES=1
+TARGET_DIRS_GRAPH=1
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 TARGET_DIRS_HASH=1
@@ -1430,6 +1468,7 @@ TARGET_DIRS_REGEXPR=1
 TARGET_DIRS_NETDB=1
 TARGET_DIRS_GDBINT=1
 TARGET_DIRS_LIBASYNC=1
+TARGET_DIRS_GRAPH=1
 TARGET_DIRS_MYSQL=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_POSTGRES=1
@@ -1528,6 +1567,9 @@ TARGET_DIRS_PASZLIB=1
 TARGET_DIRS_PASJPEG=1
 TARGET_DIRS_REGEXPR=1
 TARGET_DIRS_NETDB=1
+TARGET_DIRS_IBASE=1
+TARGET_DIRS_SQLITE=1
+TARGET_DIRS_POSTGRES=1
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 TARGET_DIRS_HASH=1
@@ -1545,6 +1587,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_LIBC=1
+TARGET_DIRS_GRAPH=1
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 TARGET_DIRS_HASH=1
@@ -1554,6 +1597,7 @@ TARGET_DIRS_REGEXPR=1
 TARGET_DIRS_NETDB=1
 TARGET_DIRS_GDBINT=1
 TARGET_DIRS_LIBASYNC=1
+TARGET_DIRS_GRAPH=1
 TARGET_DIRS_MYSQL=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_POSTGRES=1
@@ -1627,6 +1671,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_LIBC=1
+TARGET_DIRS_GRAPH=1
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 TARGET_DIRS_HASH=1
@@ -1687,6 +1732,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_LIBC=1
+TARGET_DIRS_GRAPH=1
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 TARGET_DIRS_HASH=1
@@ -1725,6 +1771,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_LIBC=1
+TARGET_DIRS_GRAPH=1
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 TARGET_DIRS_HASH=1
@@ -1734,6 +1781,7 @@ TARGET_DIRS_REGEXPR=1
 TARGET_DIRS_NETDB=1
 TARGET_DIRS_GDBINT=1
 TARGET_DIRS_LIBASYNC=1
+TARGET_DIRS_GRAPH=1
 TARGET_DIRS_MYSQL=1
 TARGET_DIRS_IBASE=1
 TARGET_DIRS_POSTGRES=1
@@ -1765,6 +1813,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_LIBC=1
+TARGET_DIRS_GRAPH=1
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 TARGET_DIRS_HASH=1
@@ -1772,6 +1821,9 @@ TARGET_DIRS_PASZLIB=1
 TARGET_DIRS_PASJPEG=1
 TARGET_DIRS_REGEXPR=1
 TARGET_DIRS_NETDB=1
+TARGET_DIRS_IBASE=1
+TARGET_DIRS_SQLITE=1
+TARGET_DIRS_POSTGRES=1
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 TARGET_DIRS_HASH=1
@@ -1789,6 +1841,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_LIBC=1
+TARGET_DIRS_GRAPH=1
 endif
 ifdef TARGET_DIRS_HASH
 hash_all:
@@ -2465,13 +2518,58 @@ libc:
 	$(MAKE) -C libc all
 .PHONY: libc_all libc_debug libc_smart libc_release libc_units libc_examples libc_shared libc_install libc_sourceinstall libc_exampleinstall libc_distinstall libc_zipinstall libc_zipsourceinstall libc_zipexampleinstall libc_zipdistinstall libc_clean libc_distclean libc_cleanall libc_info libc_makefiles libc
 endif
+ifdef TARGET_DIRS_GRAPH
+graph_all:
+	$(MAKE) -C graph all
+graph_debug:
+	$(MAKE) -C graph debug
+graph_smart:
+	$(MAKE) -C graph smart
+graph_release:
+	$(MAKE) -C graph release
+graph_units:
+	$(MAKE) -C graph units
+graph_examples:
+	$(MAKE) -C graph examples
+graph_shared:
+	$(MAKE) -C graph shared
+graph_install:
+	$(MAKE) -C graph install
+graph_sourceinstall:
+	$(MAKE) -C graph sourceinstall
+graph_exampleinstall:
+	$(MAKE) -C graph exampleinstall
+graph_distinstall:
+	$(MAKE) -C graph distinstall
+graph_zipinstall:
+	$(MAKE) -C graph zipinstall
+graph_zipsourceinstall:
+	$(MAKE) -C graph zipsourceinstall
+graph_zipexampleinstall:
+	$(MAKE) -C graph zipexampleinstall
+graph_zipdistinstall:
+	$(MAKE) -C graph zipdistinstall
+graph_clean:
+	$(MAKE) -C graph clean
+graph_distclean:
+	$(MAKE) -C graph distclean
+graph_cleanall:
+	$(MAKE) -C graph cleanall
+graph_info:
+	$(MAKE) -C graph info
+graph_makefiles:
+	$(MAKE) -C graph makefiles
+graph:
+	$(MAKE) -C graph all
+.PHONY: graph_all graph_debug graph_smart graph_release graph_units graph_examples graph_shared graph_install graph_sourceinstall graph_exampleinstall graph_distinstall graph_zipinstall graph_zipsourceinstall graph_zipexampleinstall graph_zipdistinstall graph_clean graph_distclean graph_cleanall graph_info graph_makefiles graph
+endif
 all: $(addsuffix _all,$(TARGET_DIRS))
 debug: $(addsuffix _debug,$(TARGET_DIRS))
 smart: $(addsuffix _smart,$(TARGET_DIRS))
 release: $(addsuffix _release,$(TARGET_DIRS))
 units: $(addsuffix _units,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
-shared: $(addsuffix _shared,$(TARGET_DIRS))
+shared: fpc_shared
 install: $(addsuffix _install,$(TARGET_DIRS))
 sourceinstall: $(addsuffix _sourceinstall,$(TARGET_DIRS))
 exampleinstall: $(addsuffix _exampleinstall,$(TARGET_DIRS))

+ 5 - 4
packages/base/Makefile.fpc

@@ -5,14 +5,15 @@
 [target]
 dirs=hash paszlib pasjpeg regexpr netdb
 dirs_linux=gdbint libasync mysql ibase postgres oracle odbc \
-            pthreads sqlite libc
-dirs_win32=gdbint mysql ibase odbc sqlite postgres
-dirs_go32v2=gdbint
+            pthreads sqlite libc graph
+dirs_win32=gdbint mysql ibase odbc sqlite postgres graph
+dirs_wince=ibase sqlite postgres
+dirs_go32v2=gdbint graph
 dirs_netbsd=gdbint libasync \
             mysql ibase postgres oracle odbc 
 dirs_openbsd=gdbint libasync \
             mysql ibase postgres oracle odbc 
-dirs_freebsd=gdbint libasync \
+dirs_freebsd=gdbint libasync graph \
              mysql ibase postgres oracle odbc sqlite pthreads
 dirs_darwin=libasync \
              mysql ibase postgres oracle odbc sqlite pthreads

+ 2180 - 0
packages/base/graph/Makefile

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

+ 89 - 0
packages/base/graph/Makefile.fpc

@@ -0,0 +1,89 @@
+#
+#   Makefile.fpc for Free Component Library
+#
+
+[package]
+name=graph
+version=2.1
+
+[require]
+libc=y
+
+# clean package units
+[clean]
+units=$(GGIGRAPH_UNIT) $(GRPAH_UNIT)
+
+[target]
+dirs=
+units=
+units_linux=$(GRPAH_UNIT) $(GGIGRAPH_UNIT)
+units_freebsd=graph $(GGIGRAPH_UNIT)
+units_win32=graph wincrt winmouse
+units_go32v2=graph
+units_amiga=graph
+
+[compiler]
+options=-S2
+includedir=$(OS_TARGET) inc
+includedir_linux=unix
+includedir_freebsd=unix
+includedir_darwin=unix
+includedir_netbsd=unix
+includedir_openbsd=unix
+sourcedir=$(OS_TARGET) inc
+
+[libs]
+libname=fpgraph
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../../..
+
+[prerules]
+GRAPHDIR=inc
+UNIXINC=unix
+
+ifndef USELIBGGI
+USELIBGGI=NO
+endif
+
+GGIGRAPH_UNIT=ggigraph
+GRAPH_UNIT=graph
+GRAPHUNIT_DIR=$(OS_TARGET)
+
+ifeq ($(OS_TARGET),linux)
+GRAPHUNIT_DIR=unix
+UNIXINCDEPS=$(UNIXINC)/graph16.inc
+
+ifeq ($(CPU_TARGET),powerpc64)
+GGIGRAPH_UNIT=
+endif
+
+ifneq ($(CPU_TARGET),i386)
+GRAPH_UNIT=
+endif
+endif
+
+ifeq ($(OS_TARGET),freebsd)
+GRAPHUNIT_DIR=unix
+UNIXINCDEPS=$(UNIXINC)/graph16.inc
+endif
+
+[rules]
+include inc/makefile.inc
+GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES)) $(UNIXINCDEPS)
+
+graph$(PPUEXT) : graph.pp $(GRAPHINCDEPS)
+        $(COMPILER) -I$(GRAPHDIR) $(GRAPHUNIT_DIR)/graph.pp
+
+ggigraph$(PPUEXT) : $(UNIXINC)/ggigraph.pp $(GRAPHINCDEPS)
+        $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/ggigraph.pp
+
+winmouse$(PPUEXT) : win32/winmouse.pp graph$(PPUEXT)
+	$(COMPILER) win32/winmouse.pp
+
+wincrt$(PPUEXT) : win32/wincrt.pp graph$(PPUEXT)
+        $(COMPILER) win32/wincrt.pp
+

+ 0 - 0
rtl/amiga/graph.pp → packages/base/graph/amiga/graph.pp


+ 0 - 0
rtl/go32v2/graph.pp → packages/base/graph/go32v2/graph.pp


+ 0 - 0
rtl/inc/graph/clip.inc → packages/base/graph/inc/clip.inc


+ 0 - 0
rtl/inc/graph/fills.inc → packages/base/graph/inc/fills.inc


+ 0 - 0
rtl/inc/graph/fontdata.inc → packages/base/graph/inc/fontdata.inc


+ 0 - 0
rtl/inc/graph/graph.inc → packages/base/graph/inc/graph.inc


+ 0 - 0
rtl/inc/graph/graph.tex → packages/base/graph/inc/graph.tex


+ 0 - 0
rtl/inc/graph/graphh.inc → packages/base/graph/inc/graphh.inc


+ 0 - 0
rtl/inc/graph/gtext.inc → packages/base/graph/inc/gtext.inc


+ 0 - 0
rtl/inc/graph/makefile.inc → packages/base/graph/inc/makefile.inc


+ 0 - 0
rtl/inc/graph/modes.inc → packages/base/graph/inc/modes.inc


+ 0 - 0
rtl/inc/graph/palette.inc → packages/base/graph/inc/palette.inc


+ 0 - 0
rtl/unix/ggigraph.pp → packages/base/graph/unix/ggigraph.pp


+ 0 - 0
rtl/unix/graph.pp → packages/base/graph/unix/graph.pp


+ 0 - 0
rtl/unix/graph16.inc → packages/base/graph/unix/graph16.inc


+ 0 - 0
rtl/win32/graph.pp → packages/base/graph/win32/graph.pp


+ 0 - 0
rtl/win32/wincrt.pp → packages/base/graph/win32/wincrt.pp


+ 0 - 0
rtl/win32/winmouse.pp → packages/base/graph/win32/winmouse.pp


+ 6 - 2
packages/base/ibase/ibase60.inc

@@ -11,8 +11,6 @@ uses Dynlibs, sysutils;
 {$ENDIF}
 
 {$IFDEF Unix}
-  {$LINKLIB c}
-  {$LINKLIB crypt}
   {$DEFINE extdecl:=cdecl}
   const
     gdslib = 'libgds.so';
@@ -24,6 +22,12 @@ uses Dynlibs, sysutils;
     gdslib = 'gds32.dll';
     fbclib = 'fbclient.dll';
 {$ENDIF}
+{$IFDEF Wince}
+  {$DEFINE extdecl:=stdcall}
+  const
+    gdslib = 'gds32.dll';
+    fbclib = 'fbclient.dll';
+{$ENDIF}
 
 type
   {  Unsigned types }

+ 2 - 2
packages/base/mysql/mysql.inc

@@ -495,14 +495,12 @@ uses
 
     function get_tty_password(opt_message:Pchar):Pchar;cdecl;external mysqllib name 'get_tty_password';
     function mysql_errno_to_sqlstate(mysql_errno:dword):Pchar;cdecl;external mysqllib name 'mysql_errno_to_sqlstate';
-{$ENDIF}
 
     { Some other useful functions  }
 {$IFDEF mysql50}
     function modify_defaults_file(file_location:Pchar; option:Pchar; option_value:Pchar; section_name:Pchar; remove_option:longint):longint;cdecl;external mysqllib name 'load_defaults';
 {$ENDIF}
 
-{$IFNDEF LinkDynamically}
     function load_defaults(conf_file:Pchar; groups:PPchar; argc:Plongint; argv:PPPchar):longint;cdecl;external mysqllib name 'load_defaults';
     function my_init:my_bool;cdecl;external mysqllib name 'my_init';
     function my_thread_init:my_bool;cdecl;external mysqllib name 'my_thread_init';
@@ -1452,12 +1450,14 @@ uses
 
     function mysql_reload(mysql : PMySQL) : longint;
 
+{$IFNDEF LinkDynamically}
 {$ifdef USE_OLD_FUNCTIONS}
     function mysql_connect(mysql:PMYSQL; host:Pchar; user:Pchar; passwd:Pchar):PMYSQL;extdecl;external External_library name 'mysql_connect';
     function mysql_create_db(mysql:PMYSQL; DB:Pchar):longint;extdecl;external External_library name 'mysql_create_db';
     function mysql_drop_db(mysql:PMYSQL; DB:Pchar):longint;extdecl;external External_library name 'mysql_drop_db';
     function mysql_reload(mysql : PMySQL) : longint;
 {$endif}
+{$endif}
 
 {$define HAVE_MYSQL_REAL_CONNECT}    
     { The following functions are mainly exported because of mysqlbinlog;

+ 4 - 0
packages/base/postgres/dllistdyn.pp

@@ -22,6 +22,10 @@ uses
   const
     pqlib = 'libpq.dll';
 {$ENDIF}
+{$IFDEF Wince}
+  const
+    pqlib = 'libpq.dll';
+{$ENDIF}
 
 {$i dllisttypes.inc}
 

+ 79 - 158
packages/extra/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/11/26]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/10]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -231,79 +231,85 @@ UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
 endif
 PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_DIRS+=unzip hermes ptc
+override TARGET_DIRS+=unzip
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_DIRS+=unzip opengl gtk gtk2 zlib tcl cdrom fpgtk winunits fftw hermes ptc
+override TARGET_DIRS+=unzip opengl gtk gtk2 zlib tcl cdrom fpgtk winunits fftw
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_DIRS+=os2units hermes rexx unzip zlib x11 gtk libpng tcl imlib fpgtk
+override TARGET_DIRS+=os2units rexx unzip zlib x11 gtk libpng tcl imlib fpgtk
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_DIRS+=unzip zlib hermes x11 ptc opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib x11 opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_DIRS+=unzip zlib hermes
+override TARGET_DIRS+=unzip zlib
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_DIRS+=unzip zlib hermes x11 ptc opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib x11 opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_DIRS+=os2units rexx unzip zlib x11 gtk libpng tcl imlib fpgtk
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_DIRS+=unzip zlib hermes
+override TARGET_DIRS+=unzip zlib
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_DIRS+=unzip zlib tcl fftw
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_DIRS+=unzip zlib hermes x11 ptc opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib x11 opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_DIRS+=amunits hermes
+override TARGET_DIRS+=amunits
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_DIRS+=unzip zlib hermes x11 ptc opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib x11 opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_DIRS+=palmunits hermes
+override TARGET_DIRS+=palmunits
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_DIRS+=unzip zlib hermes x11 ptc opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib x11 opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_DIRS+=unzip zlib hermes x11 ptc opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib x11 opengl gtk syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_DIRS+=unzip zlib tcl fftw
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_DIRS+=unzip zlib fftw hermes x11 ptc opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
+override TARGET_DIRS+=unzip zlib fftw x11 opengl gtk gtk2 syslog forms svgalib ggi libpng libgd utmp bfd gdbm ncurses tcl cdrom imlib gnome1 fpgtk unixutil newt uuid
 endif
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCSUBDIR=packages/extra
@@ -510,6 +516,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1142,6 +1149,12 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 endif
 endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
 ifdef OPT
 override FPCOPT+=$(OPT)
 endif
@@ -1156,6 +1169,14 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
@@ -1168,6 +1189,26 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 endif
+.PHONY: fpc_shared
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef $(SHARED_LIBNAME)
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef LIB_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS)
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME)
+else
+	@$(ECHO) Shared Libraries not supported
+endif
 .PHONY: fpc_clean fpc_cleanall fpc_distclean
 ifdef EXEFILES
 override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
@@ -1345,9 +1386,7 @@ ifeq ($(FULL_TARGET),i386-linux)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1372,8 +1411,6 @@ TARGET_DIRS_UUID=1
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 TARGET_DIRS_UNZIP=1
-TARGET_DIRS_HERMES=1
-TARGET_DIRS_PTC=1
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 TARGET_DIRS_UNZIP=1
@@ -1386,12 +1423,9 @@ TARGET_DIRS_CDROM=1
 TARGET_DIRS_FPGTK=1
 TARGET_DIRS_WINUNITS=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
-TARGET_DIRS_PTC=1
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 TARGET_DIRS_OS2UNITS=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_REXX=1
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
@@ -1406,9 +1440,7 @@ ifeq ($(FULL_TARGET),i386-freebsd)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1430,9 +1462,7 @@ endif
 ifeq ($(FULL_TARGET),i386-netbsd)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_SYSLOG=1
@@ -1453,14 +1483,11 @@ endif
 ifeq ($(FULL_TARGET),i386-netware)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
-TARGET_DIRS_HERMES=1
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_SYSLOG=1
@@ -1493,15 +1520,18 @@ endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
-TARGET_DIRS_HERMES=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+TARGET_DIRS_UNZIP=1
+TARGET_DIRS_ZLIB=1
+TARGET_DIRS_TCL=1
+TARGET_DIRS_FFTW=1
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1528,9 +1558,7 @@ ifeq ($(FULL_TARGET),m68k-freebsd)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1552,9 +1580,7 @@ endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_SYSLOG=1
@@ -1574,14 +1600,11 @@ TARGET_DIRS_GNOME1=1
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 TARGET_DIRS_AMUNITS=1
-TARGET_DIRS_HERMES=1
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_SYSLOG=1
@@ -1601,15 +1624,12 @@ TARGET_DIRS_GNOME1=1
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 TARGET_DIRS_PALMUNITS=1
-TARGET_DIRS_HERMES=1
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1635,9 +1655,7 @@ endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_SYSLOG=1
@@ -1659,7 +1677,6 @@ ifeq ($(FULL_TARGET),powerpc-darwin)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
@@ -1683,9 +1700,7 @@ ifeq ($(FULL_TARGET),sparc-linux)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1711,9 +1726,7 @@ endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_SYSLOG=1
@@ -1735,9 +1748,7 @@ ifeq ($(FULL_TARGET),x86_64-linux)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1764,9 +1775,7 @@ ifeq ($(FULL_TARGET),x86_64-freebsd)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1789,9 +1798,7 @@ ifeq ($(FULL_TARGET),arm-linux)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1814,13 +1821,17 @@ TARGET_DIRS_UNIXUTIL=1
 TARGET_DIRS_NEWT=1
 TARGET_DIRS_UUID=1
 endif
+ifeq ($(FULL_TARGET),arm-wince)
+TARGET_DIRS_UNZIP=1
+TARGET_DIRS_ZLIB=1
+TARGET_DIRS_TCL=1
+TARGET_DIRS_FFTW=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 TARGET_DIRS_UNZIP=1
 TARGET_DIRS_ZLIB=1
 TARGET_DIRS_FFTW=1
-TARGET_DIRS_HERMES=1
 TARGET_DIRS_X11=1
-TARGET_DIRS_PTC=1
 TARGET_DIRS_OPENGL=1
 TARGET_DIRS_GTK=1
 TARGET_DIRS_GTK2=1
@@ -1978,51 +1989,6 @@ fftw:
 	$(MAKE) -C fftw all
 .PHONY: fftw_all fftw_debug fftw_smart fftw_release fftw_units fftw_examples fftw_shared fftw_install fftw_sourceinstall fftw_exampleinstall fftw_distinstall fftw_zipinstall fftw_zipsourceinstall fftw_zipexampleinstall fftw_zipdistinstall fftw_clean fftw_distclean fftw_cleanall fftw_info fftw_makefiles fftw
 endif
-ifdef TARGET_DIRS_HERMES
-hermes_all:
-	$(MAKE) -C hermes all
-hermes_debug:
-	$(MAKE) -C hermes debug
-hermes_smart:
-	$(MAKE) -C hermes smart
-hermes_release:
-	$(MAKE) -C hermes release
-hermes_units:
-	$(MAKE) -C hermes units
-hermes_examples:
-	$(MAKE) -C hermes examples
-hermes_shared:
-	$(MAKE) -C hermes shared
-hermes_install:
-	$(MAKE) -C hermes install
-hermes_sourceinstall:
-	$(MAKE) -C hermes sourceinstall
-hermes_exampleinstall:
-	$(MAKE) -C hermes exampleinstall
-hermes_distinstall:
-	$(MAKE) -C hermes distinstall
-hermes_zipinstall:
-	$(MAKE) -C hermes zipinstall
-hermes_zipsourceinstall:
-	$(MAKE) -C hermes zipsourceinstall
-hermes_zipexampleinstall:
-	$(MAKE) -C hermes zipexampleinstall
-hermes_zipdistinstall:
-	$(MAKE) -C hermes zipdistinstall
-hermes_clean:
-	$(MAKE) -C hermes clean
-hermes_distclean:
-	$(MAKE) -C hermes distclean
-hermes_cleanall:
-	$(MAKE) -C hermes cleanall
-hermes_info:
-	$(MAKE) -C hermes info
-hermes_makefiles:
-	$(MAKE) -C hermes makefiles
-hermes:
-	$(MAKE) -C hermes all
-.PHONY: hermes_all hermes_debug hermes_smart hermes_release hermes_units hermes_examples hermes_shared hermes_install hermes_sourceinstall hermes_exampleinstall hermes_distinstall hermes_zipinstall hermes_zipsourceinstall hermes_zipexampleinstall hermes_zipdistinstall hermes_clean hermes_distclean hermes_cleanall hermes_info hermes_makefiles hermes
-endif
 ifdef TARGET_DIRS_X11
 x11_all:
 	$(MAKE) -C x11 all
@@ -2068,51 +2034,6 @@ x11:
 	$(MAKE) -C x11 all
 .PHONY: x11_all x11_debug x11_smart x11_release x11_units x11_examples x11_shared x11_install x11_sourceinstall x11_exampleinstall x11_distinstall x11_zipinstall x11_zipsourceinstall x11_zipexampleinstall x11_zipdistinstall x11_clean x11_distclean x11_cleanall x11_info x11_makefiles x11
 endif
-ifdef TARGET_DIRS_PTC
-ptc_all:
-	$(MAKE) -C ptc all
-ptc_debug:
-	$(MAKE) -C ptc debug
-ptc_smart:
-	$(MAKE) -C ptc smart
-ptc_release:
-	$(MAKE) -C ptc release
-ptc_units:
-	$(MAKE) -C ptc units
-ptc_examples:
-	$(MAKE) -C ptc examples
-ptc_shared:
-	$(MAKE) -C ptc shared
-ptc_install:
-	$(MAKE) -C ptc install
-ptc_sourceinstall:
-	$(MAKE) -C ptc sourceinstall
-ptc_exampleinstall:
-	$(MAKE) -C ptc exampleinstall
-ptc_distinstall:
-	$(MAKE) -C ptc distinstall
-ptc_zipinstall:
-	$(MAKE) -C ptc zipinstall
-ptc_zipsourceinstall:
-	$(MAKE) -C ptc zipsourceinstall
-ptc_zipexampleinstall:
-	$(MAKE) -C ptc zipexampleinstall
-ptc_zipdistinstall:
-	$(MAKE) -C ptc zipdistinstall
-ptc_clean:
-	$(MAKE) -C ptc clean
-ptc_distclean:
-	$(MAKE) -C ptc distclean
-ptc_cleanall:
-	$(MAKE) -C ptc cleanall
-ptc_info:
-	$(MAKE) -C ptc info
-ptc_makefiles:
-	$(MAKE) -C ptc makefiles
-ptc:
-	$(MAKE) -C ptc all
-.PHONY: ptc_all ptc_debug ptc_smart ptc_release ptc_units ptc_examples ptc_shared ptc_install ptc_sourceinstall ptc_exampleinstall ptc_distinstall ptc_zipinstall ptc_zipsourceinstall ptc_zipexampleinstall ptc_zipdistinstall ptc_clean ptc_distclean ptc_cleanall ptc_info ptc_makefiles ptc
-endif
 ifdef TARGET_DIRS_OPENGL
 opengl_all:
 	$(MAKE) -C opengl all
@@ -3289,7 +3210,7 @@ smart: $(addsuffix _smart,$(TARGET_DIRS))
 release: $(addsuffix _release,$(TARGET_DIRS))
 units: $(addsuffix _units,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
-shared: $(addsuffix _shared,$(TARGET_DIRS))
+shared: fpc_shared
 install: $(addsuffix _install,$(TARGET_DIRS))
 sourceinstall: $(addsuffix _sourceinstall,$(TARGET_DIRS))
 exampleinstall: $(addsuffix _exampleinstall,$(TARGET_DIRS))

+ 1 - 0
packages/extra/Makefile.fpc

@@ -20,6 +20,7 @@ dirs_openbsd=unzip zlib \
              forms svgalib ggi libpng libgd \
              utmp bfd gdbm ncurses fpgtk tcl imlib gnome1
 dirs_win32=unzip opengl gtk gtk2 zlib tcl cdrom fpgtk winunits fftw
+dirs_wince=unzip zlib tcl fftw
 dirs_os2=os2units \
          rexx \
          unzip zlib \

+ 74 - 40
rtl/amiga/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/10]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -253,117 +253,116 @@ else
 SYSTEMUNIT=syslinux
 endif
 OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts graph sysutils math typinfo ctypes
+override TARGET_UNITS+=system exec strings dos crt objects printer objpas macpas matrix heaptrc lineinfo getopts sysutils math typinfo ctypes
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt0
@@ -1013,6 +1012,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1645,6 +1645,12 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 endif
 endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
 ifdef OPT
 override FPCOPT+=$(OPT)
 endif
@@ -1659,6 +1665,14 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
@@ -1748,6 +1762,26 @@ vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef $(SHARED_LIBNAME)
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef LIB_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS)
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME)
+else
+	@$(ECHO) Shared Libraries not supported
+endif
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 ifdef INSTALL_UNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
@@ -1997,7 +2031,7 @@ smart: fpc_smart
 release: fpc_release
 units: fpc_units
 examples:
-shared:
+shared: fpc_shared
 install: fpc_install
 sourceinstall: fpc_sourceinstall
 exampleinstall: fpc_exampleinstall

+ 1 - 26
rtl/amiga/Makefile.fpc

@@ -10,7 +10,7 @@ loaders=prt0
 units=system exec strings \
       dos crt objects printer \
       objpas macpas matrix \
-      heaptrc lineinfo getopts graph \
+      heaptrc lineinfo getopts \
       sysutils math typinfo ctypes
 rsts=math
 
@@ -59,7 +59,6 @@ endif
 
 # Paths
 OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
 
 [rules]
 # Get the system independent include file names.
@@ -154,27 +153,3 @@ heaptrc$(PPUEXT) : $(INC)/heaptrc.pp system$(PPUEXT)
 
 ctypes$(PPUEXT) : $(INC)/ctypes.pp system$(PPUEXT)
         $(COMPILER) $(INC)/ctypes.pp $(REDIR)
-
-#
-# Revision 1.10  2004/10/30 12:36:48  peter
-#   * units are now created in separate directory units/cpu-os/
-#   * distclean uses cleanall rule and removes units dir
-#   * cross compile support fixed, it is now possible to cycle a ppcsparc
-#     without deleting ppc386
-#   * bintutilsperfix defaults to cpu-os-
-#
-# Revision 1.9  2004/08/25 16:57:22  olle
-#   * fix so that macpas.pp really is compiled
-#
-# Revision 1.8  2004/08/16 16:22:17  olle
-#   + Added unit macpas
-#
-# Revision 1.7  2004/07/07 21:37:29  daniel
-#   * Matrix unit included in build process
-#
-# Revision 1.6  2004/05/06 22:01:17  florian
-#   * changed extensions
-#
-# Revision 1.5  2004/05/06 21:12:41  florian
-#   * changed extensions
-#

+ 125 - 0
rtl/darwin/errnostr.inc

@@ -0,0 +1,125 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2005 by Ales Katona
+
+    Contains BSD specific errors for error.pp in rtl/unix
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+const
+  sys_errn=94;
+  sys_errlist:array[0..sys_errn-1] of pchar = (
+        'Success',                              { 0 }
+        'Operation not permitted',              { EPERM }
+        'No such file or directory',            { ENOENT }
+        'No such process',                      { ESRCH }
+        'Interrupted system call',              { EINTR }
+        'I/O error',                            { EIO }
+        'No such device or address',            { ENXIO }
+        'Arg list too long',                    { E2BIG }
+        'Exec format error',                    { ENOEXEC }
+        'Bad file number',                      { EBADF }
+        'No child processes',                   { ECHILD }
+        'Resource deadlock avoided',   { EDEADLK was EAGAIN }
+        'Out of memory',                        { ENOMEM }
+        'Permission denied',                    { EACCES }
+        'Bad address',                          { EFAULT }
+        'Block device required',                { ENOTBLK }
+        'Device or resource busy',              { EBUSY }
+        'File exists',                          { EEXIST }
+        'Cross-device link',                    { EXDEV }
+        'No such device',                       { ENODEV }
+        'Not a directory',                      { ENOTDIR }
+        'Is a directory',                       { EISDIR }
+        'Invalid argument',                     { EINVAL }
+        'File table overflow',                  { ENFILE }
+        'Too many open files',                  { EMFILE }
+        'Not a typewriter',                     { ENOTTY }
+        'Text (code segment) file busy',        { ETXTBSY  Text file busy.  The new process was
+                                                    a pure procedure (shared text) file which was
+                                                    open for writing by another process, or file
+                                                    which was open for writing by another process,
+                                                    or while the pure procedure file was being
+                                                    executed an open(2) call requested write access
+                                                    requested write access.}
+        'File too large',                       { EFBIG }
+        'No space left on device',              { ENOSPC }
+        'Illegal seek',                         { ESPIPE }
+        'Read-only file system',                { EROFS }
+        'Too many links',                       { EMLINK }
+        'Broken pipe',                          { EPIPE }
+        'Math argument out of domain of func',  { EDOM }
+        'Math result not representable',        { ERANGE }
+        'Resource temporarily unavailable',        { EAGAIN }
+        'Operation now in progress',      { EINPROGRESS }
+        'Operation already in progress', { EALREADY	}
+// ipc/network software -- argument errors
+        'Socket operation on non-socket',    { ENOTSOCK }
+        'Destination address required',     { EDESTADDRREQ }
+        'Message too long',                     { EMSGSIZE }
+        'Protocol wrong type for socket', { EPROTOTYPE }
+        'Protocol not available',               { ENOPROTOOPT }
+        'Protocol not supported',              { EPROTONOSUPPORT }
+        'Socket type not supported',         { ESOCKTNOSUPPORT }
+        'Operation not supported',             { EOPNOTSUPP }
+        'Protocol family not supported',      { EPFNOSUPPORT }
+        'Address family not supported by protocol family',  { EAFNOSUPPORT }
+        'Address already in use',                { EADDRINUSE }
+        'Can''t assign requested address',  { EADDRNOTAVAIL }
+// ipc/network software -- operational errors
+        'Network is down',                            { ENETDOWN }
+        'Network is unreachable',                 { ENETUNREACH }
+        'Network dropped connection on reset', { ENETRESET }
+        'Software caused connection abort',   { ECONNABORTED }
+        'Connection reset by peer',                 { ECONNRESET }
+        'No buffer space available',                { ENOBUFS }
+        'Socket is already connected',            { EISCONN }
+        'Socket is not connected',                    { ENOTCONN }
+        'Can''t send after socket shutdown',    { ESHUTDOWN }
+        'Too many references: can''t splice',   { ETOOMANYREFS }
+        'Operation timed out',                           { ETIMEDOUT }
+        'Connection refused',                           { ECONNREFUSED }
+        'Too many levels of symbolic links',     { ELOOP }
+        'File name too long',                              { ENAMETOOLONG }
+        'Host is down',                                       { EHOSTDOWN }
+        'No route to host',                                  { EHOSTUNREACH }
+        'Directory not empty',                            { ENOTEMPTY }
+        'Too many processes',                           { EPROCLIM }
+        'Too many users',                                   { EUSERS }
+        'Disc quota exceeded',                           { EDQUOT }
+// Network File System
+        'Stale NFS file handle',                              { ESTALE }
+        'Too many levels of remote in path',        { EREMOTE }
+        'RPC struct is bad',                                    { EBADRPC }
+        'RPC version wrong',                                { ERPCMISMATCH }
+        'RPC prog. not avail',                                { EPROGUNAVAIL }
+        'Program version wrong',                          { EPROGMISMATCH }
+        'Bad procedure for program',                    { EPROCUNAVAIL }
+        'No locks available',                                   { ENOLCK }
+        'Function not implemented',                       { ENOSYS }
+        'Inappropriate file type or format',              { EFTYPE }
+        'Authentication error',                                 { EAUTH }
+        'Need authenticator',                                   { ENEEDAUTH }
+        // Intelligent device errors
+        'Device power is off',                                   { EPWROFF }
+        'Device error, e.g. paper out',                      { EDEVERR }
+        'Value too large to be stored in data type',   { EOVERFLOW }
+// Program loading errors
+        'Bad executable',                                         { EBADEXEC }
+        'Bad CPU type in executable',                      { EBADARCH }
+        'Shared library version mismatch',               { ESHLIBVERS }
+        'Malformed Macho file',                                 { EBADMACHO }
+        'Operation canceled',                                   { ECANCELED }
+        'Identifier removed',                                      { EIDRM }
+        'No message of desired type',                      { ENOMSG }
+        'llegal byte sequence',                                  { EILSEQ }
+        'Attribute not found'                                      { ENOATTR }
+);
+ 

+ 38 - 12
rtl/freebsd/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/10]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -251,7 +251,7 @@ SYSTEMUNIT=sysbsd
 override FPCOPT+=-dUNIX -dNOMOUSE
 endif
 ifeq ($(CPU_TARGET),i386)
-CPU_UNITS=x86 ports cpu mmx graph
+CPU_UNITS=x86 ports cpu mmx
 else
 CPU_UNITS=
 endif
@@ -259,10 +259,6 @@ ifdef RELEASE
 override FPCOPT+=-Ur
 endif
 OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-ifndef USELIBGGI
-USELIBGGI=NO
-endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas strings syscall sysctl  baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes   dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lineinfo errors sockets ipc terminfo video mouse keyboard console serial dateutils sysconst cthreads strutils convutils dos objects cwstring fpmkunit
 endif
@@ -1022,6 +1018,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1654,6 +1651,12 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 endif
 endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
 ifdef OPT
 override FPCOPT+=$(OPT)
 endif
@@ -1668,6 +1671,14 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
@@ -1757,6 +1768,26 @@ vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef $(SHARED_LIBNAME)
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef LIB_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS)
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME)
+else
+	@$(ECHO) Shared Libraries not supported
+endif
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 ifdef INSTALL_UNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
@@ -2006,7 +2037,7 @@ smart: fpc_smart
 release: fpc_release
 units: fpc_units
 examples:
-shared:
+shared: fpc_shared
 install: fpc_install
 sourceinstall: fpc_sourceinstall
 exampleinstall: fpc_exampleinstall
@@ -2059,11 +2090,6 @@ dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(
 crt$(PPUEXT) : $(UNIXINC)/crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
 printer$(PPUEXT) : $(UNIXINC)/printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-include $(GRAPHDIR)/makefile.inc
-GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
-graph$(PPUEXT) : graph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
-		 $(GRAPHINCDEPS) $(UNIXINC)/graph16.inc
-	$(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/graph.pp
 sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
 		    objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
 	$(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp

+ 1 - 23
rtl/freebsd/Makefile.fpc

@@ -67,7 +67,7 @@ override FPCOPT+=-dUNIX -dNOMOUSE
 endif
 
 ifeq ($(CPU_TARGET),i386)
-CPU_UNITS=x86 ports cpu mmx graph
+CPU_UNITS=x86 ports cpu mmx
 else
 CPU_UNITS=
 endif
@@ -82,17 +82,6 @@ endif
 
 # Paths
 OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-
-# Use new graph unit ?
-# NEWGRAPH=YES
-# Use LibGGI ?
-# Use
-#
-ifndef USELIBGGI
-USELIBGGI=NO
-endif
-
 
 [rules]
 # Get the system independent include file names.
@@ -175,17 +164,6 @@ objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
 
 printer$(PPUEXT) : $(UNIXINC)/printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 
-#
-# Graph
-#
-
-include $(GRAPHDIR)/makefile.inc
-GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
-
-graph$(PPUEXT) : graph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
-                 $(GRAPHINCDEPS) $(UNIXINC)/graph16.inc
-        $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/graph.pp
-
 #
 # Delphi Compatible Units
 #

+ 122 - 0
rtl/freebsd/errnostr.inc

@@ -0,0 +1,122 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2005 by Ales Katona
+
+    Contains BSD specific errors for error.pp in rtl/unix
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+const
+  sys_errn=93;
+  sys_errlist:array[0..sys_errn-1] of pchar = (
+        'Success',                              { 0 }
+        'Operation not permitted',              { EPERM }
+        'No such file or directory',            { ENOENT }
+        'No such process',                      { ESRCH }
+        'Interrupted system call',              { EINTR }
+        'I/O error',                            { EIO }
+        'No such device or address',            { ENXIO }
+        'Arg list too long',                    { E2BIG }
+        'Exec format error',                    { ENOEXEC }
+        'Bad file number',                      { EBADF }
+        'No child processes',                   { ECHILD }
+        'Resource deadlock avoided',   { EDEADLK was EAGAIN }
+        'Out of memory',                        { ENOMEM }
+        'Permission denied',                    { EACCES }
+        'Bad address',                          { EFAULT }
+        'Block device required',                { ENOTBLK }
+        'Device or resource busy',              { EBUSY }
+        'File exists',                          { EEXIST }
+        'Cross-device link',                    { EXDEV }
+        'No such device',                       { ENODEV }
+        'Not a directory',                      { ENOTDIR }
+        'Is a directory',                       { EISDIR }
+        'Invalid argument',                     { EINVAL }
+        'File table overflow',                  { ENFILE }
+        'Too many open files',                  { EMFILE }
+        'Not a typewriter',                     { ENOTTY }
+        'Text (code segment) file busy',        { ETXTBSY  Text file busy.  The new process was
+                                                    a pure procedure (shared text) file which was
+                                                    open for writing by another process, or file
+                                                    which was open for writing by another process,
+                                                    or while the pure procedure file was being
+                                                    executed an open(2) call requested write access
+                                                    requested write access.}
+        'File too large',                       { EFBIG }
+        'No space left on device',              { ENOSPC }
+        'Illegal seek',                         { ESPIPE }
+        'Read-only file system',                { EROFS }
+        'Too many links',                       { EMLINK }
+        'Broken pipe',                          { EPIPE }
+        'Math argument out of domain of func',  { EDOM }
+        'Math result not representable',        { ERANGE }
+        'Resource temporarily unavailable',        { EAGAIN }
+        'Operation now in progress',      { EINPROGRESS }
+        'Operation already in progress', { EALREADY	}
+// ipc/network software -- argument errors
+        'Socket operation on non-socket',    { ENOTSOCK }
+        'Destination address required',     { EDESTADDRREQ }
+        'Message too long',                     { EMSGSIZE }
+        'Protocol wrong type for socket', { EPROTOTYPE }
+        'Protocol not available',               { ENOPROTOOPT }
+        'Protocol not supported',              { EPROTONOSUPPORT }
+        'Socket type not supported',         { ESOCKTNOSUPPORT }
+        'Operation not supported',             { EOPNOTSUPP }
+        'Protocol family not supported',      { EPFNOSUPPORT }
+        'Address family not supported by protocol family',  { EAFNOSUPPORT }
+        'Address already in use',                { EADDRINUSE }
+        'Can''t assign requested address',  { EADDRNOTAVAIL }
+// ipc/network software -- operational errors
+        'Network is down',                            { ENETDOWN }
+        'Network is unreachable',                 { ENETUNREACH }
+        'Network dropped connection on reset', { ENETRESET }
+        'Software caused connection abort',   { ECONNABORTED }
+        'Connection reset by peer',                 { ECONNRESET }
+        'No buffer space available',                { ENOBUFS }
+        'Socket is already connected',            { EISCONN }
+        'Socket is not connected',                    { ENOTCONN }
+        'Can''t send after socket shutdown',    { ESHUTDOWN }
+        'Too many references: can''t splice',   { ETOOMANYREFS }
+        'Operation timed out',                           { ETIMEDOUT }
+        'Connection refused',                           { ECONNREFUSED }
+        'Too many levels of symbolic links',     { ELOOP }
+        'File name too long',                              { ENAMETOOLONG }
+        'Host is down',                                       { EHOSTDOWN }
+        'No route to host',                                  { EHOSTUNREACH }
+        'Directory not empty',                            { ENOTEMPTY }
+        'Too many processes',                           { EPROCLIM }
+        'Too many users',                                   { EUSERS }
+        'Disc quota exceeded',                           { EDQUOT }
+// Network File System
+        'Stale NFS file handle',                              { ESTALE }
+        'Too many levels of remote in path',        { EREMOTE }
+        'RPC struct is bad',                                    { EBADRPC }
+        'RPC version wrong',                                { ERPCMISMATCH }
+        'RPC prog. not avail',                                { EPROGUNAVAIL }
+        'Program version wrong',                          { EPROGMISMATCH }
+        'Bad procedure for program',                    { EPROCUNAVAIL }
+        'No locks available',                                   { ENOLCK }
+        'Function not implemented',                       { ENOSYS }
+        'Inappropriate file type or format',              { EFTYPE }
+        'Authentication error',                                 { EAUTH }
+        'Need authenticator',                                   { ENEEDAUTH }
+        'Identifier removed',                                   { EIDRM }
+        'No message of desired type',                   { ENOMSG }
+        'Value too large to be stored in data type', { EOVERFLOW }
+        'Operation canceled',                                  { ECANCELED }
+        'Illegal byte sequence',                                { EILSEQ }
+        'Attribute not found',                                    { ENOATTR }
+        'Programming error',                                    { EDOOFUS }
+        'Bad message',                                            { EBADMSG }
+        'Multihop attempted',                                   { EMULTIHOP }
+        'Link has been severed',                              { ENOLINK }
+        'Protocol error'                                             { EPROTO }
+);
+ 

+ 46 - 20
rtl/freebsd/i386/cprt0.as

@@ -1,5 +1,5 @@
 #
-#   $Id: cprt0.as,v 1.4 2004/07/03 21:50:30 daniel Exp $
+#   $Id: cprt0.as,v 1.3 2000/11/21 19:03:23 marco Exp $
 #   This file is part of the Free Pascal run time library.
 #   Copyright (c) 1999-2000 by Marco van de Voort, Michael Van Canneyt
 #                                                  and Peter Vreman
@@ -18,36 +18,48 @@
 #
 
         .file   "cprt0.as"
-        .version        "01.01"
-gcc2_compiled.:
-.globl __progname
-.section        .rodata
+        .ident  "FreePascal 2.0.x series with FreeBSD 5/6 patch"
+.section        .note.ABI-tag,"a",@progbits
+        .p2align 2
+        .type   abitag, @object
+        .size   abitag, 24
+abitag:
+        .long   8
+        .long   4
+        .long   1
+        .string "FreeBSD"
+        .long   504000
+        .section	.rodata.str1.1,"aMS",@progbits,1
 .LC0:
-        .ascii "\0"
-.data
+        .string ""
+.globl __progname
+	.data
         .p2align 2
         .type    __progname,@object
         .size    __progname,4
 __progname:
         .long .LC0
-        .align  4
+        .text
+        .p2align  2,,3
 ___fpucw:
         .long   0x1332
-
         .globl  ___fpc_brk_addr         /* heap management */
         .type   ___fpc_brk_addr,@object
         .size   ___fpc_brk_addr,4
 ___fpc_brk_addr:
         .long   0
 
-
-.text
-        .p2align 2
+	.text
+        .p2align 4,,15
 .globl _start
         .type    _start,@function
 _start:
         pushl %ebp
         movl %esp,%ebp
+	subl $40,%esp
+	call get_rtld_cleanup
+	movl %eax,%edx
+
         pushl %edi
         pushl %esi
         pushl %ebx
@@ -83,7 +95,7 @@ _start:
 .L2:
         movl $_DYNAMIC,%eax
         testl %eax,%eax
-        je .L9
+        je .LTLS
         pushl %edx
         call atexit
         addl $4,%esp
@@ -108,9 +120,12 @@ _start:
         call main
         pushl %eax
         jmp   _haltproc
-
+.LTLS:  
+	call _init_tls
+	jmp .L9
         .p2align 2,0x90
-        
+       
+ 
 .globl _haltproc
 .type _haltproc,@function
 
@@ -133,14 +148,25 @@ _haltproc:
          ret
         .p2align 2,0x90
 .Lfe1:
-
-
         .size    _start,.Lfe1-_start
         .comm   environ,4,4
-        .weak   _DYNAMIC
-        .ident  "GCC: (GNU) 2.7.2.1"
+        .p2align 4,,15
+        .type   get_rtld_cleanup, @function
+get_rtld_cleanup:
+        pushl   %ebp
+        movl    %esp, %ebp
+        subl    $4, %esp
+#APP
+        movl %edx,-4(%ebp)
+#NO_APP
+        movl    -4(%ebp), %eax
+        leave
+        ret
 
+        .weak   _DYNAMIC
+        .ident  "GCC: (GNU) 3.4.2 - FPC: 2.0.2"
 .bss
         .comm operatingsystem_parameter_envp,4
         .comm operatingsystem_parameter_argc,4
-        .comm operatingsystem_parameter_argv,4
+        .comm operatingsystem_parameter_argv,4        
+        

+ 1 - 1
rtl/freebsd/tthread.inc

@@ -205,7 +205,7 @@ end;
 
 destructor TThread.Destroy;
 begin
-  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) then begin
+  if (FThreadID = GetCurrentThreadID) and not(FFreeOnTerminate) and not ffinished then begin
     raise EThreadDestroyCalled.Create('A thread cannot destroy itself except by setting FreeOnTerminate and leaving!');
   end;
   // if someone calls .Free on a thread with

+ 1 - 1
rtl/freebsd/unixsock.inc

@@ -91,7 +91,7 @@ end;
 
 function  fpsetsockopt  (s:cint; level:cint; optname:cint; optval:pointer; optlen : tsocklen):cint;
 begin
-  fpSetSockOpt:=do_syscall(syscall_nr_SetSockOpt,S,optname,TSysParam(optval),optlen);
+  fpSetSockOpt:=do_syscall(syscall_nr_SetSockOpt,S,level,optname,TSysParam(optval),optlen);
   socketerror:=fpgeterrno;
 end;
 

+ 74 - 45
rtl/go32v2/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/10]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -243,7 +243,6 @@ ifdef RELEASE
 override FPCOPT+=-Ur
 endif
 OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
 ifdef EXCEPTIONS_IN_SYSTEM
 override FPCOPT+=-dEXCEPTIONS_IN_SYSTEM
 endif
@@ -251,115 +250,115 @@ ifdef NO_EXCEPTIONS_IN_SYSTEM
 override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt0 exceptn fpu
@@ -1009,6 +1008,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1641,6 +1641,12 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 endif
 endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
 ifdef OPT
 override FPCOPT+=$(OPT)
 endif
@@ -1655,6 +1661,14 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
@@ -1744,6 +1758,26 @@ vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef $(SHARED_LIBNAME)
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef LIB_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS)
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME)
+else
+	@$(ECHO) Shared Libraries not supported
+endif
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 ifdef INSTALL_UNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
@@ -1993,7 +2027,7 @@ smart: fpc_smart
 release: fpc_release
 units: fpc_units
 examples:
-shared:
+shared: fpc_shared
 install: fpc_install
 sourceinstall: fpc_sourceinstall
 exampleinstall: fpc_exampleinstall
@@ -2040,11 +2074,6 @@ dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \
 crt$(PPUEXT) : crt.pp $(INC)/textrec.inc go32$(PPUEXT) system$(PPUEXT)
 objects$(PPUEXT) : $(INC)/objects.pp system$(PPUEXT)
 printer$(PPUEXT) : printer.pp system$(PPUEXT)
-include $(GRAPHDIR)/makefile.inc
-GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
-graph$(PPUEXT) : graph.pp go32$(PPUEXT) ports$(PPUEXT) system$(PPUEXT) \
-		 $(GRAPHINCDEPS) vesa.inc vesah.inc dpmi.inc
-	$(COMPILER) -Fi$(GRAPHDIR) graph.pp
 sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
 		    objpas$(PPUEXT) dos$(PPUEXT) go32$(PPUEXT) sysconst$(PPUEXT)
 	$(COMPILER) -Fi$(OBJPASDIR)/sysutils sysutils.pp

+ 1 - 10
rtl/go32v2/Makefile.fpc

@@ -7,7 +7,7 @@ main=rtl
 loaders=prt0 exceptn fpu
 units=system objpas macpas strings \
       go32 dpmiexcp initc ports profile dxetype dxeload emu387 \
-      dos crt objects printer graph \
+      dos crt objects printer \
       sysutils classes math typinfo matrix \
       cpu mmx ucomplex getopts heaptrc lineinfo \
       msmouse charset varutils \
@@ -39,7 +39,6 @@ override FPCOPT+=-Ur
 endif
 # Paths
 OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
 # Insert exception handler in system unit
 ifdef EXCEPTIONS_IN_SYSTEM
 override FPCOPT+=-dEXCEPTIONS_IN_SYSTEM
@@ -98,14 +97,6 @@ crt$(PPUEXT) : crt.pp $(INC)/textrec.inc go32$(PPUEXT) system$(PPUEXT)
 objects$(PPUEXT) : $(INC)/objects.pp system$(PPUEXT)
 printer$(PPUEXT) : printer.pp system$(PPUEXT)
 #
-# Graph
-#
-include $(GRAPHDIR)/makefile.inc
-GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
-graph$(PPUEXT) : graph.pp go32$(PPUEXT) ports$(PPUEXT) system$(PPUEXT) \
-                 $(GRAPHINCDEPS) vesa.inc vesah.inc dpmi.inc
-        $(COMPILER) -Fi$(GRAPHDIR) graph.pp
-#
 # Delphi Compatible Units
 #
 sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \

+ 133 - 45
rtl/i386/i386.inc

@@ -18,7 +18,7 @@
                                Primitives
 ****************************************************************************}
 var
-  has_sse_support,has_mmx_support : boolean;
+  has_sse_support,has_mmx_support,os_supports_sse : boolean;
 
 {$asmmode intel}
 
@@ -28,20 +28,22 @@ function cpuid_support : boolean;assembler;
     Tested under go32v1 and Linux on c6x86 with CpuID enabled and disabled (PFV)
   }
   asm
-     pushf
-     pushf
-     pop     eax
-     mov     ebx,eax
-     xor     eax,200000h
+    push   ebx
+    pushf
+    pushf
+    pop     eax
+    mov     ebx,eax
+    xor     eax,200000h
     push    eax
-     popf
-     pushf
-     pop     eax
-     popf
-     and     eax,200000h
-     and     ebx,200000h
-     cmp     eax,ebx
-     setnz   al
+    popf
+    pushf
+    pop     eax
+    popf
+    and     eax,200000h
+    and     ebx,200000h
+    cmp     eax,ebx
+    setnz   al
+    pop     ebx
   end;
 
 {$asmmode ATT}
@@ -53,11 +55,11 @@ function sse_support : boolean;
     if cpuid_support then
      begin
         asm
-           movl $1,%eax
-           cpuid
-           movl %edx,_edx
+          movl $1,%eax
+          cpuid
+          movl %edx,_edx
         end;
-        sse_support:=(_edx and $2000000)<>0;
+        sse_support:=((_edx and $2000000)<>0) and os_supports_sse;
      end
     else
      { a cpu with without cpuid instruction supports never sse }
@@ -86,21 +88,20 @@ function mmx_support : boolean;
        mmx_support:=false;
   end;
 
+{$define USE_FASTMOVE}
 {$i fastmove.inc}
 
 procedure fpc_cpuinit;
-begin
-  has_sse_support:=sse_support;
-  has_mmx_support:=mmx_support;
-  setup_fastmove;
-end;
-
+  begin
+    { because of the brain dead sse detection on x86, this test is post poned to fpc_cpucodeinit which
+      must be implemented OS dependend (FK)
+    has_sse_support:=sse_support;
+    has_mmx_support:=mmx_support;
+    setup_fastmove;
+    }
+    os_supports_sse:=false;
+  end;
 
-function geteipasebx : pointer;assembler;[public,alias:'FPC_GETEIPINEBX'];
-asm
-  movl (%esp),%ebx
-  ret
-end;
 
 {$ifndef FPC_SYSTEM_HAS_MOVE}
 {$define FPC_SYSTEM_HAS_MOVE}
@@ -1073,7 +1074,7 @@ end;
 
 { do a thread save inc/dec }
 {$define FPC_SYSTEM_HAS_DECLOCKED_LONGINT}
-function declocked(var l : longint) : boolean;assembler;
+function cpudeclocked(var l : longint) : boolean;assembler;
 
   asm
 {$ifndef REGCALL}
@@ -1081,36 +1082,46 @@ function declocked(var l : longint) : boolean;assembler;
 {$endif}
      { this check should be done because a lock takes a lot }
      { of time!                                             }
-     cmpb       $0,IsMultithread
-     jz         .Ldeclockednolock
      lock
      decl       (%eax)
-     jmp        .Ldeclockedend
-.Ldeclockednolock:
-     decl       (%eax);
-.Ldeclockedend:
      setzb      %al
   end;
 
 {$define FPC_SYSTEM_HAS_INCLOCKED_LONGINT}
-procedure inclocked(var l : longint);assembler;
+procedure cpuinclocked(var l : longint);assembler;
 
   asm
 {$ifndef REGCALL}
      movl       l,%eax
 {$endif}
-     { this check should be done because a lock takes a lot }
-     { of time!                                             }
-     cmpb       $0,IsMultithread
-     jz         .Linclockednolock
      lock
      incl       (%eax)
-     jmp        .Linclockedend
-.Linclockednolock:
-     incl       (%eax)
-.Linclockedend:
   end;
 
+// inline SMP check and normal lock.
+// the locked one is so slow, inlining doesn't matter.
+function declocked(var l : longint) : boolean; inline;
+
+begin
+  if not ismultithread then
+    begin
+     dec(l);
+     declocked:=l=0;
+    end
+   else
+    declocked:=cpudeclocked(l);
+end;
+
+procedure inclocked(var l : longint); inline;
+
+begin
+  if not ismultithread then
+    inc(l)
+   else
+    cpuinclocked(l);
+end;
+
+
 {****************************************************************************
                                   FPU
 ****************************************************************************}
@@ -1135,5 +1146,82 @@ asm
     fwait
 end;
 
+{$define FPC_SYSTEM_HAS_ANSISTR_DECR_REF}
+function fpc_freemem_x(p:pointer):ptrint; [external name 'FPC_FREEMEM_X'];
 
+Procedure fpc_AnsiStr_Decr_Ref (Var S : Pointer); [Public,Alias:'FPC_ANSISTR_DECR_REF']; compilerproc; nostackframe; assembler;
+asm
+  cmpl $0,(%eax)
+  jne .Ldecr_ref_continue
+  ret
+.Ldecr_ref_continue:
+// Temps allocated between ebp-24 and ebp+0
+	subl	$4,%esp
+// Var S located in register
+// Var l located in register
+	movl	%eax,(%esp)
+.Lj3599:
+// [101] l:=@PAnsiRec(S-FirstOff)^.Ref;
+	movl	(%esp),%edx
+	movl	(%edx),%edx
+	subl	$8,%edx
+// [102] If l^<0 then exit;
+	movl	(%edx),%eax
+	testl	%eax,%eax
+	jl	.Lj3596
+.Lj3603:
+// [104] If declocked(l^) then	
+	movb	ismultithread,%al
+	testb	%al,%al
+	jne	.Lj3610
+	decl	(%edx)
+	je .Lj3620
+	addl $4,%esp
+	ret
+.Lj3610:
+	movl	%edx,%eax
+	call	cpudeclocked
+	movb	%al,%cl
+.Lj3613:
+	testb	%cl,%cl
+	je	.Lj3605
+.Lj3620:
+	movl	(%esp),%eax
+	movl	(%eax),%eax
+	subl  $8,%eax
+	call	FPC_FREEMEM_X
+	movl	(%esp),%eax
+	movl	$0,(%eax)
+.Lj3618:
+.Lj3605:
+.Lj3596:
+// [107] end;
+  addl $4,%esp
+end;
+
+function fpc_truely_ansistr_unique(Var S : Pointer): Pointer; forward;
+
+{$define FPC_SYSTEM_HAS_ANSISTR_UNIQUE}
+Function fpc_ansistr_Unique(Var S : Pointer): Pointer; [Public,Alias : 'FPC_ANSISTR_UNIQUE']; compilerproc; nostackframe;assembler;
+asm
+// Var S located in register
+// Var $result located in register
+	movl	%eax,%edx
+// [437] pointer(result) := pointer(s);
+	movl	(%eax),%eax
+// [438] If Pointer(S)=Nil then
+	testl	%eax,%eax
+	je	.Lj4031
+.Lj4036:
+// [440] if PAnsiRec(Pointer(S)-Firstoff)^.Ref<>1 then	
+	movl	-8(%eax),%ecx
+	cmpl	$1,%ecx
+	je	.Lj4038
+// [441] result:=fpc_truely_ansistr_unique(s);
+	movl	%edx,%eax
+	call	fpc_truely_ansistr_unique
+.Lj4038:
+.Lj4031:
+// [442] end;
+end;
 

+ 40 - 35
rtl/inc/astrings.inc

@@ -73,7 +73,7 @@ begin
 end;
 
 
-Procedure DisposeAnsiString(Var S : Pointer);
+Procedure DisposeAnsiString(Var S : Pointer); {$IFNDEF VER2_0} Inline; {$ENDIF}
 {
   Deallocates a AnsiString From the heap.
 }
@@ -85,7 +85,7 @@ begin
   S:=Nil;
 end;
 
-
+{$ifndef FPC_SYSTEM_HAS_ANSISTR_DECR_REF}
 Procedure fpc_ansistr_decr_ref (Var S : Pointer); [Public,Alias:'FPC_ANSISTR_DECR_REF'];  compilerproc;
 {
   Decreases the ReferenceCount of a non constant ansistring;
@@ -101,17 +101,18 @@ Begin
   { check for constant strings ...}
   l:=@PAnsiRec(S-FirstOff)^.Ref;
   If l^<0 then exit;
-
   { declocked does a MT safe dec and returns true, if the counter is 0 }
   If declocked(l^) then
     { Ref count dropped to zero }
     DisposeAnsiString (S);        { Remove...}
 end;
 
+{$endif FPC_SYSTEM_HAS_ANSISTR_DECR_REF}
+
 { also define alias for internal use in the system unit }
 Procedure fpc_ansistr_decr_ref (Var S : Pointer); [external name 'FPC_ANSISTR_DECR_REF'];
 
-Procedure fpc_AnsiStr_Incr_Ref (S : Pointer); [Public,Alias:'FPC_ANSISTR_INCR_REF'];  compilerproc;
+Procedure fpc_AnsiStr_Incr_Ref (S : Pointer); [Public,Alias:'FPC_ANSISTR_INCR_REF'];  compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 Begin
   If S=Nil then
     exit;
@@ -120,6 +121,7 @@ Begin
   inclocked(PAnsiRec(S-FirstOff)^.Ref);
 end;
 
+
 { also define alias which can be used inside the system unit }
 Procedure fpc_AnsiStr_Incr_Ref (S : Pointer); [external name 'FPC_ANSISTR_INCR_REF'];
 
@@ -417,30 +419,38 @@ end;
                      Public functions, In interface.
 *****************************************************************************}
 
+function fpc_truely_ansistr_unique(Var S : Pointer): Pointer; 
+Var
+  SNew : Pointer;
+  L    : SizeInt;
+begin
+  L:=PAnsiRec(Pointer(S)-FirstOff)^.len;
+  SNew:=NewAnsiString (L);
+  Move (Pointer(S)^,SNew^,L+1);
+  PAnsiRec(SNew-FirstOff)^.len:=L;
+  fpc_ansistr_decr_ref (Pointer(S));  { Thread safe }
+  pointer(S):=SNew;
+  pointer(result):=SNew;
+end;
 
-Function fpc_ansistr_Unique(Var S : Pointer): Pointer; [Public,Alias : 'FPC_ANSISTR_UNIQUE']; compilerproc;
+
+{$ifndef FPC_SYSTEM_HAS_ANSISTR_UNIQUE}
+// MV: inline the basic checks for case that S is already unique.
+// Rest is too complex to inline, so factor that out as a call.
+Function fpc_ansistr_Unique(Var S : Pointer): Pointer; [Public,Alias : 'FPC_ANSISTR_UNIQUE']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 {
   Make sure reference count of S is 1,
   using copy-on-write semantics.
 }
-Var
-  SNew : Pointer;
-  L    : SizeInt;
 begin
   pointer(result) := pointer(s);
   If Pointer(S)=Nil then
     exit;
   if PAnsiRec(Pointer(S)-Firstoff)^.Ref<>1 then
-   begin
-     L:=PAnsiRec(Pointer(S)-FirstOff)^.len;
-     SNew:=NewAnsiString (L);
-     Move (Pointer(S)^,SNew^,L+1);
-     PAnsiRec(SNew-FirstOff)^.len:=L;
-     fpc_ansistr_decr_ref (Pointer(S));  { Thread safe }
-     pointer(S):=SNew;
-     pointer(result):=SNew;
-   end;
+    result:=fpc_truely_ansistr_unique(s);
 end;
+{$endif FPC_SYSTEM_HAS_ANSISTR_UNIQUE}
+
 
 Procedure fpc_ansistr_append_char(Var S : AnsiString;c : char); [Public,Alias : 'FPC_ANSISTR_APPEND_CHAR']; compilerproc;
 begin
@@ -581,7 +591,7 @@ begin
 end;
 
 
-Function fpc_Val_Real_AnsiStr(Const S : AnsiString; Var Code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_ANSISTR']; compilerproc;
+Function fpc_Val_Real_AnsiStr(Const S : AnsiString; out Code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_ANSISTR']; compilerproc;
 Var
   SS : String;
 begin
@@ -596,7 +606,7 @@ begin
 end;
 
 
-Function fpc_Val_UInt_AnsiStr (Const S : AnsiString; Var Code : ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_ANSISTR']; compilerproc;
+Function fpc_Val_UInt_AnsiStr (Const S : AnsiString; out Code : ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_ANSISTR']; compilerproc;
 Var
   SS : ShortString;
 begin
@@ -611,7 +621,7 @@ begin
 end;
 
 
-Function fpc_Val_SInt_AnsiStr (DestSize: SizeInt; Const S : AnsiString; Var Code : ValSInt): ValSInt; [public, alias:'FPC_VAL_SINT_ANSISTR']; compilerproc;
+Function fpc_Val_SInt_AnsiStr (DestSize: SizeInt; Const S : AnsiString; out Code : ValSInt): ValSInt; [public, alias:'FPC_VAL_SINT_ANSISTR']; compilerproc;
 Var
   SS : ShortString;
 begin
@@ -628,7 +638,7 @@ end;
 
 {$ifndef CPU64}
 
-Function fpc_Val_qword_AnsiStr (Const S : AnsiString; Var Code : ValSInt): qword; [public, alias:'FPC_VAL_QWORD_ANSISTR']; compilerproc;
+Function fpc_Val_qword_AnsiStr (Const S : AnsiString; out Code : ValSInt): qword; [public, alias:'FPC_VAL_QWORD_ANSISTR']; compilerproc;
 Var
   SS : ShortString;
 begin
@@ -643,7 +653,7 @@ begin
 end;
 
 
-Function fpc_Val_int64_AnsiStr (Const S : AnsiString; Var Code : ValSInt): Int64; [public, alias:'FPC_VAL_INT64_ANSISTR']; compilerproc;
+Function fpc_Val_int64_AnsiStr (Const S : AnsiString; out Code : ValSInt): Int64; [public, alias:'FPC_VAL_INT64_ANSISTR']; compilerproc;
 Var
   SS : ShortString;
 begin
@@ -660,7 +670,7 @@ end;
 {$endif CPU64}
 
 
-procedure fpc_AnsiStr_Float(d : ValReal;len,fr,rt : SizeInt;var s : ansistring);[public,alias:'FPC_ANSISTR_FLOAT']; compilerproc;
+procedure fpc_AnsiStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : ansistring);[public,alias:'FPC_ANSISTR_FLOAT']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 var
   ss: ShortString;
 begin
@@ -669,7 +679,7 @@ begin
 end;
 
 
-Procedure fpc_AnsiStr_UInt(v : ValUInt;Len : SizeInt; Var S : AnsiString);[Public,Alias : 'FPC_ANSISTR_VALUINT']; compilerproc;
+Procedure fpc_AnsiStr_UInt(v : ValUInt;Len : SizeInt; out S : AnsiString);[Public,Alias : 'FPC_ANSISTR_VALUINT']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 Var
   SS : ShortString;
 begin
@@ -679,7 +689,7 @@ end;
 
 
 
-Procedure fpc_AnsiStr_SInt(v : ValSInt;Len : SizeInt; Var S : AnsiString);[Public,Alias : 'FPC_ANSISTR_VALSINT']; compilerproc;
+Procedure fpc_AnsiStr_SInt(v : ValSInt;Len : SizeInt; out S : AnsiString);[Public,Alias : 'FPC_ANSISTR_VALSINT']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 Var
   SS : ShortString;
 begin
@@ -690,7 +700,7 @@ end;
 
 {$ifndef CPU64}
 
-Procedure fpc_AnsiStr_QWord(v : QWord;Len : SizeInt; Var S : AnsiString);[Public,Alias : 'FPC_ANSISTR_QWORD']; compilerproc;
+Procedure fpc_AnsiStr_QWord(v : QWord;Len : SizeInt; out S : AnsiString);[Public,Alias : 'FPC_ANSISTR_QWORD']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 Var
   SS : ShortString;
 begin
@@ -698,9 +708,7 @@ begin
   S:=SS;
 end;
 
-
-
-Procedure fpc_AnsiStr_Int64(v : Int64; Len : SizeInt; Var S : AnsiString);[Public,Alias : 'FPC_ANSISTR_INT64']; compilerproc;
+Procedure fpc_AnsiStr_Int64(v : Int64; Len : SizeInt; out S : AnsiString);[Public,Alias : 'FPC_ANSISTR_INT64']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 Var
   SS : ShortString;
 begin
@@ -710,7 +718,6 @@ end;
 
 {$endif CPU64}
 
-
 Procedure Delete (Var S : AnsiString; Index,Size: SizeInt);
 Var
   LS : SizeInt;
@@ -723,8 +730,8 @@ begin
      Size:=LS-Index+1;
   If (Size<=LS-Index) then
     begin
-    Dec(Index);
-    Move(PByte(Pointer(S))[Index+Size],PByte(Pointer(S))[Index],LS-Index-Size+1);
+      Dec(Index);
+      Move(PByte(Pointer(S))[Index+Size],PByte(Pointer(S))[Index],LS-Index-Size+1);
     end;
   Setlength(S,LS-Size);
 end;
@@ -760,7 +767,7 @@ begin
   FillChar(Pointer(StringOfChar)^,Length(StringOfChar),c);
 end;
 
-Procedure SetString (Out S : AnsiString; Buf : PChar; Len : SizeInt);
+Procedure SetString (Out S : AnsiString; Buf : PChar; Len : SizeInt); {$IFNDEF VER2_0} Inline; {$ENDIF}
 begin
   SetLength(S,Len);
   If (Buf<>Nil) then
@@ -788,5 +795,3 @@ begin
   for i := 1 to length (s) do
     result[i] := lowercase(s[i]);
 end;
-
-

+ 14 - 14
rtl/inc/cgeneric.inc

@@ -21,10 +21,10 @@
 
 {$ifndef FPC_SYSTEM_HAS_MOVE}
 {$define FPC_SYSTEM_HAS_MOVE}
-procedure bcopy(const source;var dest;count:cardinal); cdecl; external 'c' name 'bcopy';
+procedure bcopy(const source;var dest;count:sizeuint); cdecl; external 'c' name 'bcopy';
 
 { we need this separate move declaration because we can't add a "public, alias" to the above }
-procedure Move(const source;var dest;count:longint); [public, alias: 'FPC_MOVE'];{$ifdef SYSTEMINLINE}inline;{$endif}
+procedure Move(const source;var dest;count:sizeint); [public, alias: 'FPC_MOVE'];{$ifdef SYSTEMINLINE}inline;{$endif}
 begin
   if count <= 0 then
     exit;
@@ -35,9 +35,9 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_FILLCHAR}
 {$define FPC_SYSTEM_HAS_FILLCHAR}
-procedure memset(var x; value: byte; count: cardinal); cdecl; external 'c';
+procedure memset(var x; value: byte; count: sizeuint); cdecl; external 'c';
 
-Procedure FillChar(var x;count: longint;value:byte);{$ifdef SYSTEMINLINE}inline;{$endif}
+Procedure FillChar(var x;count: sizeint;value:byte);{$ifdef SYSTEMINLINE}inline;{$endif}
 begin
   if count <= 0 then
     exit;
@@ -48,7 +48,7 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_FILLBYTE}
 {$define FPC_SYSTEM_HAS_FILLBYTE}
-procedure FillByte (var x;count : longint;value : byte );{$ifdef SYSTEMINLINE}inline;{$endif}
+procedure FillByte (var x;count : sizeint;value : byte );{$ifdef SYSTEMINLINE}inline;{$endif}
 begin
   if count <= 0 then
     exit;
@@ -60,9 +60,9 @@ end;
 {$ifndef FPC_SYSTEM_HAS_INDEXCHAR}
 {$define FPC_SYSTEM_HAS_INDEXCHAR}
 
-function memchr(const buf; b: longint; len: cardinal): pointer; cdecl; external 'c';
+function memchr(const buf; b: sizeuint; len: cardinal): pointer; cdecl; external 'c';
 
-function IndexChar(Const buf;len:longint;b:char):longint;
+function IndexChar(Const buf;len:sizeint;b:char):sizeint;
 var
   res: pointer;
 begin
@@ -82,7 +82,7 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_INDEXBYTE}
 {$define FPC_SYSTEM_HAS_INDEXBYTE}
-function IndexByte(Const buf;len:longint;b:byte):longint;{$ifdef SYSTEMINLINE}inline;{$endif}
+function IndexByte(Const buf;len:sizeint;b:byte):sizeint;{$ifdef SYSTEMINLINE}inline;{$endif}
 begin
   IndexByte:=IndexChar(buf,len,char(b));
 end;
@@ -91,9 +91,9 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_COMPARECHAR}
 {$define FPC_SYSTEM_HAS_COMPARECHAR}
-function memcmp_comparechar(Const buf1,buf2;len:cardinal):longint; cdecl; external 'c' name 'memcmp';
+function memcmp_comparechar(Const buf1,buf2;len:sizeuint):longint; cdecl; external 'c' name 'memcmp';
 
-function CompareChar(Const buf1,buf2;len:longint):longint;
+function CompareChar(Const buf1,buf2;len:sizeint):sizeint;
 var
   res: longint;
 begin
@@ -112,7 +112,7 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_COMPAREBYTE}
 {$define FPC_SYSTEM_HAS_COMPAREBYTE}
-function CompareByte(Const buf1,buf2;len:longint):longint;{$ifdef SYSTEMINLINE}inline;{$endif}
+function CompareByte(Const buf1,buf2;len:sizeint):sizeint;{$ifdef SYSTEMINLINE}inline;{$endif}
 begin
   CompareByte := CompareChar(buf1,buf2,len);
 end;
@@ -121,9 +121,9 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_COMPARECHAR0}
 {$define FPC_SYSTEM_HAS_COMPARECHAR0}
-function strncmp_comparechar0(Const buf1,buf2;len:cardinal):longint; cdecl; external 'c' name 'strncmp';
+function strncmp_comparechar0(Const buf1,buf2;len:sizeuint):longint; cdecl; external 'c' name 'strncmp';
 
-function CompareChar0(Const buf1,buf2;len:longint):longint;{$ifdef SYSTEMINLINE}inline;{$endif}
+function CompareChar0(Const buf1,buf2;len:sizeint):sizeint;{$ifdef SYSTEMINLINE}inline;{$endif}
 begin
   if len <= 0 then
     exit(0);
@@ -137,7 +137,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH}
 {$define FPC_SYSTEM_HAS_FPC_PCHAR_LENGTH}
 
-function libc_pchar_length(p:pchar):cardinal; cdecl; external 'c' name 'strlen';
+function libc_pchar_length(p:pchar):sizeuint; cdecl; external 'c' name 'strlen';
 
 function fpc_pchar_length(p:pchar):longint;[public,alias:'FPC_PCHAR_LENGTH']; compilerproc;
 begin

+ 2 - 2
rtl/inc/cgenmath.inc

@@ -45,9 +45,9 @@
 
 {$ifndef SYSTEM_HAS_FREXP}
 {$define SYSTEM_HAS_FREXP}
-    function c_frexp(x: double; var e: longint): double; cdecl; external 'c' name 'frexp';
+    function c_frexp(x: double; out e: longint): double; cdecl; external 'c' name 'frexp';
 
-    function frexp(x:Real; var e:Integer ):Real; {$ifdef MATHINLINE}inline;{$endif}
+    function frexp(x:Real; out e:Integer ):Real; {$ifdef MATHINLINE}inline;{$endif}
     var
       l: longint;
     begin

+ 38 - 38
rtl/inc/compproc.inc

@@ -63,50 +63,50 @@ procedure fpc_dynarray_incr_ref(p : pointer); compilerproc;
 procedure fpc_dynarray_setlength(var p : pointer;pti : pointer; dimcount : dword;dims : pdynarrayindex); compilerproc;
 
 { Str() support }
-procedure fpc_ShortStr_sint(v : valsint;len : SizeInt;var s : shortstring); compilerproc;
-procedure fpc_shortstr_uint(v : valuint;len : SizeInt;var s : shortstring); compilerproc;
-procedure fpc_chararray_sint(v : valsint;len : SizeInt;var a : array of char); compilerproc;
-procedure fpc_chararray_uint(v : valuint;len : SizeInt;var a : array of char); compilerproc;
-procedure fpc_AnsiStr_sint(v : valsint; Len : SizeInt; Var S : AnsiString); compilerproc;
-procedure fpc_AnsiStr_uint(v : valuint;Len : SizeInt; Var S : AnsiString); compilerproc;
-procedure fpc_WideStr_sint(v : valsint; Len : SizeInt; Var S : WideString); compilerproc;
-procedure fpc_WideStr_uint(v : valuint;Len : SizeInt; Var S : WideString); compilerproc;
+procedure fpc_ShortStr_sint(v : valsint;len : SizeInt;out s : shortstring); compilerproc;
+procedure fpc_shortstr_uint(v : valuint;len : SizeInt;out s : shortstring); compilerproc;
+procedure fpc_chararray_sint(v : valsint;len : SizeInt;out a : array of char); compilerproc;
+procedure fpc_chararray_uint(v : valuint;len : SizeInt;out a : array of char); compilerproc;
+procedure fpc_AnsiStr_sint(v : valsint; Len : SizeInt; out S : AnsiString); compilerproc;
+procedure fpc_AnsiStr_uint(v : valuint;Len : SizeInt; out S : AnsiString); compilerproc;
+procedure fpc_WideStr_sint(v : valsint; Len : SizeInt; out S : WideString); compilerproc;
+procedure fpc_WideStr_uint(v : valuint;Len : SizeInt; out S : WideString); compilerproc;
 {$ifndef CPU64}
-procedure fpc_shortstr_qword(v : qword;len : SizeInt;var s : shortstring); compilerproc;
-procedure fpc_shortstr_int64(v : int64;len : SizeInt;var s : shortstring); compilerproc;
-procedure fpc_chararray_qword(v : qword;len : SizeInt;var a : array of char); compilerproc;
-procedure fpc_chararray_int64(v : int64;len : SizeInt;var a : array of char); compilerproc;
-procedure fpc_ansistr_qword(v : qword;len : SizeInt;var s : ansistring); compilerproc;
-procedure fpc_ansistr_int64(v : int64;len : SizeInt;var s : ansistring); compilerproc;
-procedure fpc_widestr_qword(v : qword;len : SizeInt;var s : widestring); compilerproc;
-procedure fpc_widestr_int64(v : int64;len : SizeInt;var s : widestring); compilerproc;
+procedure fpc_shortstr_qword(v : qword;len : SizeInt;out s : shortstring); compilerproc;
+procedure fpc_shortstr_int64(v : int64;len : SizeInt;out s : shortstring); compilerproc;
+procedure fpc_chararray_qword(v : qword;len : SizeInt;out a : array of char); compilerproc;
+procedure fpc_chararray_int64(v : int64;len : SizeInt;out a : array of char); compilerproc;
+procedure fpc_ansistr_qword(v : qword;len : SizeInt;out s : ansistring); compilerproc;
+procedure fpc_ansistr_int64(v : int64;len : SizeInt;out s : ansistring); compilerproc;
+procedure fpc_widestr_qword(v : qword;len : SizeInt;out s : widestring); compilerproc;
+procedure fpc_widestr_int64(v : int64;len : SizeInt;out s : widestring); compilerproc;
 {$endif CPU64}
-procedure fpc_ShortStr_Float(d : ValReal;len,fr,rt : SizeInt;var s : shortstring); compilerproc;
-procedure fpc_chararray_Float(d : ValReal;len,fr,rt : SizeInt;var a : array of char); compilerproc;
-procedure fpc_AnsiStr_Float(d : ValReal;len,fr,rt : SizeInt;var s : ansistring); compilerproc;
-procedure fpc_WideStr_Float(d : ValReal;len,fr,rt : SizeInt;var s : WideString); compilerproc;
+procedure fpc_ShortStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : shortstring); compilerproc;
+procedure fpc_chararray_Float(d : ValReal;len,fr,rt : SizeInt;out a : array of char); compilerproc;
+procedure fpc_AnsiStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : ansistring); compilerproc;
+procedure fpc_WideStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : WideString); compilerproc;
 
 { Val() support }
-Function fpc_Val_Real_ShortStr(const s : shortstring; var code : ValSInt): ValReal; compilerproc;
-Function fpc_Val_Real_AnsiStr(Const S : AnsiString; Var Code : ValSInt): ValReal; compilerproc;
-Function fpc_Val_Real_WideStr(Const S : WideString; Var Code : ValSInt): ValReal; compilerproc;
-Function fpc_Val_SInt_ShortStr(DestSize: SizeInt; Const S: ShortString; var Code: ValSInt): ValSInt; compilerproc;
-Function fpc_Val_UInt_Shortstr(Const S: ShortString; var Code: ValSInt): ValUInt; compilerproc;
-Function fpc_Val_UInt_AnsiStr (Const S : AnsiString; Var Code : ValSInt): ValUInt; compilerproc;
-Function fpc_Val_SInt_AnsiStr (DestSize: SizeInt; Const S : AnsiString; Var Code : ValSInt): ValSInt; compilerproc;
-Function fpc_Val_UInt_WideStr (Const S : WideString; Var Code : ValSInt): ValUInt; compilerproc;
-Function fpc_Val_SInt_WideStr (DestSize: SizeInt; Const S : WideString; Var Code : ValSInt): ValSInt; compilerproc;
+Function fpc_Val_Real_ShortStr(const s : shortstring; out code : ValSInt): ValReal; compilerproc;
+Function fpc_Val_Real_AnsiStr(Const S : AnsiString; out Code : ValSInt): ValReal; compilerproc;
+Function fpc_Val_Real_WideStr(Const S : WideString; out Code : ValSInt): ValReal; compilerproc;
+Function fpc_Val_SInt_ShortStr(DestSize: SizeInt; Const S: ShortString; out Code: ValSInt): ValSInt; compilerproc;
+Function fpc_Val_UInt_Shortstr(Const S: ShortString; out Code: ValSInt): ValUInt; compilerproc;
+Function fpc_Val_UInt_AnsiStr (Const S : AnsiString; out Code : ValSInt): ValUInt; compilerproc;
+Function fpc_Val_SInt_AnsiStr (DestSize: SizeInt; Const S : AnsiString; out Code : ValSInt): ValSInt; compilerproc;
+Function fpc_Val_UInt_WideStr (Const S : WideString; out Code : ValSInt): ValUInt; compilerproc;
+Function fpc_Val_SInt_WideStr (DestSize: SizeInt; Const S : WideString; out Code : ValSInt): ValSInt; compilerproc;
 {$ifndef CPU64}
-Function fpc_val_int64_shortstr(Const S: ShortString; var Code: ValSInt): Int64; compilerproc;
-Function fpc_val_qword_shortstr(Const S: ShortString; var Code: ValSInt): QWord; compilerproc;
-Function fpc_Val_qword_AnsiStr (Const S : AnsiString; Var Code : ValSInt): qword;compilerproc;
-Function fpc_Val_int64_AnsiStr (Const S : AnsiString; Var Code : ValSInt): Int64; compilerproc;
-Function fpc_Val_qword_WideStr (Const S : WideString; Var Code : ValSInt): qword; compilerproc;
-Function fpc_Val_int64_WideStr (Const S : WideString; Var Code : ValSInt): Int64; compilerproc;
+Function fpc_val_int64_shortstr(Const S: ShortString; out Code: ValSInt): Int64; compilerproc;
+Function fpc_val_qword_shortstr(Const S: ShortString; out Code: ValSInt): QWord; compilerproc;
+Function fpc_Val_qword_AnsiStr (Const S : AnsiString; out Code : ValSInt): qword;compilerproc;
+Function fpc_Val_int64_AnsiStr (Const S : AnsiString; out Code : ValSInt): Int64; compilerproc;
+Function fpc_Val_qword_WideStr (Const S : WideString; out Code : ValSInt): qword; compilerproc;
+Function fpc_Val_int64_WideStr (Const S : WideString; out Code : ValSInt): Int64; compilerproc;
 {$endif CPU64}
 
-Procedure fpc_AnsiStr_Decr_Ref (Var S : Pointer); compilerproc;
-Procedure fpc_AnsiStr_Incr_Ref (S : Pointer); compilerproc;
+Procedure fpc_ansistr_decr_ref (Var S : Pointer); compilerproc;
+Procedure fpc_ansistr_incr_ref (S : Pointer); compilerproc;
 Procedure fpc_AnsiStr_Assign (Var S1 : Pointer;S2 : Pointer); compilerproc;
 function fpc_AnsiStr_Concat (const S1,S2 : AnsiString): AnsiString; compilerproc;
 Procedure fpc_ansistr_append_char(Var S : AnsiString;c : char); compilerproc;
@@ -131,7 +131,7 @@ Function fpc_AnsiStr_ShortStr_Compare (Var S1 : Pointer; Var S2 : ShortString):
 { pointer argument because otherwise when calling this, we get }
 { an endless loop since a 'var s: ansistring' must be made     }
 { unique as well                                               }
-Function fpc_ansistr_Unique(Var S : Pointer): Pointer; compilerproc;
+Function fpc_ansistr_Unique(Var S : Pointer): Pointer; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 
 Procedure fpc_WideStr_Decr_Ref (Var S : Pointer); compilerproc;
 Procedure fpc_WideStr_Incr_Ref (S : Pointer); compilerproc;

+ 4 - 4
rtl/inc/generic.inc

@@ -1012,7 +1012,7 @@ function align(addr : Pointer;alignment : PtrInt) : Pointer;{$ifdef SYSTEMINLINE
 
 {$ifndef FPC_SYSTEM_HAS_INT_STR_LONGINT}
 
-procedure int_str(l : longint;var s : string);
+procedure int_str(l : longint;out s : string);
 var
   value: longint;
   negative: boolean;
@@ -1053,7 +1053,7 @@ var
 
 {$ifndef FPC_SYSTEM_HAS_INT_STR_LONGWORD}
 
-procedure int_str(l : longword;var s : string);
+procedure int_str(l : longword;out s : string);
 begin
   s:='';
   if l = 0 then
@@ -1072,7 +1072,7 @@ end;
 
 {$ifndef FPC_SYSTEM_HAS_INT_STR_INT64}
 
-procedure int_str(l : int64;var s : string);
+procedure int_str(l : int64;out s : string);
 var
   value: int64;
   negative: boolean;
@@ -1113,7 +1113,7 @@ var
 
 {$ifndef FPC_SYSTEM_HAS_INT_STR_QWORD}
 
-procedure int_str(l : qword;var s : string);
+procedure int_str(l : qword;out s : string);
 begin
   s:='';
   if l = 0 then

+ 1 - 1
rtl/inc/genmath.inc

@@ -404,7 +404,7 @@ type
 
 
 {$ifndef SYSTEM_HAS_FREXP}
-    function frexp(x:Real; var e:Integer ):Real;
+    function frexp(x:Real; out e:Integer ):Real;
     {*  frexp() extracts the exponent from x.  It returns an integer     *}
     {*  power of two to expnt and the significand between 0.5 and 1      *}
     {*  to y.  Thus  x = y * 2**expn.                                    *}

+ 219 - 276
rtl/inc/heap.inc

@@ -21,29 +21,25 @@
 { DEBUG: Dump info when the heap needs to grow }
 { define DUMPGROW}
 
-{ DEBUG: Test the FreeList on correctness }
-
-{$ifdef SYSTEMDEBUG}
-{$define TestFreeLists}
-{$endif SYSTEMDEBUG}
-
 const
 {$ifdef CPU64}
   blocksize    = 32;  { at least size of freerecord }
-  blockshr     = 5;   { shr value for blocksize=2^blockshr}
+  blockshift     = 5;   { shr value for blocksize=2^blockshift}
   maxblocksize = 512+blocksize; { 1024+8 needed for heaprecord }
 {$else}
   blocksize    = 16;  { at least size of freerecord }
-  blockshr     = 4;   { shr value for blocksize=2^blockshr}
+  blockshift     = 4;   { shr value for blocksize=2^blockshift}
   maxblocksize = 512+blocksize; { 1024+8 needed for heaprecord }
 {$endif}
   maxblockindex = maxblocksize div blocksize; { highest index in array of lists of memchunks }
   maxreusebigger = 8; { max reuse bigger tries }
 
-  usedflag = 1;        { flag if the block is used or not }
-  lastblockflag = 2;   { flag if the block is the last in os chunk }
-  firstblockflag = 4;  { flag if the block is the first in os chunk }
-  fixedsizeflag = 8;   { flag if the block is of fixed size }
+  { common flags }
+  fixedsizeflag  = 1;   { flag if the block is of fixed size }
+  { memchunk var flags }
+  usedflag       = 2;   { flag if the block is used or not }
+  lastblockflag  = 4;   { flag if the block is the last in os chunk }
+  firstblockflag = 8;   { flag if the block is the first in os chunk }
   sizemask = not(blocksize-1);
   fixedsizemask = sizemask and $ffff;
 
@@ -81,21 +77,27 @@ const
   );
 
 type
+  poschunk = ^toschunk;
+  toschunk = record
+    size,
+    used,
+    chunkindex : ptrint;
+    next,
+    prev  : poschunk;
+  end;
+
   pmemchunk_fixed  = ^tmemchunk_fixed;
   tmemchunk_fixed = record
-{$ifdef cpusparc}
-    { Sparc needs to alloc aligned on 8 bytes, to allow doubles }
-    _dummy : ptrint;
-{$endif cpusparc}
-    size  : ptrint;
+    size   : ptrint;
+    poc    : poschunk;
     next_fixed,
     prev_fixed : pmemchunk_fixed;
   end;
 
   pmemchunk_var  = ^tmemchunk_var;
   tmemchunk_var = record
+    size     : ptrint;
     prevsize : ptrint;
-    size  : ptrint;
     next_var,
     prev_var  : pmemchunk_var;
   end;
@@ -103,25 +105,16 @@ type
   { ``header'', ie. size of structure valid when chunk is in use }
   { should correspond to tmemchunk_var_hdr structure starting with the
     last field. Reason is that the overlap is starting from the end of the
-    record. }
+    record.
+    Alignment is 8 bytes for 32bit machines. This required
+    for x86 MMX/SSE and for sparc Double values }
   tmemchunk_fixed_hdr = record
-{$ifdef cpusparc}
-    { Sparc needs to alloc aligned on 8 bytes, to allow doubles }
-    _dummy : ptrint;
-{$endif cpusparc}
-    size : ptrint;
+    size     : ptrint;
+    poschunk : pointer;
   end;
   tmemchunk_var_hdr = record
-    prevsize : ptrint;
-    size : ptrint;
-  end;
-
-  poschunk = ^toschunk;
-  toschunk = record
-    size : ptrint;
-    next,
-    prev : poschunk;
-    used : ptrint;
+    prevsize,
+    size     : ptrint;
   end;
 
   tfreelists   = array[1..maxblockindex] of pmemchunk_fixed;
@@ -136,11 +129,6 @@ var
   freeoslist         : poschunk;
   freeoslistcount    : dword;
 
-{$ifdef TestFreeLists}
-{ this can be turned on by debugger }
-const
-  test_each : boolean = false;
-{$endif TestFreeLists}
 
 {*****************************************************************************
                              Memory Manager
@@ -315,7 +303,7 @@ end;
 
 
 { Delphi style }
-function FreeMem(p:pointer):ptrint;
+function FreeMem(p:pointer):ptrint;[Public,Alias:'FPC_FREEMEM_X'];
 begin
   if IsMultiThread and MemoryManager.NeedLock then
    begin
@@ -332,6 +320,7 @@ begin
    end;
 end;
 
+
 function FreeMemory(p:pointer):ptrint;
 
 begin
@@ -504,41 +493,12 @@ end;
 {$endif}
 
 
-{$ifdef TestFreeLists}
-procedure TestFreeLists;
-var
-  i,j : ptrint;
-  mc  : pmemchunk_fixed;
-begin
-  for i := 1 to maxblockindex do
-   begin
-    j := 0;
-    mc := freelists_fixed[i];
-    while assigned(mc) do
-      begin
-        inc(j);
-      if ((mc^.size and fixedsizemask) <> i * blocksize) then
-          RunError(204);
-      mc := mc^.next_fixed;
-      end;
-    end;
-end;
-{$endif TestFreeLists}
 
 {*****************************************************************************
                                 List adding/removal
 *****************************************************************************}
 
-procedure append_to_list_fixed(blockindex: ptrint; pmc: pmemchunk_fixed);
-begin
-  pmc^.prev_fixed := nil;
-  pmc^.next_fixed := freelists_fixed[blockindex];
-  if freelists_fixed[blockindex]<>nil then
-    freelists_fixed[blockindex]^.prev_fixed := pmc;
-  freelists_fixed[blockindex] := pmc;
-end;
-
-procedure append_to_list_var(pmc: pmemchunk_var);
+procedure append_to_list_var(pmc: pmemchunk_var);inline;
 begin
   pmc^.prev_var := nil;
   pmc^.next_var := freelist_var;
@@ -547,17 +507,7 @@ begin
   freelist_var := pmc;
 end;
 
-procedure remove_from_list_fixed(blockindex: ptrint; pmc: pmemchunk_fixed);
-begin
-  if assigned(pmc^.next_fixed) then
-    pmc^.next_fixed^.prev_fixed := pmc^.prev_fixed;
-  if assigned(pmc^.prev_fixed) then
-    pmc^.prev_fixed^.next_fixed := pmc^.next_fixed
-  else
-    freelists_fixed[blockindex] := pmc^.next_fixed;
-end;
-
-procedure remove_from_list_var(pmc: pmemchunk_var);
+procedure remove_from_list_var(pmc: pmemchunk_var);inline;
 begin
   if assigned(pmc^.next_var) then
     pmc^.next_var^.prev_var := pmc^.prev_var;
@@ -571,8 +521,8 @@ procedure append_to_oslist(poc: poschunk);
 begin
   { decide whether to free block or add to list }
 {$ifdef HAS_SYSOSFREE}
-  if (freeoslistcount >= MaxKeptOSChunks)
-  or (poc^.size > growheapsize2) then
+  if (freeoslistcount >= MaxKeptOSChunks) or
+     (poc^.size > growheapsize2) then
     begin
       dec(internal_status.currheapsize, poc^.size);
       SysOSFree(poc, poc^.size);
@@ -612,16 +562,25 @@ begin
   append_to_oslist(poc);
 end;
 
-procedure append_to_oslist_fixed(blockindex, chunksize: ptrint; poc: poschunk);
+procedure append_to_oslist_fixed(poc: poschunk);
 var
   pmc: pmemchunk_fixed;
+  chunksize,
+  chunkindex,
   i, count: ptrint;
 begin
-  count := (poc^.size - sizeof(toschunk)) div chunksize;
+  chunkindex:=poc^.chunkindex;
+  chunksize:=chunkindex shl blockshift;
   pmc := pmemchunk_fixed(pointer(poc)+sizeof(toschunk));
+  count := (poc^.size - sizeof(toschunk)) div chunksize;
   for i := 0 to count - 1 do
     begin
-      remove_from_list_fixed(blockindex, pmc);
+      if assigned(pmc^.next_fixed) then
+        pmc^.next_fixed^.prev_fixed := pmc^.prev_fixed;
+      if assigned(pmc^.prev_fixed) then
+        pmc^.prev_fixed^.next_fixed := pmc^.next_fixed
+      else
+        freelists_fixed[chunkindex] := pmc^.next_fixed;
       pmc := pointer(pmc)+chunksize;
     end;
   append_to_oslist(poc);
@@ -654,6 +613,7 @@ begin
     end;
 end;
 
+
 {*****************************************************************************
                          Try concat freerecords
 *****************************************************************************}
@@ -750,35 +710,40 @@ end;
                                 Grow Heap
 *****************************************************************************}
 
-function alloc_oschunk(blockindex, size: ptrint): pointer;
+function alloc_oschunk(chunkindex, size: ptrint):pointer;
 var
+  pmcfirst,
+  pmclast,
   pmc       : pmemchunk_fixed;
   pmcv      : pmemchunk_var;
+  poc       : poschunk;
+  chunksize,
   minsize,
   maxsize,
   i, count  : ptrint;
-  chunksize : ptrint;
 begin
+  result:=nil;
+  chunksize:=chunkindex shl blockshift;
   { increase size by size needed for os block header }
   minsize := size + sizeof(toschunk);
-  if blockindex<>0 then
-    maxsize := (size * $ffff) + sizeof(toschunk)
+  if chunkindex<>0 then
+    maxsize := (chunksize * $ffff) + sizeof(toschunk)
   else
     maxsize := high(ptrint);
   { blocks available in freelist? }
-  result := freeoslist;
-  while result <> nil do
+  poc := freeoslist;
+  while poc <> nil do
     begin
-      if (poschunk(result)^.size >= minsize) and
-         (poschunk(result)^.size <= maxsize) then
+      if (poc^.size >= minsize) and
+         (poc^.size <= maxsize) then
         begin
-          size := poschunk(result)^.size;
-          remove_from_oslist(poschunk(result));
+          size := poc^.size;
+          remove_from_oslist(poc);
           break;
         end;
-      result := poschunk(result)^.next;
+      poc := poc^.next;
     end;
-  if result = nil then
+  if poc = nil then
     begin
 {$ifdef DUMPGROW}
       writeln('growheap(',size,')  allocating ',(size+sizeof(toschunk)+$ffff) and $ffff0000);
@@ -787,135 +752,131 @@ begin
       { allocate by 64K size }
       size := (size+sizeof(toschunk)+$ffff) and not $ffff;
       { allocate smaller blocks for fixed-size chunks }
-      if blockindex<>0 then
+      if chunksize<>0 then
         begin
-          result := SysOSAlloc(GrowHeapSizeSmall);
-          if result<>nil then
+          poc := SysOSAlloc(GrowHeapSizeSmall);
+          if poc<>nil then
             size := GrowHeapSizeSmall;
         end
-    { first try 256K (default) }
-    else if size<=GrowHeapSize1 then
-      begin
-        result := SysOSAlloc(GrowHeapSize1);
-        if result<>nil then
-          size := GrowHeapSize1;
-      end
-    { second try 1024K (default) }
-    else if size<=GrowHeapSize2 then
-      begin
-        result := SysOSAlloc(GrowHeapSize2);
-        if result<>nil then
-          size := GrowHeapSize2;
-      end
-    { else allocate the needed bytes }
-    else
-      result := SysOSAlloc(size);
-    { try again }
-    if result=nil then
-    begin
-      result := SysOSAlloc(size);
-      if (result=nil) then
+      { first try 256K (default) }
+      else if size<=GrowHeapSize1 then
+        begin
+          poc := SysOSAlloc(GrowHeapSize1);
+          if poc<>nil then
+            size := GrowHeapSize1;
+        end
+      { second try 1024K (default) }
+      else if size<=GrowHeapSize2 then
         begin
-          if ReturnNilIfGrowHeapFails then
-            exit
-          else
-            HandleError(203);
+          poc := SysOSAlloc(GrowHeapSize2);
+          if poc<>nil then
+            size := GrowHeapSize2;
+        end
+      { else allocate the needed bytes }
+      else
+        poc := SysOSAlloc(size);
+      { try again }
+      if poc=nil then
+        begin
+          poc := SysOSAlloc(size);
+          if (poc=nil) then
+            begin
+              if ReturnNilIfGrowHeapFails then
+                exit
+              else
+                HandleError(203);
+            end;
         end;
+      { set the total new heap size }
+      inc(internal_status.currheapsize,size);
+      if internal_status.currheapsize>internal_status.maxheapsize then
+        internal_status.maxheapsize:=internal_status.currheapsize;
     end;
-    { set the total new heap size }
-    inc(internal_status.currheapsize,size);
-    if internal_status.currheapsize>internal_status.maxheapsize then
-      internal_status.maxheapsize:=internal_status.currheapsize;
-  end;
   { initialize os-block }
-  poschunk(result)^.used := 0;
-  poschunk(result)^.size := size;
-  inc(result, sizeof(toschunk));
-  if blockindex<>0 then
+  poc^.used := 0;
+  poc^.size := size;
+  poc^.chunkindex := chunkindex;
+  { initialized oschunck for fixed chunks }
+  if chunkindex<>0 then
     begin
       { chop os chunk in fixedsize parts,
         maximum of $ffff elements are allowed, otherwise
         there will be an overflow }
-      chunksize := blockindex shl blockshr;
       count := (size-sizeof(toschunk)) div chunksize;
       if count>$ffff then
         HandleError(204);
-      pmc := pmemchunk_fixed(result);
-      pmc^.prev_fixed := nil;
-      i := 0;
-      repeat
-        pmc^.size := fixedsizeflag or chunksize or (i shl 16);
-        pmc^.next_fixed := pointer(pmc)+chunksize;
-        inc(i);
-        if i < count then
-          begin
-            pmc := pmemchunk_fixed(pointer(pmc)+chunksize);
-            pmc^.prev_fixed := pointer(pmc)-chunksize;
-          end
-        else
-          begin
-            break;
-          end;
-      until false;
-      append_to_list_fixed(blockindex, pmc);
-      pmc^.prev_fixed := pointer(pmc)-chunksize;
-      freelists_fixed[blockindex] := pmemchunk_fixed(result);
+      { Initialize linkedlist of chunks, the first chunk
+        is pmemchunk_fixed(poc) and the last chunk will be in pmc at
+        the end of the loop }
+      pmcfirst := pmemchunk_fixed(pointer(poc)+sizeof(toschunk));
+      pmc:=pmcfirst;
+      for i:=1 to count do
+        begin
+          pmc^.poc:=poc;
+          pmc^.size:=chunksize or fixedsizeflag;
+          pmc^.prev_fixed := pointer(pmc)-chunksize;
+          pmc^.next_fixed := pointer(pmc)+chunksize;
+          pmc := pmemchunk_fixed(pointer(pmc)+chunksize);
+        end;
+      { undo last increase to get last chunk }
+      pmclast := pmemchunk_fixed(pointer(pmc)-chunksize);
+      { Add to freelist and fixup first and last chunk }
+      pmclast^.next_fixed := freelists_fixed[chunkindex];
+      if freelists_fixed[chunkindex]<>nil then
+        freelists_fixed[chunkindex]^.prev_fixed := pmclast;
+      freelists_fixed[chunkindex] := pmcfirst;
+      pmemchunk_fixed(poc)^.prev_fixed:=nil;
+      result:=pmcfirst;
     end
   else
     begin
-      pmcv := pmemchunk_var(result);
+      pmcv := pmemchunk_var(pointer(poc)+sizeof(toschunk));
       append_to_list_var(pmcv);
       pmcv^.size := ((size-sizeof(toschunk)) and sizemask) or (firstblockflag or lastblockflag);
       pmcv^.prevsize := 0;
+      result:=pmcv;
     end;
-{$ifdef TestFreeLists}
-  TestFreeLists;
-{$endif TestFreeLists}
 end;
 
+
 {*****************************************************************************
                                  SysGetMem
 *****************************************************************************}
 
 function SysGetMem_Fixed(size: ptrint): pointer;
 var
-  pcurr: pmemchunk_fixed;
-  poc: poschunk;
-  s: ptrint;
+  pmc : pmemchunk_fixed;
+  poc : poschunk;
+  chunkindex : ptrint;
 begin
   result:=nil;
   { try to find a block in one of the freelists per size }
-  s := size shr blockshr;
-  pcurr := freelists_fixed[s];
+  chunkindex := size shr blockshift;
+  pmc := freelists_fixed[chunkindex];
   { no free blocks ? }
-  if not assigned(pcurr) then
+  if not assigned(pmc) then
     begin
-      pcurr := alloc_oschunk(s, size);
-      if not assigned(pcurr) then
+      pmc:=alloc_oschunk(chunkindex, size);
+      if not assigned(pmc) then
         exit;
     end;
   { get a pointer to the block we should return }
-  result := pointer(pcurr)+sizeof(tmemchunk_fixed_hdr);
-  { flag as in-use }
-  pcurr^.size := pcurr^.size or usedflag;
+  result := pointer(pmc)+sizeof(tmemchunk_fixed_hdr);
   { update freelist }
-  freelists_fixed[s] := pcurr^.next_fixed;
-  if assigned(freelists_fixed[s]) then
-    freelists_fixed[s]^.prev_fixed := nil;
-  poc := poschunk(pointer(pcurr)-((pcurr^.size shr 16)*(pcurr^.size and fixedsizemask)+sizeof(toschunk)));
+  freelists_fixed[chunkindex] := pmc^.next_fixed;
+  if assigned(freelists_fixed[chunkindex]) then
+    freelists_fixed[chunkindex]^.prev_fixed := nil;
+  poc := pmc^.poc;
   if (poc^.used = 0) then
-    freelists_free_chunk[s] := false;
+    freelists_free_chunk[chunkindex] := false;
   inc(poc^.used);
   { statistics }
   inc(internal_status.currheapused,size);
   if internal_status.currheapused>internal_status.maxheapused then
     internal_status.maxheapused:=internal_status.currheapused;
-{$ifdef TestFreeLists}
-  if test_each then
-    TestFreeLists;
-{$endif TestFreeLists}
 end;
 
+
 function SysGetMem_Var(size: ptrint): pointer;
 var
   pcurr : pmemchunk_var;
@@ -975,10 +936,6 @@ begin
   inc(internal_status.currheapused,size);
   if internal_status.currheapused>internal_status.maxheapused then
     internal_status.maxheapused:=internal_status.currheapused;
-{$ifdef TestFreeLists}
-  if test_each then
-    TestFreeLists;
-{$endif TestFreeLists}
 end;
 
 function SysGetMem(size : ptrint):pointer;
@@ -997,12 +954,12 @@ begin
   if size <= (maxblocksize - sizeof(tmemchunk_fixed_hdr)) then
     begin
       size := (size+sizeof(tmemchunk_fixed_hdr)+(blocksize-1)) and fixedsizemask;
-      sysgetmem := sysgetmem_fixed(size);
+      result := sysgetmem_fixed(size);
     end
   else
     begin
       size := (size+sizeof(tmemchunk_var_hdr)+(blocksize-1)) and sizemask;
-      sysgetmem := sysgetmem_var(size);
+      result := sysgetmem_var(size);
     end;
 end;
 
@@ -1011,83 +968,70 @@ end;
                                SysFreeMem
 *****************************************************************************}
 
-function SysFreeMem_Fixed(pcurr: pmemchunk_fixed; size: ptrint): ptrint;
+function SysFreeMem_Fixed(pmc: pmemchunk_fixed): ptrint;
 var
-  pcurrsize: ptrint;
-  blockindex: ptrint;
-  poc: poschunk;
+  chunksize,
+  chunkindex : ptrint;
+  poc : poschunk;
 begin
-  pcurrsize := pcurr^.size and fixedsizemask;
-  if size<>pcurrsize then
-   HandleError(204);
-  dec(internal_status.currheapused,pcurrsize);
+  poc := pmc^.poc;
+  chunkindex:=poc^.chunkindex;
+  chunksize:=chunkindex shl blockshift;
+  { statistics }
+  dec(internal_status.currheapused,chunksize);
   { insert the block in it's freelist }
-  pcurr^.size := pcurr^.size and (not usedflag);
-  blockindex := pcurrsize shr blockshr;
-  append_to_list_fixed(blockindex, pcurr);
+  pmc^.prev_fixed := nil;
+  pmc^.next_fixed := freelists_fixed[chunkindex];
+  if freelists_fixed[chunkindex]<>nil then
+    freelists_fixed[chunkindex]^.prev_fixed := pmc;
+  freelists_fixed[chunkindex] := pmc;
   { decrease used blocks count }
-  poc := poschunk(pointer(pcurr)-(pcurr^.size shr 16)*pcurrsize-sizeof(toschunk));
   if poc^.used = 0 then
     HandleError(204);
   dec(poc^.used);
   if poc^.used = 0 then
-  begin
-    if (freelists_free_chunk[blockindex]) then
-      // block eligable for freeing
-      append_to_oslist_fixed(blockindex, pcurrsize, poc)
-    else
-      freelists_free_chunk[blockindex] := true;
-  end;
-  SysFreeMem_Fixed := pcurrsize;
-{$ifdef TestFreeLists}
-  if test_each then
-    TestFreeLists;
-{$endif TestFreeLists}
+    begin
+      { osblock can be freed? }
+      if freelists_free_chunk[chunkindex] then
+        append_to_oslist_fixed(poc)
+      else
+        freelists_free_chunk[chunkindex] := true;
+    end;
+  result := chunksize;
 end;
 
-function SysFreeMem_Var(pcurr: pmemchunk_var; size: ptrint): ptrint;
+
+function SysFreeMem_Var(pcurr: pmemchunk_var): ptrint;
 var
-  pcurrsize: ptrint;
+  chunksize: ptrint;
 begin
-  pcurrsize := pcurr^.size and sizemask;
-  if size<>pcurrsize then
-    HandleError(204);
-  dec(internal_status.currheapused,pcurrsize);
+  chunksize := pcurr^.size and sizemask;
+  dec(internal_status.currheapused,chunksize);
   { insert the block in it's freelist }
   pcurr^.size := pcurr^.size and (not usedflag);
   append_to_list_var(pcurr);
-  SysFreeMem_Var := pcurrsize;
+  result := chunksize;
   pcurr := try_concat_free_chunk(pcurr);
   if (pcurr^.size and (firstblockflag or lastblockflag)) = (firstblockflag or lastblockflag) then
-  begin
     append_to_oslist_var(pcurr);
-  end;
-{$ifdef TestFreeLists}
-  if test_each then
-    TestFreeLists;
-{$endif TestFreeLists}
 end;
 
 
 function SysFreeMem(p: pointer): ptrint;
 var
-  pcurrsize: ptrint;
+  size : ptrint;
 begin
   if p=nil then
     begin
       result:=0;
       exit;
     end;
-  pcurrsize := pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr))^.size;
+  size := pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr))^.size;
   { check if this is a fixed- or var-sized chunk }
-  if (pcurrsize and fixedsizeflag) = 0 then
-    begin
-      result := sysfreemem_var(pmemchunk_var(p-sizeof(tmemchunk_var_hdr)), pcurrsize and sizemask);
-    end
+  if (size and fixedsizeflag) = 0 then
+    result := sysfreemem_var(pmemchunk_var(p-sizeof(tmemchunk_var_hdr)))
   else
-    begin
-      result := sysfreemem_fixed(pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr)), pcurrsize and fixedsizemask);
-    end;
+    result := sysfreemem_fixed(pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr)));
 end;
 
 {*****************************************************************************
@@ -1096,7 +1040,7 @@ end;
 
 Function SysFreeMemSize(p: pointer; size: ptrint):ptrint;
 var
-  pcurrsize: ptrint;
+  chunksize: ptrint;
 begin
   SysFreeMemSize := 0;
   if p=nil then
@@ -1108,18 +1052,14 @@ begin
       exit;
     end;
 
-  pcurrsize := pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr))^.size;
-  { check if this is a fixed- or var-sized chunk }
-  if (pcurrsize and fixedsizeflag) = 0 then
-    begin
-      size := (size+sizeof(tmemchunk_var_hdr)+(blocksize-1)) and sizemask;
-      result := sysfreemem_var(pmemchunk_var(p-sizeof(tmemchunk_var_hdr)), size);
-    end
+  chunksize := pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr))^.size;
+  { check if this is a fixed- or var-sized chunk. We can't check the passed
+    size parameter since the block can be resized (by reallocmem) to an
+    optimized value that the user doesn't know }
+  if (chunksize and fixedsizeflag) = 0 then
+    result := sysfreemem_var(pmemchunk_var(p-sizeof(tmemchunk_var_hdr)))
   else
-    begin
-      size := (size+sizeof(tmemchunk_fixed_hdr)+(blocksize-1)) and fixedsizemask;
-      result := sysfreemem_fixed(pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr)), size);
-    end;
+    result := sysfreemem_fixed(pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr)));
 end;
 
 
@@ -1129,16 +1069,16 @@ end;
 
 function SysMemSize(p: pointer): ptrint;
 begin
-  SysMemSize := pmemchunk_fixed(pointer(p)-sizeof(tmemchunk_fixed_hdr))^.size;
-  if (SysMemSize and fixedsizeflag) = 0 then
+  result := pmemchunk_fixed(pointer(p)-sizeof(tmemchunk_fixed_hdr))^.size;
+  if (result and fixedsizeflag) = 0 then
     begin
-      SysMemSize := SysMemSize and sizemask;
-      dec(SysMemSize, sizeof(tmemchunk_var_hdr));
+      result := SysMemSize and sizemask;
+      dec(result, sizeof(tmemchunk_var_hdr));
     end
   else
     begin
-      SysMemSize := SysMemSize and fixedsizemask;
-      dec(SysMemSize, sizeof(tmemchunk_fixed_hdr));
+      result := SysMemSize and fixedsizemask;
+      dec(result, sizeof(tmemchunk_fixed_hdr));
     end;
 end;
 
@@ -1149,9 +1089,9 @@ end;
 
 function SysAllocMem(size: ptrint): pointer;
 begin
-  sysallocmem := MemoryManager.GetMem(size);
-  if sysallocmem<>nil then
-    FillChar(sysallocmem^,MemoryManager.MemSize(sysallocmem),0);
+  result := MemoryManager.GetMem(size);
+  if result<>nil then
+    FillChar(result^,MemoryManager.MemSize(result),0);
 end;
 
 
@@ -1161,7 +1101,7 @@ end;
 
 function SysTryResizeMem(var p: pointer; size: ptrint): boolean;
 var
-  pcurrsize,
+  chunksize,
   oldsize,
   currsize : ptrint;
   pcurr : pmemchunk_var;
@@ -1169,13 +1109,13 @@ begin
   SysTryResizeMem := false;
 
   { fix p to point to the heaprecord }
-  pcurrsize := pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr))^.size;
+  chunksize := pmemchunk_fixed(p-sizeof(tmemchunk_fixed_hdr))^.size;
 
   { handle fixed memchuncks separate. Only allow resizes when the
     new size fits in the same block }
-  if (pcurrsize and fixedsizeflag) <> 0 then
+  if (chunksize and fixedsizeflag) <> 0 then
     begin
-      currsize := pcurrsize and fixedsizemask;
+      currsize := chunksize and fixedsizemask;
 
       { first check if the size fits in the fixed block range to prevent
         "truncating" the size by the fixedsizemask }
@@ -1185,24 +1125,19 @@ begin
           systryresizemem:=true;
           exit;
         end;
-
       { we need to allocate a new fixed or var memchunck }
       exit;
     end;
 
   { var memchunck }
-  currsize := pcurrsize and sizemask;
+  currsize := chunksize and sizemask;
   size := (size+sizeof(tmemchunk_var_hdr)+(blocksize-1)) and sizemask;
 
   { is the allocated block still correct? }
   if (currsize>=size) and (size>(currsize-blocksize)) then
     begin
       SysTryResizeMem := true;
-{$ifdef TestFreeLists}
-       if test_each then
-         TestFreeLists;
-{$endif TestFreeLists}
-       exit;
+      exit;
    end;
 
   { get pointer to block }
@@ -1230,11 +1165,6 @@ begin
 
   inc(internal_status.currheapused,size-oldsize);
   SysTryResizeMem := true;
-
-{$ifdef TestFreeLists}
-  if test_each then
-    TestFreeLists;
-{$endif TestFreeLists}
 end;
 
 
@@ -1244,6 +1174,8 @@ end;
 
 function SysReAllocMem(var p: pointer; size: ptrint):pointer;
 var
+  newsize,
+  oldsize,
   minsize : ptrint;
   p2 : pointer;
 begin
@@ -1266,10 +1198,23 @@ begin
    { Resize block }
    if not SysTryResizeMem(p,size) then
     begin
-      minsize := MemoryManager.MemSize(p);
-      if size < minsize then
-        minsize := size;
-      p2 := MemoryManager.GetMem(size);
+      oldsize:=MemoryManager.MemSize(p);
+      { Grow with bigger steps to prevent the need for
+        multiple getmem/freemem calls for fixed blocks. It might cost a bit
+        of extra memory, but in most cases a reallocmem is done multiple times. }
+      if oldsize<maxblocksize then
+        begin
+          newsize:=oldsize*2+blocksize;
+          if size>newsize then
+            newsize:=size;
+        end
+      else
+        newsize:=size;
+      { calc size of data to move }
+      minsize:=oldsize;
+      if newsize < minsize then
+        minsize := newsize;
+      p2 := MemoryManager.GetMem(newsize);
       if p2<>nil then
         Move(p^,p2^,minsize);
       MemoryManager.FreeMem(p);
@@ -1323,5 +1268,3 @@ begin
   freeoslistcount := 0;
   fillchar(internal_status,sizeof(internal_status),0);
 end;
-
-

+ 0 - 3
rtl/inc/objpas.inc

@@ -373,9 +373,6 @@
 
       class function TObject.stringmessagetable : pstringmessagetable;
 
-        type
-           pdword = ^dword;
-
         begin
            stringmessagetable:=pstringmessagetable((pointer(Self)+vmtMsgStrPtr)^);
         end;

+ 5 - 2
rtl/inc/objpash.inc

@@ -53,9 +53,12 @@
      type
        TextFile = Text;
 
-       { now the let's declare the base classes for the class object }
-       { model                                                       }
+       { now the let's declare the base classes for the class object
+         model. The compiler expects TObject and IUnknown to be defined
+         first as forward classes }
        TObject = class;
+       IUnknown = interface;
+
        TClass  = class of tobject;
        PClass  = ^tclass;
 

+ 1 - 1
rtl/inc/real2str.inc

@@ -20,7 +20,7 @@ type
   );
   { corresponding to single   double   extended   fixed      comp for i386 }
 
-Procedure str_real (len,f : longint; d : ValReal; real_type :treal_type; var s : string);
+Procedure str_real (len,f : longint; d : ValReal; real_type :treal_type; out s : string);
 {$ifdef SUPPORT_EXTENDED}
 type
   TSplitExtended = packed record

+ 17 - 17
rtl/inc/sstrings.inc

@@ -340,14 +340,14 @@ end;
                               Str() Helpers
 *****************************************************************************}
 
-procedure fpc_shortstr_SInt(v : valSInt;len : SizeInt;var s : shortstring);[public,alias:'FPC_SHORTSTR_SINT']; compilerproc;
+procedure fpc_shortstr_SInt(v : valSInt;len : SizeInt;out s : shortstring);[public,alias:'FPC_SHORTSTR_SINT']; compilerproc;
 begin
   int_str(v,s);
   if length(s)<len then
     s:=space(len-length(s))+s;
 end;
 
-procedure fpc_shortstr_UInt(v : valUInt;len : SizeInt;var s : shortstring);[public,alias:'FPC_SHORTSTR_UINT']; compilerproc;
+procedure fpc_shortstr_UInt(v : valUInt;len : SizeInt;out s : shortstring);[public,alias:'FPC_SHORTSTR_UINT']; compilerproc;
 begin
   int_str(v,s);
   if length(s)<len then
@@ -356,7 +356,7 @@ end;
 
 {$ifndef CPU64}
 
-  procedure fpc_shortstr_qword(v : qword;len : longint;var s : shortstring);[public,alias:'FPC_SHORTSTR_QWORD']; compilerproc;
+  procedure fpc_shortstr_qword(v : qword;len : longint;out s : shortstring);[public,alias:'FPC_SHORTSTR_QWORD']; compilerproc;
     begin
        int_str(v,s);
        if length(s)<len then
@@ -364,7 +364,7 @@ end;
     end;
 
 
-  procedure fpc_shortstr_int64(v : int64;len : longint;var s : shortstring);[public,alias:'FPC_SHORTSTR_INT64'];  compilerproc;
+  procedure fpc_shortstr_int64(v : int64;len : longint;out s : shortstring);[public,alias:'FPC_SHORTSTR_INT64'];  compilerproc;
     begin
        int_str(v,s);
        if length(s)<len then
@@ -380,7 +380,7 @@ end;
 
 {$I real2str.inc}
 
-procedure fpc_ShortStr_Float(d : ValReal;len,fr,rt : SizeInt;var s : shortstring);[public,alias:'FPC_SHORTSTR_FLOAT']; compilerproc;
+procedure fpc_ShortStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : shortstring);[public,alias:'FPC_SHORTSTR_FLOAT']; compilerproc;
 begin
   str_real(len,fr,d,treal_type(rt),s);
 end;
@@ -390,7 +390,7 @@ end;
    Array Of Char Str() helpers
 }
 
-procedure fpc_chararray_sint(v : valsint;len : SizeInt;var a:array of char);compilerproc;
+procedure fpc_chararray_sint(v : valsint;len : SizeInt;out a:array of char);compilerproc;
 var
   ss : shortstring;
   maxlen : SizeInt;
@@ -406,7 +406,7 @@ begin
 end;
 
 
-procedure fpc_chararray_uint(v : valuint;len : SizeInt;var a : array of char);compilerproc;
+procedure fpc_chararray_uint(v : valuint;len : SizeInt;out a : array of char);compilerproc;
 var
   ss : shortstring;
   maxlen : SizeInt;
@@ -424,7 +424,7 @@ end;
 
 {$ifndef CPU64}
 
-procedure fpc_chararray_qword(v : qword;len : SizeInt;var a : array of char);compilerproc;
+procedure fpc_chararray_qword(v : qword;len : SizeInt;out a : array of char);compilerproc;
 var
   ss : shortstring;
   maxlen : SizeInt;
@@ -440,7 +440,7 @@ begin
 end;
 
 
-procedure fpc_chararray_int64(v : int64;len : SizeInt;var a : array of char);compilerproc;
+procedure fpc_chararray_int64(v : int64;len : SizeInt;out a : array of char);compilerproc;
 var
   ss : shortstring;
   maxlen : SizeInt;
@@ -458,7 +458,7 @@ end;
 {$endif CPU64}
 
 
-procedure fpc_chararray_Float(d : ValReal;len,fr,rt : SizeInt;var a : array of char);compilerproc;
+procedure fpc_chararray_Float(d : ValReal;len,fr,rt : SizeInt;out a : array of char);compilerproc;
 var
   ss : shortstring;
   maxlen : SizeInt;
@@ -476,7 +476,7 @@ end;
                            Val() Functions
 *****************************************************************************}
 
-Function InitVal(const s:shortstring;var negativ:boolean;var base:byte):ValSInt;
+Function InitVal(const s:shortstring;out negativ:boolean;out base:byte):ValSInt;
 var
   Code : SizeInt;
 begin
@@ -527,7 +527,7 @@ begin
 end;
 
 
-Function fpc_Val_SInt_ShortStr(DestSize: SizeInt; Const S: ShortString; var Code: ValSInt): ValSInt; [public, alias:'FPC_VAL_SINT_SHORTSTR']; compilerproc;
+Function fpc_Val_SInt_ShortStr(DestSize: SizeInt; Const S: ShortString; out Code: ValSInt): ValSInt; [public, alias:'FPC_VAL_SINT_SHORTSTR']; compilerproc;
 var
   u, temp, prev, maxPrevValue, maxNewValue: ValUInt;
   base : byte;
@@ -580,10 +580,10 @@ end;
 
 { we need this for fpc_Val_SInt_Ansistr and fpc_Val_SInt_WideStr because }
 { we have to pass the DestSize parameter on (JM)                         }
-Function int_Val_SInt_ShortStr(DestSize: SizeInt; Const S: ShortString; var Code: ValSInt): ValSInt; [external name 'FPC_VAL_SINT_SHORTSTR'];
+Function int_Val_SInt_ShortStr(DestSize: SizeInt; Const S: ShortString; out Code: ValSInt): ValSInt; [external name 'FPC_VAL_SINT_SHORTSTR'];
 
 
-Function fpc_Val_UInt_Shortstr(Const S: ShortString; var Code: ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_SHORTSTR']; compilerproc;
+Function fpc_Val_UInt_Shortstr(Const S: ShortString; out Code: ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_SHORTSTR']; compilerproc;
 var
   u, prev : ValUInt;
   base : byte;
@@ -618,7 +618,7 @@ end;
 
 {$ifndef CPU64}
 
-  Function fpc_val_int64_shortstr(Const S: ShortString; var Code: ValSInt): Int64; [public, alias:'FPC_VAL_INT64_SHORTSTR']; compilerproc;
+  Function fpc_val_int64_shortstr(Const S: ShortString; out Code: ValSInt): Int64; [public, alias:'FPC_VAL_INT64_SHORTSTR']; compilerproc;
    type
      QWordRec = packed record
        l1,l2: longint;
@@ -683,7 +683,7 @@ end;
   end;
 
 
-  Function fpc_val_qword_shortstr(Const S: ShortString; var Code: ValSInt): QWord; [public, alias:'FPC_VAL_QWORD_SHORTSTR']; compilerproc;
+  Function fpc_val_qword_shortstr(Const S: ShortString; out Code: ValSInt): QWord; [public, alias:'FPC_VAL_QWORD_SHORTSTR']; compilerproc;
     type qwordrec = packed record
       l1,l2: longint;
     end;
@@ -726,7 +726,7 @@ end;
 {$endif CPU64}
 
 
-Function fpc_Val_Real_ShortStr(const s : shortstring; var code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_SHORTSTR']; compilerproc;
+Function fpc_Val_Real_ShortStr(const s : shortstring; out Code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_SHORTSTR']; compilerproc;
 var
   hd,
   esign,sign : valreal;

+ 8 - 3
rtl/inc/text.inc

@@ -1082,9 +1082,14 @@ Begin
       exit;
      ReadNumeric(f,hs);
    end;
-  val(hs,u,code);
-  If code<>0 Then
-   InOutRes:=106;
+   if (hs = '') then
+    u := 0
+   else
+    begin
+      val(hs,u,code);
+      If code<>0 Then
+        InOutRes:=106;
+    end;
 End;
 
 

+ 2 - 2
rtl/inc/wstringh.inc

@@ -34,8 +34,8 @@ Procedure SetString (Out S : WideString; Buf : PChar; Len : SizeInt);
 function WideCharToString(S : PWideChar) : AnsiString;
 function StringToWideChar(const Src : AnsiString;Dest : PWideChar;DestSize : SizeInt) : PWideChar;
 function WideCharLenToString(S : PWideChar;Len : SizeInt) : AnsiString;
-procedure WideCharLenToStrVar(Src : PWideChar;Len : SizeInt;var Dest : AnsiString);
-procedure WideCharToStrVar(S : PWideChar;var Dest : AnsiString);
+procedure WideCharLenToStrVar(Src : PWideChar;Len : SizeInt;out Dest : AnsiString);
+procedure WideCharToStrVar(S : PWideChar;out Dest : AnsiString);
 
 procedure DefaultWide2AnsiMove(source:pwidechar;var dest:ansistring;len:SizeInt);
 procedure DefaultAnsi2WideMove(source:pchar;var dest:widestring;len:SizeInt);

+ 12 - 12
rtl/inc/wstrings.inc

@@ -718,12 +718,12 @@ function WideCharLenToString(S : PWideChar;Len : SizeInt) : AnsiString;
      widestringmanager.Wide2AnsiMoveproc(S,result,Len);
   end;
 
-procedure WideCharLenToStrVar(Src : PWideChar;Len : SizeInt;var Dest : AnsiString);
+procedure WideCharLenToStrVar(Src : PWideChar;Len : SizeInt;out Dest : AnsiString);
   begin
      Dest:=WideCharLenToString(Src,Len);
   end;
 
-procedure WideCharToStrVar(S : PWideChar;var Dest : AnsiString);
+procedure WideCharToStrVar(S : PWideChar;out Dest : AnsiString);
   begin
      Dest:=WideCharToString(S);
   end;
@@ -979,7 +979,7 @@ begin
 end;
 
 
-Function fpc_Val_Real_WideStr(Const S : WideString; Var Code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_WIDESTR']; compilerproc;
+Function fpc_Val_Real_WideStr(Const S : WideString; out Code : ValSInt): ValReal; [public, alias:'FPC_VAL_REAL_WIDESTR']; compilerproc;
 Var
   SS : String;
 begin
@@ -994,7 +994,7 @@ begin
 end;
 
 
-Function fpc_Val_UInt_WideStr (Const S : WideString; Var Code : ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_WIDESTR']; compilerproc;
+Function fpc_Val_UInt_WideStr (Const S : WideString; out Code : ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_WIDESTR']; compilerproc;
 Var
   SS : ShortString;
 begin
@@ -1009,7 +1009,7 @@ begin
 end;
 
 
-Function fpc_Val_SInt_WideStr (DestSize: SizeInt; Const S : WideString; Var Code : ValSInt): ValSInt; [public, alias:'FPC_VAL_SINT_WIDESTR']; compilerproc;
+Function fpc_Val_SInt_WideStr (DestSize: SizeInt; Const S : WideString; out Code : ValSInt): ValSInt; [public, alias:'FPC_VAL_SINT_WIDESTR']; compilerproc;
 Var
   SS : ShortString;
 begin
@@ -1026,7 +1026,7 @@ end;
 
 {$ifndef CPU64}
 
-Function fpc_Val_qword_WideStr (Const S : WideString; Var Code : ValSInt): qword; [public, alias:'FPC_VAL_QWORD_WIDESTR']; compilerproc;
+Function fpc_Val_qword_WideStr (Const S : WideString; out Code : ValSInt): qword; [public, alias:'FPC_VAL_QWORD_WIDESTR']; compilerproc;
 Var
   SS : ShortString;
 begin
@@ -1041,7 +1041,7 @@ begin
 end;
 
 
-Function fpc_Val_int64_WideStr (Const S : WideString; Var Code : ValSInt): Int64; [public, alias:'FPC_VAL_INT64_WIDESTR']; compilerproc;
+Function fpc_Val_int64_WideStr (Const S : WideString; out Code : ValSInt): Int64; [public, alias:'FPC_VAL_INT64_WIDESTR']; compilerproc;
 Var
   SS : ShortString;
 begin
@@ -1058,7 +1058,7 @@ end;
 {$endif CPU64}
 
 
-procedure fpc_WideStr_Float(d : ValReal;len,fr,rt : SizeInt;var s : WideString);compilerproc;
+procedure fpc_WideStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : WideString);compilerproc;
 var
   ss : shortstring;
 begin
@@ -1067,7 +1067,7 @@ begin
 end;
 
 
-Procedure fpc_WideStr_SInt(v : ValSint; Len : SizeInt; Var S : WideString);compilerproc;
+Procedure fpc_WideStr_SInt(v : ValSint; Len : SizeInt; out S : WideString);compilerproc;
 Var
   SS : ShortString;
 begin
@@ -1076,7 +1076,7 @@ begin
 end;
 
 
-Procedure fpc_WideStr_UInt(v : ValUInt;Len : SizeInt; Var S : WideString);compilerproc;
+Procedure fpc_WideStr_UInt(v : ValUInt;Len : SizeInt; out S : WideString);compilerproc;
 Var
   SS : ShortString;
 begin
@@ -1087,7 +1087,7 @@ end;
 
 {$ifndef CPU64}
 
-Procedure fpc_WideStr_Int64(v : Int64; Len : SizeInt; Var S : WideString);compilerproc;
+Procedure fpc_WideStr_Int64(v : Int64; Len : SizeInt; out S : WideString);compilerproc;
 Var
   SS : ShortString;
 begin
@@ -1096,7 +1096,7 @@ begin
 end;
 
 
-Procedure fpc_WideStr_Qword(v : Qword;Len : SizeInt; Var S : WideString);compilerproc;
+Procedure fpc_WideStr_Qword(v : Qword;Len : SizeInt; out S : WideString);compilerproc;
 Var
   SS : ShortString;
 begin

+ 187 - 58
rtl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2005/11/26]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/01/10]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-wince powerpc64-linux
@@ -238,18 +238,13 @@ INC=$(RTL)/inc
 COMMON=$(RTL)/common
 PROCINC=$(RTL)/$(CPU_TARGET)
 UNIXINC=$(RTL)/unix
-ifneq ($(CPU_TARGET),powerpc64)
-GGIGRAPH_UNIT=ggigraph
-else
-GGIGRAPH_UNIT=
-endif
+UNITPREFIX=rtl
 ifeq ($(CPU_TARGET),i386)
 CRT21=cprt21 gprt21
-CPU_UNITS=x86 ports cpu mmx graph
+CPU_UNITS=x86 ports cpu mmx
 else
 CPU_UNITS=
 endif
-UNITPREFIX=rtl
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 SYSTEMUNIT=system
 LINUXUNIT1=
@@ -267,120 +262,116 @@ ifdef RELEASE
 override FPCOPT+=-Ur
 endif
 OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-ifndef USELIBGGI
-USELIBGGI=NO
-endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer $(GGIGRAPH_UNIT) sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) crt  printer sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconsts dos objects cwstring fpcylix fpmkunit
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt0 dllprt0 cprt0 gprt0 $(CRT21)
@@ -1049,6 +1040,117 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_TARGETDIR+=.
 endif
+ifeq ($(FULL_TARGET),i386-linux)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override SHARED_LIBUNITS+=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes variants sysconst rtlconsts
+endif
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 endif
@@ -1252,6 +1354,7 @@ ASMEXT=.s
 SMARTEXT=.sl
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1884,6 +1987,12 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 endif
 endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
 ifdef OPT
 override FPCOPT+=$(OPT)
 endif
@@ -1898,6 +2007,14 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
@@ -1987,6 +2104,26 @@ vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef $(SHARED_LIBNAME)
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef LIB_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS)
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSMART=1 CREATESMART=1
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME)
+else
+	@$(ECHO) Shared Libraries not supported
+endif
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 ifdef INSTALL_UNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
@@ -2236,7 +2373,7 @@ smart: fpc_smart
 release: fpc_release
 units: fpc_units
 examples:
-shared:
+shared: fpc_shared
 install: fpc_install
 sourceinstall: fpc_sourceinstall
 exampleinstall: fpc_exampleinstall
@@ -2306,14 +2443,6 @@ dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
 crt$(PPUEXT) : crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
 printer$(PPUEXT) : printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
-include $(GRAPHDIR)/makefile.inc
-GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
-graph$(PPUEXT) : graph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
-		 $(GRAPHINCDEPS) $(UNIXINC)/graph16.inc
-	$(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/graph.pp
-ggigraph$(PPUEXT) : $(UNIXINC)/ggigraph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
-		 $(GRAPHINCDEPS)
-	$(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/ggigraph.pp
 sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
 		    objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
 	$(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp

+ 9 - 42
rtl/linux/Makefile.fpc

@@ -10,7 +10,7 @@ loaders=prt0 dllprt0 cprt0 gprt0 $(CRT21)
 units=$(SYSTEMUNIT) unixtype ctypes baseunix strings objpas macpas syscall unixutil \
       heaptrc lineinfo \
       $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc cmem $(CPU_UNITS) \
-       crt  printer $(GGIGRAPH_UNIT) \
+      crt  printer \
       sysutils typinfo math matrix varutils \
       charset ucomplex getopts \
       errors sockets gpm ipc serial terminfo dl dynlibs \
@@ -37,15 +37,13 @@ includedir=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
 sourcedir=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(COMMON)
 targetdir=.
 
-[lib]
-libname=libfprtl.so
-libversion=2.0.3
-libunits=$(SYSTEMUNIT) objpas strings \
-      unix  ports \
-      dos crt objects printer \
+[shared]
+libunits=$(SYSTEMUNIT) objpas strings dos \
+      unix baseunix unixtype unixutil \
       sysutils typinfo math \
-      cpu mmx getopts heaptrc \
-      errors sockets ipc dl dynlibs varutils
+      $(CPU_UNITS) getopts \
+      errors sockets varutils \
+      classes variants sysconst rtlconsts \
 
 [prerules]
 RTL=..
@@ -54,21 +52,15 @@ COMMON=$(RTL)/common
 PROCINC=$(RTL)/$(CPU_TARGET)
 UNIXINC=$(RTL)/unix
 
-ifneq ($(CPU_TARGET),powerpc64)
-GGIGRAPH_UNIT=ggigraph
-else
-GGIGRAPH_UNIT=
-endif
+UNITPREFIX=rtl
 
 ifeq ($(CPU_TARGET),i386)
 CRT21=cprt21 gprt21
-CPU_UNITS=x86 ports cpu mmx graph
+CPU_UNITS=x86 ports cpu mmx
 else
 CPU_UNITS=
 endif
 
-UNITPREFIX=rtl
-
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 SYSTEMUNIT=system
 LINUXUNIT1=
@@ -92,16 +84,6 @@ endif
 
 # Paths
 OBJPASDIR=$(RTL)/objpas
-GRAPHDIR=$(INC)/graph
-
-# Use new graph unit ?
-# NEWGRAPH=YES
-# Use LibGGI ?
-# Use
-#
-ifndef USELIBGGI
-USELIBGGI=NO
-endif
 
 [rules]
 # Get the $(SYSTEMUNIT) independent include file names.
@@ -205,21 +187,6 @@ objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
 
 printer$(PPUEXT) : printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 
-#
-# Graph
-#
-include $(GRAPHDIR)/makefile.inc
-GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES))
-
-graph$(PPUEXT) : graph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
-                 $(GRAPHINCDEPS) $(UNIXINC)/graph16.inc
-        $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/graph.pp
-
-
-ggigraph$(PPUEXT) : $(UNIXINC)/ggigraph.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
-                 $(GRAPHINCDEPS)
-        $(COMPILER) -I$(GRAPHDIR) $(UNIXINC)/ggigraph.pp
-
 #
 # Delphi Compatible Units
 #

+ 149 - 0
rtl/linux/errnostr.inc

@@ -0,0 +1,149 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2005 by Ales Katona
+
+    Contains Linux specific errors for error.pp in rtl/unix
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+const
+  sys_errn=125;
+  sys_errlist:array[0..sys_errn-1] of pchar = (
+        'Success',                              { 0 }
+        'Operation not permitted',              { EPERM }
+        'No such file or directory',            { ENOENT }
+        'No such process',                      { ESRCH }
+        'Interrupted system call',              { EINTR }
+        'I/O error',                            { EIO }
+        'No such device or address',            { ENXIO }
+        'Arg list too long',                    { E2BIG }
+        'Exec format error',                    { ENOEXEC }
+        'Bad file number',                      { EBADF }
+        'No child processes',                   { ECHILD }
+        'Try again',                            { EAGAIN }
+        'Out of memory',                        { ENOMEM }
+        'Permission denied',                    { EACCES }
+        'Bad address',                          { EFAULT }
+        'Block device required',                { ENOTBLK }
+        'Device or resource busy',              { EBUSY }
+        'File exists',                          { EEXIST }
+        'Cross-device link',                    { EXDEV }
+        'No such device',                       { ENODEV }
+        'Not a directory',                      { ENOTDIR }
+        'Is a directory',                       { EISDIR }
+        'Invalid argument',                     { EINVAL }
+        'File table overflow',                  { ENFILE }
+        'Too many open files',                  { EMFILE }
+        'Not a typewriter',                     { ENOTTY }
+        'Text (code segment) file busy',        { ETXTBSY  Text file busy.  The new process was
+                                                    a pure procedure (shared text) file which was
+                                                    open for writing by another process, or file
+                                                    which was open for writing by another process,
+                                                    or while the pure procedure file was being
+                                                    executed an open(2) call requested write access
+                                                    requested write access.}
+        'File too large',                       { EFBIG }
+        'No space left on device',              { ENOSPC }
+        'Illegal seek',                         { ESPIPE }
+        'Read-only file system',                { EROFS }
+        'Too many links',                       { EMLINK }
+        'Broken pipe',                          { EPIPE }
+        'Math argument out of domain of func',  { EDOM }
+        'Math result not representable',        { ERANGE }
+        'Resource deadlock would occur',        { EDEADLK }
+        'File name too long',                   { ENAMETOOLONG }
+        'No record locks available',            { ENOLCK }
+        'Function not implemented',             { ENOSYS }
+        'Directory not empty',                  { ENOTEMPTY }
+        'Too many symbolic links encountered',  { ELOOP }
+        'Operation would block',                { EWOULDBLOCK }
+        'No message of desired type',           { ENOMSG }
+        'Identifier removed',                   { EIDRM }
+        'Channel number out of range',          { ECHRNG }
+        'Level 2 not synchronized',             { EL2NSYNC }
+        'Level 3 halted',                       { EL3HLT }
+        'Level 3 reset',                        { EL3RST }
+        'Link number out of range',             { ELNRNG }
+        'Protocol driver not attached',         { EUNATCH }
+        'No CSI structure available',           { ENOCSI }
+        'Level 2 halted',                       { EL2HLT }
+        'Invalid exchange',                     { EBADE }
+        'Invalid request descriptor',           { EBADR }
+        'Exchange full',                        { EXFULL }
+        'No anode',                             { ENOANO }
+        'Invalid request code',                 { EBADRQC }
+        'Invalid slot',                         { EBADSLT }
+        'File locking deadlock error',          { EDEADLOCK }
+        'Bad font file format',                 { EBFONT }
+        'Device not a stream',                  { ENOSTR }
+        'No data available',                    { ENODATA }
+        'Timer expired',                        { ETIME }
+        'Out of streams resources',             { ENOSR }
+        'Machine is not on the network',        { ENONET }
+        'Package not installed',                { ENOPKG }
+        'Object is remote',                     { EREMOTE }
+        'Link has been severed',                { ENOLINK }
+        'Advertise error',                      { EADV }
+        'Srmount error',                        { ESRMNT }
+        'Communication error on send',          { ECOMM }
+        'Protocol error',                       { EPROTO }
+        'Multihop attempted',                   { EMULTIHOP }
+        'RFS specific error',                   { EDOTDOT }
+        'Not a data message',                   { EBADMSG }
+        'Value too large for defined data type',        { EOVERFLOW }
+        'Name not unique on network',           { ENOTUNIQ }
+        'File descriptor in bad state',         { EBADFD }
+        'Remote address changed',               { EREMCHG }
+        'Can not access a needed shared library',       { ELIBACC }
+        'Accessing a corrupted shared library',         { ELIBBAD }
+        '.lib section in a.out corrupted',      { ELIBSCN }
+        'Attempting to link in too many shared libraries',      { ELIBMAX }
+        'Cannot exec a shared library directly',        { ELIBEXEC }
+        'Illegal byte sequence',                { EILSEQ }
+        'Interrupted system call should be restarted',  { ERESTART }
+        'Streams pipe error',                   { ESTRPIPE }
+        'Too many users',                       { EUSERS }
+        'Socket operation on non-socket',       { ENOTSOCK }
+        'Destination address required',         { EDESTADDRREQ }
+        'Message too long',                     { EMSGSIZE }
+        'Protocol wrong type for socket',       { EPROTOTYPE }
+        'Protocol not available',               { ENOPROTOOPT }
+        'Protocol not supported',               { EPROTONOSUPPORT }
+        'Socket type not supported',            { ESOCKTNOSUPPORT }
+        'Operation not supported on transport endpoint',        { EOPNOTSUPP }
+        'Protocol family not supported',        { EPFNOSUPPORT }
+        'Address family not supported by protocol',     { EAFNOSUPPORT }
+        'Address already in use',               { EADDRINUSE }
+        'Cannot assign requested address',      { EADDRNOTAVAIL }
+        'Network is down',                      { ENETDOWN }
+        'Network is unreachable',               { ENETUNREACH }
+        'Network dropped connection because of reset',  { ENETRESET }
+        'Software caused connection abort',     { ECONNABORTED }
+        'Connection reset by peer',             { ECONNRESET }
+        'No buffer space available',            { ENOBUFS }
+        'Transport endpoint is already connected',      { EISCONN }
+        'Transport endpoint is not connected',  { ENOTCONN }
+        'Cannot send after transport endpoint shutdown',        { ESHUTDOWN }
+        'Too many references: cannot splice',   { ETOOMANYREFS }
+        'Connection timed out',                 { ETIMEDOUT }
+        'Connection refused',                   { ECONNREFUSED }
+        'Host is down',                         { EHOSTDOWN }
+        'No route to host',                     { EHOSTUNREACH }
+        'Operation already in progress',        { EALREADY }
+        'Operation now in progress',            { EINPROGRESS }
+        'Stale NFS file handle',                { ESTALE }
+        'Structure needs cleaning',             { EUCLEAN }
+        'Not a XENIX named type file',          { ENOTNAM }
+        'No XENIX semaphores available',        { ENAVAIL }
+        'Is a named type file',                 { EISNAM }
+        'Remote I/O error',                     { EREMOTEIO }
+        'Quota exceeded',                       { EDQUOT }
+        'No medium found',                      { ENOMEDIUM }
+        'Wrong medium type');                   { EMEDIUMTYPE }

+ 4 - 4
rtl/linux/i386/stat.inc

@@ -27,7 +27,7 @@
           st_rdev       : word;
           pad2       : word;
           st_size,
-          st_blksze,
+          st_blksize,
           st_blocks,
           st_atime,
           unused1,
@@ -48,7 +48,7 @@
           rdev          : word;
           pad2_dummy    : word;
           size,
-          blksze,
+          blksize,
           blocks,
           atime,
           unused1_dummy,
@@ -76,7 +76,7 @@
           st_rdev       : int64;
           pad2          : word;
           st_size,
-          st_blksze,
+          st_blksize,
           st_blocks,
           st_atime,
           unused1,
@@ -97,7 +97,7 @@
           rdev       : int64;
           pad2_dummy : word;
           size,
-          blksze,
+          blksize,
           blocks,
           atime,
           unused1_dummy,

+ 2 - 2
rtl/linux/m68k/stat.inc

@@ -25,7 +25,7 @@
           rdev       : word;
           pad2       : word;
           st_size,
-          st_blksze,
+          st_blksize,
           st_blocks,
           st_atime,
           unused1,
@@ -46,7 +46,7 @@
           rdev_dummy    : word;
           pad2_dummy    : word;
           size,
-          blksze,
+          blksize,
           blocks,
           atime,
           unused1_dummy,

+ 1 - 1
rtl/linux/x86_64/stat.inc

@@ -48,7 +48,7 @@
           pad1_dummy : dword;
           rdev          : qword;
           size,
-          blksze,
+          blksize,
           blocks    : int64;
           atime,
           unused1_dummy,

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1341 - 1499
rtl/morphos/mui.pas


+ 2 - 0
rtl/morphos/sysdir.inc

@@ -75,6 +75,8 @@ begin
       MOS_OrigDir:=tmpLock;
       tmpLock:=0;
     end;
+  end else begin
+    dosError2InOut(ERROR_DIR_NOT_FOUND);
   end;
 
   if tmpLock<>0 then Unlock(tmpLock);

+ 21 - 7
rtl/morphos/sysutils.pp

@@ -427,18 +427,32 @@ begin
 end;
 
 
-Function DirectoryExists(const Directory: string): Boolean;
+function DirectoryExists(const Directory: string): Boolean;
 var
- s: string;
+  tmpStr : array[0..255] of Char;
+  tmpLock: LongInt;
+  FIB    : PFileInfoBlock;
 begin
-  { Get old directory }
-  s:=GetCurrentDir;
-  ChDir(Directory);
-  DirectoryExists := (IOResult = 0);
-  ChDir(s);
+  DirectoryExists:=False;
+  If (Directory='') or (InOutRes<>0) then exit;
+  tmpStr:=PathConv(Directory)+#0;
+  tmpLock:=0;
+
+  tmpLock:=Lock(@tmpStr,SHARED_LOCK);
+  if tmpLock=0 then exit;
+
+  FIB:=nil; new(FIB);
+
+  if (Examine(tmpLock,FIB)=True) and (FIB^.fib_DirEntryType>0) then begin
+    DirectoryExists:=True;
+  end;
+
+  if tmpLock<>0 then Unlock(tmpLock);
+  if assigned(FIB) then dispose(FIB);
 end;
 
 
+
 {****************************************************************************
                               Misc Functions
 ****************************************************************************}

+ 0 - 4
rtl/objpas/cvarutil.inc

@@ -171,8 +171,6 @@ Function VariantToCardinal(Const VargSrc : TVarData) : Cardinal;
 
 
 Function VariantToSingle(Const VargSrc : TVarData) : Single;
-  var
-    e : extended;
   begin
     With VargSrc do
       Case (VType and VarTypeMask) of
@@ -187,13 +185,11 @@ Function VariantToSingle(Const VargSrc : TVarData) : Single;
           begin
             if not(TryStrToFloat(WideCharToString(vOleStr),Result)) then
               VariantTypeMismatch;
-             result:=e;
           end;
         VarString  :
           begin
             if not(TryStrToFloat(ansistring(vString),Result)) then
               VariantTypeMismatch;
-             result:=e;
           end;
 
         VarBoolean : Result:=Longint(VBoolean);

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott