فهرست منبع

Merged revisions 3390,3395,3423-3424,3440,3448,3454,3557-3558,3652,3665-3666,3789,3810,3835 via svnmerge from
http://[email protected]/svn/fpc/trunk

........
r3390 | joost | 2006-04-30 21:27:43 +0200 (Sun, 30 Apr 2006) | 1 line

+ Clear handle in ReaseMysql
........
r3395 | joost | 2006-05-01 00:23:14 +0200 (Mon, 01 May 2006) | 1 line

+ Clear handle in ReleaseIBase60
........
r3423 | Almindor | 2006-05-05 23:39:14 +0200 (Fri, 05 May 2006) | 2 lines

* fixes sqlite package for FreeBSD (and possibly other BSDs)

........
r3424 | Almindor | 2006-05-05 23:44:43 +0200 (Fri, 05 May 2006) | 3 lines

* fixes sqlite3 for freeBSD (and possibly other BSDs)
* fixes testapiv3x.pp to be compilable on unix as well

........
r3440 | Almindor | 2006-05-06 23:33:43 +0200 (Sat, 06 May 2006) | 2 lines

* fixes sqlite (installs also sqlitedb unit)

........
r3448 | peter | 2006-05-07 12:00:29 +0200 (Sun, 07 May 2006) | 2 lines

* fix version import from libgdb.a

........
r3454 | Almindor | 2006-05-08 00:40:23 +0200 (Mon, 08 May 2006) | 2 lines

* fixes some sqlite bugs

........
r3557 | florian | 2006-05-17 23:34:09 +0200 (Wed, 17 May 2006) | 2 lines

* renamed gdk_open_display to gdk_display_open, fixes 6933

........
r3558 | florian | 2006-05-18 11:18:58 +0200 (Thu, 18 May 2006) | 2 lines

+ added lack pango_font_description_set_absolute_size, fixes 6860

........
r3652 | michael | 2006-05-24 11:23:25 +0200 (Wed, 24 May 2006) | 1 line

Fixes from Tsvetoslav Petrov
........
r3665 | michael | 2006-05-25 09:50:09 +0200 (Thu, 25 May 2006) | 1 line

+ Forgot to add when committing patch
........
r3666 | michael | 2006-05-25 10:12:51 +0200 (Thu, 25 May 2006) | 1 line

* Initial implementation of imagemagick bindings by Felipe Monteiro de Carvalho
........
r3789 | Almindor | 2006-06-04 16:10:40 +0200 (Sun, 04 Jun 2006) | 2 lines

* a few fixes to make gtk_demo and helloworld2 examples compile

........
r3810 | michael | 2006-06-05 18:56:37 +0200 (Mon, 05 Jun 2006) | 1 line

+ Fixed bug #4821 and added test
........
r3835 | Almindor | 2006-06-10 11:46:18 +0200 (Sat, 10 Jun 2006) | 2 lines

* removed debug writeln from init section

........

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

peter 19 سال پیش
والد
کامیت
bfdc6b8951
58فایلهای تغییر یافته به همراه6799 افزوده شده و 359 حذف شده
  1. 31 0
      .gitattributes
  2. 119 35
      packages/base/Makefile
  3. 7 7
      packages/base/Makefile.fpc
  4. 17 28
      packages/base/gdbint/gdbver.pp
  5. 1 0
      packages/base/ibase/ibase60.inc
  6. 2085 0
      packages/base/imagemagick/Makefile
  7. 29 0
      packages/base/imagemagick/Makefile.fpc
  8. 29 0
      packages/base/imagemagick/buildim.pp
  9. BIN
      packages/base/imagemagick/demo1/image.png
  10. 111 0
      packages/base/imagemagick/demo1/wanddemo.dpr
  11. 260 0
      packages/base/imagemagick/demo1/wanddemo.lpi
  12. 59 0
      packages/base/imagemagick/demo1/wanddemo.lpr
  13. 291 0
      packages/base/imagemagick/demo2/screenshot.lpi
  14. 270 0
      packages/base/imagemagick/demo2/screenshot.lpi.bak
  15. 151 0
      packages/base/imagemagick/demo2/screenshot.lpr
  16. 52 0
      packages/base/imagemagick/magick/cache_view.inc
  17. 44 0
      packages/base/imagemagick/magick/compare.inc
  18. 45 0
      packages/base/imagemagick/magick/constitute.inc
  19. 298 0
      packages/base/imagemagick/magick/draw.inc
  20. 71 0
      packages/base/imagemagick/magick/effect.inc
  21. 63 0
      packages/base/imagemagick/magick/fx.inc
  22. 115 0
      packages/base/imagemagick/magick/imagemagick.pas
  23. 635 0
      packages/base/imagemagick/magick/magick_type.inc
  24. 82 0
      packages/base/imagemagick/magick/pixel.inc
  25. 49 0
      packages/base/imagemagick/magick/quantize.inc
  26. 37 0
      packages/base/imagemagick/magick/semaphore.inc
  27. 53 0
      packages/base/imagemagick/magick/statistic.inc
  28. 88 0
      packages/base/imagemagick/magick/type.inc
  29. 283 0
      packages/base/imagemagick/wand/drawing_wand.inc
  30. 80 0
      packages/base/imagemagick/wand/magick_attribute.inc
  31. 417 0
      packages/base/imagemagick/wand/magick_image.inc
  32. 71 0
      packages/base/imagemagick/wand/magick_wand.pas
  33. 74 0
      packages/base/imagemagick/wand/pixel_iterator.inc
  34. 109 0
      packages/base/imagemagick/wand/pixel_wand.inc
  35. 1 0
      packages/base/mysql/mysql.inc
  36. 53 36
      packages/base/netdb/Makefile
  37. 6 6
      packages/base/netdb/Makefile.fpc
  38. 288 151
      packages/base/netdb/netdb.pp
  39. 44 0
      packages/base/netdb/testhosts.pp
  40. 73 53
      packages/base/sqlite/Makefile
  41. 1 1
      packages/base/sqlite/Makefile.fpc
  42. 6 0
      packages/base/sqlite/sqlite.pp
  43. 6 0
      packages/base/sqlite/sqlite3.pp
  44. 3 7
      packages/base/sqlite/sqlitedb.pas
  45. 3 4
      packages/base/sqlite/test.pas
  46. 1 1
      packages/base/sqlite/testapiv3x.pp
  47. 60 16
      packages/extra/gtk2/Makefile
  48. 5 5
      packages/extra/gtk2/examples/gtk_demo/appwindow.inc
  49. 3 3
      packages/extra/gtk2/examples/gtk_demo/textview.inc
  50. 2 2
      packages/extra/gtk2/examples/helloworld2/helloworld2.pas
  51. 17 1
      packages/extra/gtk2/gtk+/gdk-pixbuf/gdk2pixbuf.pas
  52. 1 1
      packages/extra/gtk2/gtk+/gdk/gdkdisplay.inc
  53. 2 1
      packages/extra/gtk2/gtk+/gtk/gtk2.pas
  54. 2 0
      packages/extra/gtk2/gtk+/gtk/gtkentry.inc
  55. 3 1
      packages/extra/gtk2/gtk+/gtk/gtkincludes.inc
  56. 11 0
      packages/extra/gtk2/gtk+/gtk/gtkstock.inc
  57. 80 0
      packages/extra/gtk2/gtkcellrenderercombo.inc
  58. 2 0
      packages/extra/gtk2/pango/pango-font.inc

+ 31 - 0
.gitattributes

@@ -1176,6 +1176,35 @@ packages/base/ibase/mkdb.bat -text
 packages/base/ibase/mkdb.sqd -text
 packages/base/ibase/testib40.pp svneol=native#text/plain
 packages/base/ibase/testib60.pp svneol=native#text/plain
+packages/base/imagemagick/Makefile svneol=native#text/plain
+packages/base/imagemagick/Makefile.fpc svneol=native#text/plain
+packages/base/imagemagick/buildim.pp svneol=native#text/plain
+packages/base/imagemagick/demo1/image.png -text svneol=unset#image/png
+packages/base/imagemagick/demo1/wanddemo.dpr -text
+packages/base/imagemagick/demo1/wanddemo.lpi svneol=native#text/plain
+packages/base/imagemagick/demo1/wanddemo.lpr -text
+packages/base/imagemagick/demo2/screenshot.lpi svneol=native#text/plain
+packages/base/imagemagick/demo2/screenshot.lpi.bak -text
+packages/base/imagemagick/demo2/screenshot.lpr -text
+packages/base/imagemagick/magick/cache_view.inc svneol=native#text/plain
+packages/base/imagemagick/magick/compare.inc svneol=native#text/plain
+packages/base/imagemagick/magick/constitute.inc svneol=native#text/plain
+packages/base/imagemagick/magick/draw.inc svneol=native#text/plain
+packages/base/imagemagick/magick/effect.inc svneol=native#text/plain
+packages/base/imagemagick/magick/fx.inc svneol=native#text/plain
+packages/base/imagemagick/magick/imagemagick.pas svneol=native#text/plain
+packages/base/imagemagick/magick/magick_type.inc svneol=native#text/plain
+packages/base/imagemagick/magick/pixel.inc svneol=native#text/plain
+packages/base/imagemagick/magick/quantize.inc svneol=native#text/plain
+packages/base/imagemagick/magick/semaphore.inc svneol=native#text/plain
+packages/base/imagemagick/magick/statistic.inc svneol=native#text/plain
+packages/base/imagemagick/magick/type.inc svneol=native#text/plain
+packages/base/imagemagick/wand/drawing_wand.inc svneol=native#text/plain
+packages/base/imagemagick/wand/magick_attribute.inc svneol=native#text/plain
+packages/base/imagemagick/wand/magick_image.inc svneol=native#text/plain
+packages/base/imagemagick/wand/magick_wand.pas svneol=native#text/plain
+packages/base/imagemagick/wand/pixel_iterator.inc svneol=native#text/plain
+packages/base/imagemagick/wand/pixel_wand.inc svneol=native#text/plain
 packages/base/libasync/Makefile svneol=native#text/plain
 packages/base/libasync/Makefile.fpc svneol=native#text/plain
 packages/base/libasync/libasync.inc svneol=native#text/plain
@@ -1479,6 +1508,7 @@ packages/base/netdb/hsh.inc svneol=native#text/plain
 packages/base/netdb/ip6test.pp svneol=native#text/plain
 packages/base/netdb/netdb.pp svneol=native#text/plain
 packages/base/netdb/testdns.pp svneol=native#text/plain
+packages/base/netdb/testhosts.pp svneol=native#text/plain
 packages/base/netdb/testhst.pp svneol=native#text/plain
 packages/base/netdb/testnet.pp svneol=native#text/plain
 packages/base/netdb/testproto.pp svneol=native#text/plain
@@ -2586,6 +2616,7 @@ packages/extra/gtk2/gtk+/gtk/gtkwindow.inc svneol=native#text/plain
 packages/extra/gtk2/gtk+/gtk/paste.pas svneol=native#text/plain
 packages/extra/gtk2/gtk+/gtk/xembed.inc svneol=native#text/plain
 packages/extra/gtk2/gtk2forlazarus.lpk -text
+packages/extra/gtk2/gtkcellrenderercombo.inc svneol=native#text/plain
 packages/extra/gtk2/gtkglext/gdkglconfig.inc svneol=native#text/plain
 packages/extra/gtk2/gtkglext/gdkglcontext.inc svneol=native#text/plain
 packages/extra/gtk2/gtkglext/gdkgldefs.inc svneol=native#text/plain

+ 119 - 35
packages/base/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/02/13]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/06/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-darwin 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-palmos arm-wince powerpc64-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince 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-palmos arm-wince arm-gba powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -231,28 +231,28 @@ 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 graph libc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite graph imagemagick libc
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 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 oracle graph
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint mysql ibase odbc sqlite postgres oracle graph imagemagick
 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 graph 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 imagemagick
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc imagemagick
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  libasync mysql ibase postgres oracle odbc sqlite pthreads
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  libasync mysql ibase postgres oracle odbc sqlite pthreads imagemagick
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
@@ -261,13 +261,13 @@ ifeq ($(FULL_TARGET),i386-netware)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc imagemagick
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  libasync mysql ibase postgres oracle odbc sqlite pthreads
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  libasync mysql ibase postgres oracle odbc sqlite pthreads imagemagick
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
@@ -282,13 +282,13 @@ ifeq ($(FULL_TARGET),i386-wince)
 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 graph
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite graph imagemagick
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync graph 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 imagemagick
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc imagemagick
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
@@ -297,46 +297,46 @@ ifeq ($(FULL_TARGET),m68k-atari)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc imagemagick
 endif
 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 graph
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite graph imagemagick
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc imagemagick
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  libasync mysql ibase postgres oracle odbc sqlite pthreads
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  libasync mysql ibase postgres oracle odbc sqlite pthreads imagemagick
 endif
 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 graph
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite graph imagemagick
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc imagemagick
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  libasync mysql ibase postgres oracle odbc sqlite pthreads
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  libasync mysql ibase postgres oracle odbc sqlite pthreads imagemagick
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite graph libc
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite graph imagemagick libc
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync graph 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 imagemagick
 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 graph
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite graph imagemagick
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
@@ -344,8 +344,11 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  ibase sqlite postgres
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite graph
+override TARGET_DIRS+=hash paszlib pasjpeg regexpr netdb  gdbint libasync mysql ibase postgres oracle odbc pthreads sqlite graph imagemagick
 endif
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCSUBDIR=packages/base
@@ -557,6 +560,7 @@ STATICLIBEXT=.a
 SHAREDLIBEXT=.so
 SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 ifeq ($(OS_TARGET),go32v1)
@@ -669,6 +673,11 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=dwn
 endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
 else
 ifeq ($(OS_TARGET),go32v1)
 PPUEXT=.pp1
@@ -989,12 +998,17 @@ endif
 endif
 export ZIPPROG
 ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
 TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG= __missing_command_TARPROG
 else
 TARPROG:=$(firstword $(TARPROG))
 endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
 endif
 export TARPROG
 ASNAME=$(BINUTILSPREFIX)as
@@ -1087,6 +1101,9 @@ endif
 ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
 ifeq ($(OS_SOURCE),openbsd)
 override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
@@ -1121,14 +1138,15 @@ override FPCOPT+=-gl
 override FPCOPTDEF+=DEBUG
 endif
 ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
 ifeq ($(CPU_TARGET),i386)
 FPCCPUOPT:=-OG2p3
-else
+endif
 ifeq ($(CPU_TARGET),powerpc)
 FPCCPUOPT:=-O1r
-else
-FPCCPUOPT:=
 endif
+else
+FPCCPUOPT:=-O2
 endif
 override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
 override FPCOPTDEF+=RELEASE
@@ -1137,9 +1155,7 @@ ifdef STRIP
 override FPCOPT+=-Xs
 endif
 ifdef OPTIMIZE
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-OG2p3
-endif
+override FPCOPT+=-O2
 endif
 ifdef VERBOSE
 override FPCOPT+=-vwni
@@ -1183,11 +1199,6 @@ 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 CREATESHARED
 override FPCOPT+=-Cg
 ifeq ($(CPU_TARGET),i386)
@@ -1238,7 +1249,7 @@ ifdef CLEAN_UNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
 endif
 ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
 ifdef DEBUGSYMEXT
 override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
 endif
@@ -1419,6 +1430,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_GRAPH=1
+TARGET_DIRS_IMAGEMAGICK=1
 TARGET_DIRS_LIBC=1
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
@@ -1444,6 +1456,7 @@ TARGET_DIRS_SQLITE=1
 TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_ORACLE=1
 TARGET_DIRS_GRAPH=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 TARGET_DIRS_HASH=1
@@ -1468,6 +1481,7 @@ TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_PTHREADS=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 TARGET_DIRS_HASH=1
@@ -1489,6 +1503,7 @@ TARGET_DIRS_IBASE=1
 TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
 TARGET_DIRS_HASH=1
@@ -1504,6 +1519,7 @@ TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_PTHREADS=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 TARGET_DIRS_HASH=1
@@ -1532,6 +1548,7 @@ TARGET_DIRS_IBASE=1
 TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 TARGET_DIRS_HASH=1
@@ -1554,6 +1571,7 @@ TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_PTHREADS=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 TARGET_DIRS_HASH=1
@@ -1602,6 +1620,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_GRAPH=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 TARGET_DIRS_HASH=1
@@ -1619,6 +1638,7 @@ TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_PTHREADS=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 TARGET_DIRS_HASH=1
@@ -1633,6 +1653,7 @@ TARGET_DIRS_IBASE=1
 TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 TARGET_DIRS_HASH=1
@@ -1661,6 +1682,7 @@ TARGET_DIRS_IBASE=1
 TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 TARGET_DIRS_HASH=1
@@ -1685,6 +1707,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_GRAPH=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 TARGET_DIRS_HASH=1
@@ -1699,6 +1722,7 @@ TARGET_DIRS_IBASE=1
 TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 TARGET_DIRS_HASH=1
@@ -1721,6 +1745,7 @@ TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_PTHREADS=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 TARGET_DIRS_HASH=1
@@ -1745,6 +1770,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_GRAPH=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 TARGET_DIRS_HASH=1
@@ -1759,6 +1785,7 @@ TARGET_DIRS_IBASE=1
 TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
 TARGET_DIRS_HASH=1
@@ -1774,6 +1801,7 @@ TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_PTHREADS=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 TARGET_DIRS_HASH=1
@@ -1791,6 +1819,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_GRAPH=1
+TARGET_DIRS_IMAGEMAGICK=1
 TARGET_DIRS_LIBC=1
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
@@ -1809,6 +1838,7 @@ TARGET_DIRS_ORACLE=1
 TARGET_DIRS_ODBC=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_PTHREADS=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 TARGET_DIRS_HASH=1
@@ -1833,6 +1863,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_GRAPH=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 TARGET_DIRS_HASH=1
@@ -1851,6 +1882,13 @@ TARGET_DIRS_IBASE=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_POSTGRES=1
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+TARGET_DIRS_HASH=1
+TARGET_DIRS_PASZLIB=1
+TARGET_DIRS_PASJPEG=1
+TARGET_DIRS_REGEXPR=1
+TARGET_DIRS_NETDB=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 TARGET_DIRS_HASH=1
 TARGET_DIRS_PASZLIB=1
@@ -1867,6 +1905,7 @@ TARGET_DIRS_ODBC=1
 TARGET_DIRS_PTHREADS=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_GRAPH=1
+TARGET_DIRS_IMAGEMAGICK=1
 endif
 ifdef TARGET_DIRS_HASH
 hash_all:
@@ -2543,6 +2582,51 @@ 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
+ifdef TARGET_DIRS_IMAGEMAGICK
+imagemagick_all:
+	$(MAKE) -C imagemagick all
+imagemagick_debug:
+	$(MAKE) -C imagemagick debug
+imagemagick_smart:
+	$(MAKE) -C imagemagick smart
+imagemagick_release:
+	$(MAKE) -C imagemagick release
+imagemagick_units:
+	$(MAKE) -C imagemagick units
+imagemagick_examples:
+	$(MAKE) -C imagemagick examples
+imagemagick_shared:
+	$(MAKE) -C imagemagick shared
+imagemagick_install:
+	$(MAKE) -C imagemagick install
+imagemagick_sourceinstall:
+	$(MAKE) -C imagemagick sourceinstall
+imagemagick_exampleinstall:
+	$(MAKE) -C imagemagick exampleinstall
+imagemagick_distinstall:
+	$(MAKE) -C imagemagick distinstall
+imagemagick_zipinstall:
+	$(MAKE) -C imagemagick zipinstall
+imagemagick_zipsourceinstall:
+	$(MAKE) -C imagemagick zipsourceinstall
+imagemagick_zipexampleinstall:
+	$(MAKE) -C imagemagick zipexampleinstall
+imagemagick_zipdistinstall:
+	$(MAKE) -C imagemagick zipdistinstall
+imagemagick_clean:
+	$(MAKE) -C imagemagick clean
+imagemagick_distclean:
+	$(MAKE) -C imagemagick distclean
+imagemagick_cleanall:
+	$(MAKE) -C imagemagick cleanall
+imagemagick_info:
+	$(MAKE) -C imagemagick info
+imagemagick_makefiles:
+	$(MAKE) -C imagemagick makefiles
+imagemagick:
+	$(MAKE) -C imagemagick all
+.PHONY: imagemagick_all imagemagick_debug imagemagick_smart imagemagick_release imagemagick_units imagemagick_examples imagemagick_shared imagemagick_install imagemagick_sourceinstall imagemagick_exampleinstall imagemagick_distinstall imagemagick_zipinstall imagemagick_zipsourceinstall imagemagick_zipexampleinstall imagemagick_zipdistinstall imagemagick_clean imagemagick_distclean imagemagick_cleanall imagemagick_info imagemagick_makefiles imagemagick
+endif
 ifdef TARGET_DIRS_LIBC
 libc_all:
 	$(MAKE) -C libc all

+ 7 - 7
packages/base/Makefile.fpc

@@ -7,20 +7,20 @@ dirs=hash paszlib pasjpeg regexpr netdb
 dirs_i386_linux=libc
 dirs_x86_64_linux=libc
 dirs_linux=gdbint libasync mysql ibase postgres oracle odbc \
-            pthreads sqlite graph
-dirs_win32=gdbint mysql ibase odbc sqlite postgres oracle graph
+            pthreads sqlite graph imagemagick
+dirs_win32=gdbint mysql ibase odbc sqlite postgres oracle graph imagemagick 
 dirs_wince=ibase sqlite postgres
 dirs_go32v2=gdbint graph
 dirs_netbsd=gdbint libasync \
-            mysql ibase postgres oracle odbc 
+            mysql ibase postgres oracle odbc imagemagick
 dirs_openbsd=gdbint libasync \
-            mysql ibase postgres oracle odbc 
+            mysql ibase postgres oracle odbc imagemagick
 dirs_freebsd=gdbint libasync graph \
-             mysql ibase postgres oracle odbc sqlite pthreads
+             mysql ibase postgres oracle odbc sqlite pthreads imagemagick
 dirs_darwin=libasync \
-             mysql ibase postgres oracle odbc sqlite pthreads
+             mysql ibase postgres oracle odbc sqlite pthreads imagemagick
 dirs_solaris=libasync \
-             mysql ibase postgres oracle odbc sqlite pthreads
+             mysql ibase postgres oracle odbc sqlite pthreads imagemagick
 
 [install]
 fpcpackage=y

+ 17 - 28
packages/base/gdbint/gdbver.pp

@@ -11,30 +11,19 @@ program find_gdb_version;
   {$Linklib c}
 {$endif}
 
-{$Linklib gdb}
+{$LINKLIB libgdb.a}
 
 uses
   strings;
 
 const
-{$ifdef OpenBSD}
-  ver_name = '_version';
-{$else}
-{$ifdef unix}
-  ver_name = 'version';
-{$else not unix}
-  ver_name = '_version';
-{$endif}
-{$endif}
-
-  { This variable should be change with
-    change in GDB CVS PM }
+  { This variable should be change with change in GDB CVS PM }
   Current_cvs_version : longint = 503;
   Max_version_length = 255;
 
 var
-  v5_version : array[0..0] of char;external name ver_name;
-  version : pchar;
+  version : array[0..0] of char;cvar;external;
+  gdbversion : pchar;
   subver_str : string;
   i, version_number,
   subversion_number : longint;
@@ -44,27 +33,27 @@ var
 
 begin
   only_ver:=(Paramcount>0) and (ParamStr(1)='-n');
-  getmem(version,Max_version_length+1);
-  strlcopy(version,@v5_version,Max_version_length);
-  version[Max_version_length]:=#0;
-  if (version[0] in ['4','5','6','7','8','9']) and (version[1]='.') then
+  getmem(gdbversion,Max_version_length+1);
+  strlcopy(gdbversion,@version,Max_version_length);
+  gdbversion[Max_version_length]:=#0;
+  if (gdbversion[0] in ['4','5','6','7','8','9']) and (gdbversion[1]='.') then
     begin
       if not only_ver then
-        Writeln('GDB version is ',pchar(@v5_version));
-      version_number:=ord(version[0])-ord('0');
+        Writeln('GDB version is ',pchar(@version));
+      version_number:=ord(gdbversion[0])-ord('0');
       i:=2;
       subver_str:='';
-      while version[i] in ['0'..'9'] do
+      while gdbversion[i] in ['0'..'9'] do
         begin
-          subver_str:=subver_str+version[i];
+          subver_str:=subver_str+gdbversion[i];
           inc(i);
         end;
       val(subver_str,subversion_number,error);
       inc(i);
       subver_str:='';
-      while version[i] in ['0'..'9'] do
+      while gdbversion[i] in ['0'..'9'] do
         begin
-          subver_str:=subver_str+version[i];
+          subver_str:=subver_str+gdbversion[i];
           inc(i);
         end;
       if subver_str<>'' then
@@ -76,8 +65,8 @@ begin
          (subversion_number<=99) then
         version_number:=version_number*100+subversion_number;
     end
-  else if (version[0]='2') and (version[1]='0') and
-          (version[2] in ['0'..'9']) and (version[3] in ['0'..'9']) then
+  else if (gdbversion[0]='2') and (gdbversion[1]='0') and
+          (gdbversion[2] in ['0'..'9']) and (gdbversion[3] in ['0'..'9']) then
     begin
       { CVS version from 2000 to 2099,
         assume current_cvs_version  PM }
@@ -89,7 +78,7 @@ begin
         Writeln('Unsupported GDB version');
       version_number:=0;
     end;
-  freemem(version,Max_version_length+1);
+  freemem(gdbversion);
   if only_ver then
     Write(version_number);
   Halt(version_number);

+ 1 - 0
packages/base/ibase/ibase60.inc

@@ -2684,6 +2684,7 @@ begin
   else if UnloadLibrary(IBaseLibraryHandle) then 
     begin
     Dec(RefCount);
+    IBaseLibraryHandle := NilHandle;
     LoadedLibrary:='';
     end;
 end;

+ 2085 - 0
packages/base/imagemagick/Makefile

@@ -0,0 +1,2085 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/05/20]
+#
+default: all
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince 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-palmos 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=gtk2
+override PACKAGE_VERSION=2.0.0
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=buildim
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_IMPLICITUNITS+=magick_wand imagemagick
+endif
+override INSTALL_BUILDUNIT=buildgtk2
+override INSTALL_FPCPACKAGE=y
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_UNITDIR+=magick wand
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_UNITDIR+=magick wand
+endif
+override SHARED_BUILD=n
+override SHARED_BUILD=n
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+ifeq ($(OS_SOURCE),linux)
+ifndef GCCLIBDIR
+ifeq ($(CPU_TARGET),i386)
+ifneq ($(findstring x86_64,$(shell uname -a)),)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
+endif
+endif
+endif
+ifeq ($(CPU_TARGET),powerpc64)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`)
+endif
+endif
+endif
+ifndef GCCLIBDIR
+CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(CROSSGCC),)
+GCCLIBDIR:=$(shell dirname `$(CROSSGCC) -print-libgcc-file-name`)
+endif
+endif
+ifndef OTHERLIBDIR
+OTHERLIBDIR:=$(shell grep -v "^\#" /etc/ld.so.conf | awk '{ ORS=" "; print $1 }')
+endif
+endif
+ifdef inUnix
+ifeq ($(OS_SOURCE),netbsd)
+OTHERLIBDIR+=/usr/pkg/lib
+endif
+export GCCLIBDIR OTHERLIB
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+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 /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG= __missing_command_TARPROG
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+endif
+export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),win32)
+ifeq ($(CROSSBINDIR),)
+ASNAME=asw
+LDNAME=ldw
+ARNAME=arw
+endif
+endif
+endif
+ifndef ASPROG
+ifdef CROSSBINDIR
+ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
+else
+ASPROG=$(ASNAME)
+endif
+endif
+ifndef LDPROG
+ifdef CROSSBINDIR
+LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
+else
+LDPROG=$(LDNAME)
+endif
+endif
+ifndef RCPROG
+ifdef CROSSBINDIR
+RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
+else
+RCPROG=$(RCNAME)
+endif
+endif
+ifndef ARPROG
+ifdef CROSSBINDIR
+ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
+else
+ARPROG=$(ARNAME)
+endif
+endif
+AS=$(ASPROG)
+LD=$(LDPROG)
+RC=$(RCPROG)
+AR=$(ARPROG)
+PPAS=ppas$(SRCBATCHEXT)
+ifdef inUnix
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+ifndef UPXPROG
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+export UPXPROG
+ZIPOPT=-9
+ZIPEXT=.zip
+ifeq ($(USETAR),bz2)
+TAROPT=vj
+TAREXT=.tar.bz2
+else
+TAROPT=vz
+TAREXT=.tar.gz
+endif
+override REQUIRE_PACKAGES=rtl 
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),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-palmos)
+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
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_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
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O2
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef GCCLIBDIR
+override FPCOPT+=-Fl$(GCCLIBDIR)
+endif
+ifdef OTHERLIBDIR
+override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+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 fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+	@$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+	$(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+	$(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(PPUEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.lpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_distinstall
+fpc_distinstall: install exampleinstall
+.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
+ifndef PACKDIR
+ifndef inUnix
+PACKDIR=$(BASEDIR)/../fpc-pack
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+ifndef ZIPNAME
+ifdef DIST_ZIPNAME
+ZIPNAME=$(DIST_ZIPNAME)
+else
+ZIPNAME=$(PACKAGE_NAME)
+endif
+endif
+ifndef FULLZIPNAME
+FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
+endif
+ifndef ZIPTARGET
+ifdef DIST_ZIPTARGET
+ZIPTARGET=DIST_ZIPTARGET
+else
+ZIPTARGET=install
+endif
+endif
+ifndef USEZIP
+ifdef inUnix
+USETAR=1
+endif
+endif
+ifndef inUnix
+USEZIPWRAPPER=1
+endif
+ifdef USEZIPWRAPPER
+ZIPPATHSEP=$(PATHSEP)
+ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
+else
+ZIPPATHSEP=/
+endif
+ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
+ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
+ifdef USETAR
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
+ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
+else
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
+ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
+endif
+fpc_zipinstall:
+	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
+	$(MKDIR) $(DIST_DESTDIR)
+	$(DEL) $(ZIPDESTFILE)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
+else
+	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
+	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
+	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
+endif
+ifdef inUnix
+	/bin/sh $(ZIPWRAPPER)
+else
+	$(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))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
+override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+	-$(DELTREE) units
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+	-$(DEL) *.o *.ppu *.a
+endif
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *_ppas$(BATCHEXT)
+ifdef AOUTEXT
+	-$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+	-$(DEL) *$(DEBUGSYMEXT)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+	@$(ECHO)
+	@$(ECHO)  == Package info ==
+	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
+	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC.......... $(FPC)
+	@$(ECHO)  FPC Version.. $(FPC_VERSION)
+	@$(ECHO)  Source CPU... $(CPU_SOURCE)
+	@$(ECHO)  Target CPU... $(CPU_TARGET)
+	@$(ECHO)  Source OS.... $(OS_SOURCE)
+	@$(ECHO)  Target OS.... $(OS_TARGET)
+	@$(ECHO)  Full Source.. $(FULL_SOURCE)
+	@$(ECHO)  Full Target.. $(FULL_TARGET)
+	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
+	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
+	@$(ECHO)
+	@$(ECHO)  == Directory info ==
+	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
+	@$(ECHO)  Basedir......... $(BASEDIR)
+	@$(ECHO)  FPCDir.......... $(FPCDIR)
+	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
+	@$(ECHO)  UnitsDir........ $(UNITSDIR)
+	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
+	@$(ECHO)
+	@$(ECHO)  GCC library..... $(GCCLIBDIR)
+	@$(ECHO)  Other library... $(OTHERLIBDIR)
+	@$(ECHO)
+	@$(ECHO)  == Tools info ==
+	@$(ECHO)
+	@$(ECHO)  As........ $(AS)
+	@$(ECHO)  Ld........ $(LD)
+	@$(ECHO)  Ar........ $(AR)
+	@$(ECHO)  Rc........ $(RC)
+	@$(ECHO)
+	@$(ECHO)  Mv........ $(MVPROG)
+	@$(ECHO)  Cp........ $(CPPROG)
+	@$(ECHO)  Rm........ $(RMPROG)
+	@$(ECHO)  GInstall.. $(GINSTALL)
+	@$(ECHO)  Echo...... $(ECHO)
+	@$(ECHO)  Shell..... $(SHELL)
+	@$(ECHO)  Date...... $(DATE)
+	@$(ECHO)  FPCMake... $(FPCMAKE)
+	@$(ECHO)  PPUMove... $(PPUMOVE)
+	@$(ECHO)  Upx....... $(UPXPROG)
+	@$(ECHO)  Zip....... $(ZIPPROG)
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)
+	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
+	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
+	@$(ECHO)
+	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
+	@$(ECHO)  Install Files....... $(INSTALL_FILES)
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+	@$(ECHO)  DateStr.............. $(DATESTR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
+	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
+	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
+	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
+	@$(ECHO)
+	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
+	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
+	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
+	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
+	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
+	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
+	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
+	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
+	@$(ECHO)
+	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
+	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
+	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+all: fpc_all
+debug: fpc_debug
+smart: fpc_smart
+release: fpc_release
+units: fpc_units
+examples:
+shared: fpc_shared
+install: fpc_install
+sourceinstall: fpc_sourceinstall
+exampleinstall: fpc_exampleinstall
+distinstall: fpc_distinstall
+zipinstall: fpc_zipinstall
+zipsourceinstall: fpc_zipsourceinstall
+zipexampleinstall: fpc_zipexampleinstall
+zipdistinstall: fpc_zipdistinstall
+clean: fpc_clean
+distclean: fpc_distclean
+cleanall: fpc_cleanall
+info: fpc_info
+makefiles: fpc_makefiles
+.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif

+ 29 - 0
packages/base/imagemagick/Makefile.fpc

@@ -0,0 +1,29 @@
+#
+#   Makefile.fpc for Free Pascal GTK 2.x.y Bindings
+#
+
+[package]
+name=gtk2
+version=2.0.0
+
+[require]
+libc=y
+
+[target]
+units=buildim 
+exampledirs=
+implicitunits=magick_wand imagemagick
+
+[compiler]
+unitdir=magick wand
+
+[install]
+buildunit=buildgtk2
+fpcpackage=y
+
+[shared]
+build=n
+
+[default]
+fpcdir=../../..
+

+ 29 - 0
packages/base/imagemagick/buildim.pp

@@ -0,0 +1,29 @@
+{
+   Dummy unit to compile imagemagick in one command
+
+   This unit is part of imagemagick.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the
+   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+}
+unit buildim;
+
+Interface
+
+uses imagemagick, magick_wand;
+
+Implementation
+
+end.

BIN
packages/base/imagemagick/demo1/image.png


+ 111 - 0
packages/base/imagemagick/demo1/wanddemo.dpr

@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <PathDelim Value="/"/>
+    <Version Value="5"/>
+    <General>
+      <MainUnit Value="0"/>
+      <IconPath Value="./"/>
+      <TargetFileExt Value=""/>
+      <ActiveEditorIndexAtStart Value="4"/>
+    </General>
+    <LazDoc Paths=""/>
+    <Units Count="6">
+      <Unit0>
+        <CursorPos X="1" Y="48"/>
+        <EditorIndex Value="0"/>
+        <Filename Value="wanddemo.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <Loaded Value="True"/>
+        <TopLine Value="15"/>
+        <UnitName Value="wanddemo"/>
+        <UsageCount Value="23"/>
+      </Unit0>
+      <Unit1>
+        <CursorPos X="2" Y="48"/>
+        <Filename Value="wanddemo.dpr"/>
+        <TopLine Value="15"/>
+        <UnitName Value="wanddemo"/>
+        <UsageCount Value="20"/>
+      </Unit1>
+      <Unit2>
+        <CursorPos X="3" Y="26"/>
+        <EditorIndex Value="2"/>
+        <Filename Value="magick_type.inc"/>
+        <Loaded Value="True"/>
+        <TopLine Value="9"/>
+        <UsageCount Value="11"/>
+      </Unit2>
+      <Unit3>
+        <CursorPos X="1" Y="62"/>
+        <EditorIndex Value="1"/>
+        <Filename Value="magick_wand.pas"/>
+        <Loaded Value="True"/>
+        <TopLine Value="33"/>
+        <UnitName Value="magick_wand"/>
+        <UsageCount Value="11"/>
+      </Unit3>
+      <Unit4>
+        <CursorPos X="25" Y="24"/>
+        <EditorIndex Value="4"/>
+        <Filename Value="magick_image.inc"/>
+        <Loaded Value="True"/>
+        <TopLine Value="18"/>
+        <UsageCount Value="11"/>
+      </Unit4>
+      <Unit5>
+        <CursorPos X="70" Y="80"/>
+        <EditorIndex Value="3"/>
+        <Filename Value="drawing_wand.inc"/>
+        <Loaded Value="True"/>
+        <TopLine Value="113"/>
+        <UsageCount Value="11"/>
+      </Unit5>
+    </Units>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IgnoreBinaries Value="False"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+        <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+      </local>
+    </RunParams>
+    <JumpHistory Count="3" HistoryIndex="2">
+      <Position1>
+        <Filename Value="wanddemo.lpr"/>
+        <Caret Line="28" Column="20" TopLine="14"/>
+      </Position1>
+      <Position2>
+        <Filename Value="wanddemo.lpr"/>
+        <Caret Line="26" Column="16" TopLine="14"/>
+      </Position2>
+      <Position3>
+        <Filename Value="wanddemo.lpr"/>
+        <Caret Line="28" Column="17" TopLine="15"/>
+      </Position3>
+    </JumpHistory>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="5"/>
+    <CodeGeneration>
+      <Generate Value="Faster"/>
+    </CodeGeneration>
+    <Other>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="2">
+      <Item1>
+        <Name Value="ECodetoolError"/>
+      </Item1>
+      <Item2>
+        <Name Value="EFOpenError"/>
+      </Item2>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 260 - 0
packages/base/imagemagick/demo1/wanddemo.lpi

@@ -0,0 +1,260 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <PathDelim Value="/"/>
+    <Version Value="5"/>
+    <General>
+      <MainUnit Value="0"/>
+      <IconPath Value="./"/>
+      <TargetFileExt Value=""/>
+      <ActiveEditorIndexAtStart Value="0"/>
+    </General>
+    <LazDoc Paths=""/>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IgnoreBinaries Value="False"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+        <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+      </local>
+    </RunParams>
+    <Units Count="30">
+      <Unit0>
+        <Filename Value="wanddemo.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <CursorPos X="1" Y="11"/>
+        <TopLine Value="1"/>
+        <EditorIndex Value="0"/>
+        <UsageCount Value="47"/>
+        <Loaded Value="True"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="magick_wand.pas"/>
+        <UnitName Value="magick_wand"/>
+        <CursorPos X="13" Y="49"/>
+        <TopLine Value="36"/>
+        <UsageCount Value="23"/>
+      </Unit1>
+      <Unit2>
+        <Filename Value="magick_type.inc"/>
+        <CursorPos X="41" Y="3"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="11"/>
+      </Unit2>
+      <Unit3>
+        <Filename Value="magick_image.inc"/>
+        <CursorPos X="24" Y="301"/>
+        <TopLine Value="301"/>
+        <UsageCount Value="20"/>
+      </Unit3>
+      <Unit4>
+        <Filename Value="drawing_wand.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="16"/>
+      </Unit4>
+      <Unit5>
+        <Filename Value="quantize.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit5>
+      <Unit6>
+        <Filename Value="home/felipe/Programas/imagemagick/magick/quantize.inc"/>
+        <CursorPos X="30" Y="25"/>
+        <TopLine Value="9"/>
+        <UsageCount Value="8"/>
+      </Unit6>
+      <Unit7>
+        <Filename Value="home/felipe/Programas/imagemagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="1" Y="26"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit7>
+      <Unit8>
+        <Filename Value="C:/Programas/ImageMagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="41" Y="26"/>
+        <TopLine Value="22"/>
+        <UsageCount Value="9"/>
+      </Unit8>
+      <Unit9>
+        <Filename Value="C:/Programas/ImageMagick/magick/magick_type.inc"/>
+        <CursorPos X="1" Y="303"/>
+        <TopLine Value="357"/>
+        <UsageCount Value="8"/>
+      </Unit9>
+      <Unit10>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="5" Y="31"/>
+        <TopLine Value="27"/>
+        <UsageCount Value="10"/>
+      </Unit10>
+      <Unit11>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/statistic.inc"/>
+        <CursorPos X="1" Y="46"/>
+        <TopLine Value="18"/>
+        <UsageCount Value="9"/>
+      </Unit11>
+      <Unit12>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/magick_type.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="9"/>
+      </Unit12>
+      <Unit13>
+        <Filename Value="pixel_wand.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="19"/>
+      </Unit13>
+      <Unit14>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/constitute.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit14>
+      <Unit15>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/effect.inc"/>
+        <CursorPos X="1" Y="19"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit15>
+      <Unit16>
+        <Filename Value="pixel_iterator.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="11"/>
+      </Unit16>
+      <Unit17>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/cache_view.inc"/>
+        <CursorPos X="25" Y="28"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit17>
+      <Unit18>
+        <Filename Value="magick_attribute.inc"/>
+        <CursorPos X="37" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="13"/>
+      </Unit18>
+      <Unit19>
+        <Filename Value="C:/Programas/PascalMagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="11" Y="13"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="12"/>
+      </Unit19>
+      <Unit20>
+        <Filename Value="C:/Programas/PascalMagick/magick/magick_type.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="12"/>
+      </Unit20>
+      <Unit21>
+        <Filename Value="C:/Programas/PascalMagick/magick/draw.inc"/>
+        <CursorPos X="22" Y="241"/>
+        <TopLine Value="236"/>
+        <UsageCount Value="9"/>
+      </Unit21>
+      <Unit22>
+        <Filename Value="C:/Programas/PascalMagick/magick/type.inc"/>
+        <CursorPos X="24" Y="63"/>
+        <TopLine Value="62"/>
+        <UsageCount Value="10"/>
+      </Unit22>
+      <Unit23>
+        <Filename Value="C:/Programas/PascalMagick/magick/pixel.inc"/>
+        <CursorPos X="24" Y="4"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="9"/>
+      </Unit23>
+      <Unit24>
+        <Filename Value="../magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="14" Y="44"/>
+        <TopLine Value="32"/>
+        <UsageCount Value="14"/>
+      </Unit24>
+      <Unit25>
+        <Filename Value="../magick/magick_type.inc"/>
+        <CursorPos X="7" Y="288"/>
+        <TopLine Value="82"/>
+        <UsageCount Value="12"/>
+      </Unit25>
+      <Unit26>
+        <Filename Value="../wand/pixel_iterator.inc"/>
+        <CursorPos X="26" Y="9"/>
+        <TopLine Value="9"/>
+        <UsageCount Value="10"/>
+      </Unit26>
+      <Unit27>
+        <Filename Value="../wand/magick_wand.pas"/>
+        <UnitName Value="magick_wand"/>
+        <CursorPos X="17" Y="32"/>
+        <TopLine Value="16"/>
+        <UsageCount Value="10"/>
+      </Unit27>
+      <Unit28>
+        <Filename Value="../wand/drawing_wand.inc"/>
+        <CursorPos X="56" Y="247"/>
+        <TopLine Value="226"/>
+        <UsageCount Value="10"/>
+      </Unit28>
+      <Unit29>
+        <Filename Value="../magick/type.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="24"/>
+        <UsageCount Value="10"/>
+      </Unit29>
+    </Units>
+    <JumpHistory Count="0" HistoryIndex="-1"/>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="5"/>
+    <SearchPaths>
+      <OtherUnitFiles Value="../magick/;../wand/"/>
+      <SrcPath Value="../magick/;../wand/"/>
+    </SearchPaths>
+    <CodeGeneration>
+      <Generate Value="Faster"/>
+    </CodeGeneration>
+    <Other>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Watches Count="4">
+      <Item1>
+        <Expression Value="GlassTop"/>
+        <Enabled Value="False"/>
+      </Item1>
+      <Item2>
+        <Expression Value="GlassLeft"/>
+        <Enabled Value="False"/>
+      </Item2>
+      <Item3>
+        <Expression Value="GlassHeight"/>
+        <Enabled Value="False"/>
+      </Item3>
+      <Item4>
+        <Expression Value="GlassWidth"/>
+        <Enabled Value="False"/>
+      </Item4>
+    </Watches>
+    <Exceptions Count="2">
+      <Item1>
+        <Name Value="ECodetoolError"/>
+      </Item1>
+      <Item2>
+        <Name Value="EFOpenError"/>
+      </Item2>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 59 - 0
packages/base/imagemagick/demo1/wanddemo.lpr

@@ -0,0 +1,59 @@
+{
+  Demonstration program for the ImageMagick Library
+
+  This program was converted from c by: Felipe Monteiro de Carvalho
+
+  Usage: Just execute the program. It will resize the image.png image
+  on it's directory to fit (106, 80) and convert it to a jpg.
+
+  Dez/2005
+}
+program wanddemo;
+
+{$mode objfpc}{$H+}
+
+uses SysUtils, magick_wand, ImageMagick;
+
+procedure ThrowWandException(wand: PMagickWand);
+var
+  description: PChar;
+  severity: ExceptionType;
+begin
+  description := MagickGetException(wand, @severity);
+  WriteLn(Format('An error ocurred. Description: %s', [description]));
+  description := MagickRelinquishMemory(description);
+  Abort;
+end;
+
+var
+  status: MagickBooleanType;
+  wand: PMagickWand;
+begin
+  { Read an image. }
+
+  MagickWandGenesis;
+
+  wand := NewMagickWand;
+
+  try
+    status := MagickReadImage(wand, 'image.png');
+    if (status = MagickFalse) then ThrowWandException(wand);
+
+    { Turn the images into a thumbnail sequence. }
+
+    MagickResetIterator(wand);
+
+    while (MagickNextImage(wand) <> MagickFalse) do
+     MagickResizeImage(wand, 106, 80, LanczosFilter, 1.0);
+
+    { Write the image as MIFF and destroy it. }
+
+    status := MagickWriteImages(wand, 'image.jpg', MagickTrue);
+    if (status = MagickFalse) then ThrowWandException(wand);
+
+  finally
+    wand := DestroyMagickWand(wand);
+
+    MagickWandTerminus;
+  end;
+end.

+ 291 - 0
packages/base/imagemagick/demo2/screenshot.lpi

@@ -0,0 +1,291 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <PathDelim Value="/"/>
+    <Version Value="5"/>
+    <General>
+      <MainUnit Value="0"/>
+      <IconPath Value="./"/>
+      <TargetFileExt Value=""/>
+      <Title Value="screenshot"/>
+      <ActiveEditorIndexAtStart Value="2"/>
+    </General>
+    <LazDoc Paths=""/>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IgnoreBinaries Value="False"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+        <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+      </local>
+    </RunParams>
+    <Units Count="32">
+      <Unit0>
+        <Filename Value="screenshot.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="screenshot"/>
+        <CursorPos X="22" Y="20"/>
+        <TopLine Value="2"/>
+        <EditorIndex Value="0"/>
+        <UsageCount Value="47"/>
+        <Loaded Value="True"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="magick_wand.pas"/>
+        <UnitName Value="magick_wand"/>
+        <CursorPos X="13" Y="49"/>
+        <TopLine Value="36"/>
+        <UsageCount Value="23"/>
+      </Unit1>
+      <Unit2>
+        <Filename Value="magick_type.inc"/>
+        <CursorPos X="41" Y="3"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="11"/>
+      </Unit2>
+      <Unit3>
+        <Filename Value="magick_image.inc"/>
+        <CursorPos X="24" Y="301"/>
+        <TopLine Value="301"/>
+        <UsageCount Value="20"/>
+      </Unit3>
+      <Unit4>
+        <Filename Value="drawing_wand.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="16"/>
+      </Unit4>
+      <Unit5>
+        <Filename Value="quantize.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit5>
+      <Unit6>
+        <Filename Value="home/felipe/Programas/imagemagick/magick/quantize.inc"/>
+        <CursorPos X="30" Y="25"/>
+        <TopLine Value="9"/>
+        <UsageCount Value="8"/>
+      </Unit6>
+      <Unit7>
+        <Filename Value="home/felipe/Programas/imagemagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="1" Y="26"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit7>
+      <Unit8>
+        <Filename Value="C:/Programas/ImageMagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="41" Y="26"/>
+        <TopLine Value="22"/>
+        <UsageCount Value="9"/>
+      </Unit8>
+      <Unit9>
+        <Filename Value="C:/Programas/ImageMagick/magick/magick_type.inc"/>
+        <CursorPos X="1" Y="303"/>
+        <TopLine Value="357"/>
+        <UsageCount Value="8"/>
+      </Unit9>
+      <Unit10>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="5" Y="31"/>
+        <TopLine Value="27"/>
+        <UsageCount Value="10"/>
+      </Unit10>
+      <Unit11>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/statistic.inc"/>
+        <CursorPos X="1" Y="46"/>
+        <TopLine Value="18"/>
+        <UsageCount Value="9"/>
+      </Unit11>
+      <Unit12>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/magick_type.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="9"/>
+      </Unit12>
+      <Unit13>
+        <Filename Value="pixel_wand.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="19"/>
+      </Unit13>
+      <Unit14>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/constitute.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit14>
+      <Unit15>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/effect.inc"/>
+        <CursorPos X="1" Y="19"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit15>
+      <Unit16>
+        <Filename Value="pixel_iterator.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="11"/>
+      </Unit16>
+      <Unit17>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/cache_view.inc"/>
+        <CursorPos X="25" Y="28"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit17>
+      <Unit18>
+        <Filename Value="magick_attribute.inc"/>
+        <CursorPos X="37" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="13"/>
+      </Unit18>
+      <Unit19>
+        <Filename Value="C:/Programas/PascalMagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="11" Y="13"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="12"/>
+      </Unit19>
+      <Unit20>
+        <Filename Value="C:/Programas/PascalMagick/magick/magick_type.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="12"/>
+      </Unit20>
+      <Unit21>
+        <Filename Value="C:/Programas/PascalMagick/magick/draw.inc"/>
+        <CursorPos X="22" Y="241"/>
+        <TopLine Value="236"/>
+        <UsageCount Value="9"/>
+      </Unit21>
+      <Unit22>
+        <Filename Value="C:/Programas/PascalMagick/magick/type.inc"/>
+        <CursorPos X="24" Y="63"/>
+        <TopLine Value="62"/>
+        <UsageCount Value="10"/>
+      </Unit22>
+      <Unit23>
+        <Filename Value="C:/Programas/PascalMagick/magick/pixel.inc"/>
+        <CursorPos X="24" Y="4"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="9"/>
+      </Unit23>
+      <Unit24>
+        <Filename Value="../magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <EditorIndex Value="3"/>
+        <UsageCount Value="14"/>
+        <Loaded Value="True"/>
+      </Unit24>
+      <Unit25>
+        <Filename Value="../magick/magick_type.inc"/>
+        <CursorPos X="7" Y="288"/>
+        <TopLine Value="82"/>
+        <UsageCount Value="12"/>
+      </Unit25>
+      <Unit26>
+        <Filename Value="../wand/pixel_iterator.inc"/>
+        <CursorPos X="26" Y="9"/>
+        <TopLine Value="9"/>
+        <UsageCount Value="10"/>
+      </Unit26>
+      <Unit27>
+        <Filename Value="../wand/magick_wand.pas"/>
+        <UnitName Value="magick_wand"/>
+        <CursorPos X="15" Y="48"/>
+        <TopLine Value="39"/>
+        <EditorIndex Value="1"/>
+        <UsageCount Value="10"/>
+        <Loaded Value="True"/>
+      </Unit27>
+      <Unit28>
+        <Filename Value="../wand/drawing_wand.inc"/>
+        <CursorPos X="56" Y="247"/>
+        <TopLine Value="226"/>
+        <UsageCount Value="10"/>
+      </Unit28>
+      <Unit29>
+        <Filename Value="../magick/type.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="24"/>
+        <UsageCount Value="10"/>
+      </Unit29>
+      <Unit30>
+        <Filename Value="../wand/magick_image.inc"/>
+        <CursorPos X="1" Y="396"/>
+        <TopLine Value="380"/>
+        <EditorIndex Value="4"/>
+        <UsageCount Value="10"/>
+        <Loaded Value="True"/>
+      </Unit30>
+      <Unit31>
+        <Filename Value="../wand/pixel_wand.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <EditorIndex Value="2"/>
+        <UsageCount Value="10"/>
+        <Loaded Value="True"/>
+      </Unit31>
+    </Units>
+    <JumpHistory Count="2" HistoryIndex="1">
+      <Position1>
+        <Filename Value="screenshot.lpr"/>
+        <Caret Line="20" Column="22" TopLine="2"/>
+      </Position1>
+      <Position2>
+        <Filename Value="../wand/magick_wand.pas"/>
+        <Caret Line="48" Column="15" TopLine="39"/>
+      </Position2>
+    </JumpHistory>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="5"/>
+    <SearchPaths>
+      <OtherUnitFiles Value="../magick/;../wand/"/>
+      <SrcPath Value="../magick/;../wand/"/>
+    </SearchPaths>
+    <CodeGeneration>
+      <Generate Value="Faster"/>
+    </CodeGeneration>
+    <Other>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Watches Count="4">
+      <Item1>
+        <Expression Value="GlassTop"/>
+        <Enabled Value="False"/>
+      </Item1>
+      <Item2>
+        <Expression Value="GlassLeft"/>
+        <Enabled Value="False"/>
+      </Item2>
+      <Item3>
+        <Expression Value="GlassHeight"/>
+        <Enabled Value="False"/>
+      </Item3>
+      <Item4>
+        <Expression Value="GlassWidth"/>
+        <Enabled Value="False"/>
+      </Item4>
+    </Watches>
+    <Exceptions Count="2">
+      <Item1>
+        <Name Value="ECodetoolError"/>
+      </Item1>
+      <Item2>
+        <Name Value="EFOpenError"/>
+      </Item2>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 270 - 0
packages/base/imagemagick/demo2/screenshot.lpi.bak

@@ -0,0 +1,270 @@
+<?xml version="1.0"?>
+<CONFIG>
+  <ProjectOptions>
+    <PathDelim Value="/"/>
+    <Version Value="5"/>
+    <General>
+      <MainUnit Value="0"/>
+      <IconPath Value="./"/>
+      <TargetFileExt Value=""/>
+      <Title Value="screenshot"/>
+      <ActiveEditorIndexAtStart Value="0"/>
+    </General>
+    <LazDoc Paths=""/>
+    <PublishOptions>
+      <Version Value="2"/>
+      <IgnoreBinaries Value="False"/>
+      <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+      <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
+    </PublishOptions>
+    <RunParams>
+      <local>
+        <FormatVersion Value="1"/>
+        <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+      </local>
+    </RunParams>
+    <Units Count="31">
+      <Unit0>
+        <Filename Value="screenshot.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="screenshot"/>
+        <CursorPos X="19" Y="16"/>
+        <TopLine Value="1"/>
+        <EditorIndex Value="0"/>
+        <UsageCount Value="47"/>
+        <Loaded Value="True"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="magick_wand.pas"/>
+        <UnitName Value="magick_wand"/>
+        <CursorPos X="13" Y="49"/>
+        <TopLine Value="36"/>
+        <UsageCount Value="23"/>
+      </Unit1>
+      <Unit2>
+        <Filename Value="magick_type.inc"/>
+        <CursorPos X="41" Y="3"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="11"/>
+      </Unit2>
+      <Unit3>
+        <Filename Value="magick_image.inc"/>
+        <CursorPos X="24" Y="301"/>
+        <TopLine Value="301"/>
+        <UsageCount Value="20"/>
+      </Unit3>
+      <Unit4>
+        <Filename Value="drawing_wand.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="16"/>
+      </Unit4>
+      <Unit5>
+        <Filename Value="quantize.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit5>
+      <Unit6>
+        <Filename Value="home/felipe/Programas/imagemagick/magick/quantize.inc"/>
+        <CursorPos X="30" Y="25"/>
+        <TopLine Value="9"/>
+        <UsageCount Value="8"/>
+      </Unit6>
+      <Unit7>
+        <Filename Value="home/felipe/Programas/imagemagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="1" Y="26"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit7>
+      <Unit8>
+        <Filename Value="C:/Programas/ImageMagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="41" Y="26"/>
+        <TopLine Value="22"/>
+        <UsageCount Value="9"/>
+      </Unit8>
+      <Unit9>
+        <Filename Value="C:/Programas/ImageMagick/magick/magick_type.inc"/>
+        <CursorPos X="1" Y="303"/>
+        <TopLine Value="357"/>
+        <UsageCount Value="8"/>
+      </Unit9>
+      <Unit10>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="5" Y="31"/>
+        <TopLine Value="27"/>
+        <UsageCount Value="10"/>
+      </Unit10>
+      <Unit11>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/statistic.inc"/>
+        <CursorPos X="1" Y="46"/>
+        <TopLine Value="18"/>
+        <UsageCount Value="9"/>
+      </Unit11>
+      <Unit12>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/magick_type.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="9"/>
+      </Unit12>
+      <Unit13>
+        <Filename Value="pixel_wand.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="19"/>
+      </Unit13>
+      <Unit14>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/constitute.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit14>
+      <Unit15>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/effect.inc"/>
+        <CursorPos X="1" Y="19"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit15>
+      <Unit16>
+        <Filename Value="pixel_iterator.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="11"/>
+      </Unit16>
+      <Unit17>
+        <Filename Value="home/felipe/Programas/PascalMagick/magick/cache_view.inc"/>
+        <CursorPos X="25" Y="28"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="8"/>
+      </Unit17>
+      <Unit18>
+        <Filename Value="magick_attribute.inc"/>
+        <CursorPos X="37" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="13"/>
+      </Unit18>
+      <Unit19>
+        <Filename Value="C:/Programas/PascalMagick/magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="11" Y="13"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="12"/>
+      </Unit19>
+      <Unit20>
+        <Filename Value="C:/Programas/PascalMagick/magick/magick_type.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="12"/>
+      </Unit20>
+      <Unit21>
+        <Filename Value="C:/Programas/PascalMagick/magick/draw.inc"/>
+        <CursorPos X="22" Y="241"/>
+        <TopLine Value="236"/>
+        <UsageCount Value="9"/>
+      </Unit21>
+      <Unit22>
+        <Filename Value="C:/Programas/PascalMagick/magick/type.inc"/>
+        <CursorPos X="24" Y="63"/>
+        <TopLine Value="62"/>
+        <UsageCount Value="10"/>
+      </Unit22>
+      <Unit23>
+        <Filename Value="C:/Programas/PascalMagick/magick/pixel.inc"/>
+        <CursorPos X="24" Y="4"/>
+        <TopLine Value="1"/>
+        <UsageCount Value="9"/>
+      </Unit23>
+      <Unit24>
+        <Filename Value="../magick/ImageMagick.pas"/>
+        <UnitName Value="ImageMagick"/>
+        <CursorPos X="14" Y="44"/>
+        <TopLine Value="32"/>
+        <UsageCount Value="14"/>
+      </Unit24>
+      <Unit25>
+        <Filename Value="../magick/magick_type.inc"/>
+        <CursorPos X="7" Y="288"/>
+        <TopLine Value="82"/>
+        <UsageCount Value="12"/>
+      </Unit25>
+      <Unit26>
+        <Filename Value="../wand/pixel_iterator.inc"/>
+        <CursorPos X="26" Y="9"/>
+        <TopLine Value="9"/>
+        <UsageCount Value="10"/>
+      </Unit26>
+      <Unit27>
+        <Filename Value="../wand/magick_wand.pas"/>
+        <UnitName Value="magick_wand"/>
+        <CursorPos X="17" Y="32"/>
+        <TopLine Value="16"/>
+        <UsageCount Value="10"/>
+      </Unit27>
+      <Unit28>
+        <Filename Value="../wand/drawing_wand.inc"/>
+        <CursorPos X="56" Y="247"/>
+        <TopLine Value="226"/>
+        <UsageCount Value="10"/>
+      </Unit28>
+      <Unit29>
+        <Filename Value="../magick/type.inc"/>
+        <CursorPos X="1" Y="1"/>
+        <TopLine Value="24"/>
+        <UsageCount Value="10"/>
+      </Unit29>
+      <Unit30>
+        <Filename Value="../wand/magick_image.inc"/>
+        <CursorPos X="1" Y="396"/>
+        <TopLine Value="380"/>
+        <EditorIndex Value="1"/>
+        <UsageCount Value="10"/>
+        <Loaded Value="True"/>
+      </Unit30>
+    </Units>
+    <JumpHistory Count="0" HistoryIndex="-1"/>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="5"/>
+    <SearchPaths>
+      <OtherUnitFiles Value="../magick/;../wand/"/>
+      <SrcPath Value="../magick/;../wand/"/>
+    </SearchPaths>
+    <CodeGeneration>
+      <Generate Value="Faster"/>
+    </CodeGeneration>
+    <Other>
+      <CompilerPath Value="$(CompPath)"/>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Watches Count="4">
+      <Item1>
+        <Expression Value="GlassTop"/>
+        <Enabled Value="False"/>
+      </Item1>
+      <Item2>
+        <Expression Value="GlassLeft"/>
+        <Enabled Value="False"/>
+      </Item2>
+      <Item3>
+        <Expression Value="GlassHeight"/>
+        <Enabled Value="False"/>
+      </Item3>
+      <Item4>
+        <Expression Value="GlassWidth"/>
+        <Enabled Value="False"/>
+      </Item4>
+    </Watches>
+    <Exceptions Count="2">
+      <Item1>
+        <Name Value="ECodetoolError"/>
+      </Item1>
+      <Item2>
+        <Name Value="EFOpenError"/>
+      </Item2>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 151 - 0
packages/base/imagemagick/demo2/screenshot.lpr

@@ -0,0 +1,151 @@
+{
+  Demonstration software for image resizing and screenshot using PascalMagick
+
+  Created by: Felipe Monteiro de Carvalho
+
+  This software takes a screenshot of the screen and enlarges it using anti-aliasing
+ or not depending on what the user select.
+
+  Notes: This software uses X11 to take the screenshot so it will only work on UNIXes
+
+  More information on this page:
+  http://wiki.lazarus.freepascal.org/index.php/PascalMagick
+
+  April/2006
+}
+program screenshot;
+
+{$mode objfpc}{$H+}
+
+uses SysUtils, magick_wand, ImageMagick, Unix;
+
+type
+  TCommand = (cmdQuit, cmdSample, cmdAntiAliase);
+
+{
+  Catches exceptions from ImageMagick
+}
+procedure ThrowWandException(wand: PMagickWand);
+var
+  description: PChar;
+  severity: ExceptionType;
+begin
+  description := MagickGetException(wand, @severity);
+  WriteLn(Format('An error ocurred. Description: %s', [description]));
+  description := MagickRelinquishMemory(description);
+  Abort;
+end;
+
+{
+  Shows the main screen
+}
+function MainScreen: TCommand;
+var
+  i: Integer;
+  Continuar: Boolean;
+begin
+  Continuar := False;
+
+  WriteLn('=========================================================');
+  WriteLn('         Welcome to PascalMagick demo software 2');
+  WriteLn('=========================================================');
+
+  while not Continuar do
+  begin
+    WriteLn('');
+    WriteLn('The following commands are available:');
+    WriteLn('   0 - Quit');
+    WriteLn('   1 - Capture screenshot and resize it to 2024x1536');
+    WriteLn('   2 - Same as #1 except that uses Anti-Aliasing');
+    Write(': ');
+    ReadLn(i);
+
+    case i of
+     0:
+     begin
+       Result := cmdQuit;
+       Continuar := True;
+     end;
+
+     1:
+     begin
+       Result := cmdSample;
+       Continuar := True;
+     end;
+
+     2:
+     begin
+       Result := cmdAntiAliase;
+       Continuar := True;
+     end;
+
+    else
+      WriteLn('Wrong Command!!');
+    end;
+  end;
+end;
+
+{
+  Main procedure
+}
+var
+  status: MagickBooleanType;
+  wand: PMagickWand;
+  TempDir, shellStr: string;
+  Antes: TTimeStamp;
+  Command: TCommand;
+begin
+  { Presentation screen and user options }
+
+  Command := MainScreen;
+
+  if Command = cmdQuit then Exit;
+
+
+  { Create the image }
+
+  Antes := DateTimeToTimeStamp(Now);
+
+  TempDir := GetTempDir(False);
+
+  shellStr := 'xwd -root -out ' + TempDir + 'display.xwd';
+
+  WriteLn(shellStr);
+
+  shell(shellStr);
+
+  { Read an image. }
+
+  MagickWandGenesis;
+
+  wand := NewMagickWand;
+
+  try
+    status := MagickReadImage(wand, PChar(TempDir + 'display.xwd'));
+    if (status = MagickFalse) then ThrowWandException(wand);
+
+    { Enlarge the Image }
+
+    WriteLn('Enlarging');
+
+    if Command = cmdAntiAliase then MagickResizeImage(wand, 2024, 1536, BoxFilter, 1.0)
+    else MagickSampleImage(wand, 2024, 1536);
+
+    WriteLn(IntToStr(DateTimeToTimeStamp(Now).Time - Antes.Time));
+
+    WriteLn('Saving');
+
+    { Write the image as MIFF and destroy it. }
+
+    status := MagickWriteImages(wand, PChar(TempDir + 'enlarged.jpg'), MagickTrue);
+    if (status = MagickFalse) then ThrowWandException(wand);
+
+    WriteLn(IntToStr(DateTimeToTimeStamp(Now).Time - Antes.Time));
+
+  finally
+    wand := DestroyMagickWand(wand);
+
+    MagickWandTerminus;
+  end;
+end.
+

+ 52 - 0
packages/base/imagemagick/magick/cache_view.inc

@@ -0,0 +1,52 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick Cache View Methods.
+}
+
+type
+  ViewInfo = record
+    image: PImage;
+
+    id: Cardinal;
+
+    signature: Cardinal;
+  end;
+  
+  PViewInfo = ^ViewInfo;
+
+{extern MagickExport const PixelPacket
+  *AcquireCacheView(const ViewInfo *,const long,const long,const unsigned long,
+    const unsigned long,ExceptionInfo *);
+
+extern MagickExport IndexPacket
+  *GetCacheViewIndexes(const ViewInfo *);
+
+extern MagickExport MagickBooleanType
+  SyncCacheView(ViewInfo *);
+
+extern MagickExport PixelPacket
+  *GetCacheViewPixels(const ViewInfo *),
+  *GetCacheView(ViewInfo *,const long,const long,const unsigned long,
+    const unsigned long),
+  *SetCacheView(ViewInfo *,const long,const long,const unsigned long,
+    const unsigned long);
+
+extern MagickExport ViewInfo
+  *OpenCacheView(Image *);
+
+extern MagickExport void
+  CloseCacheView(ViewInfo *);}
+

+ 44 - 0
packages/base/imagemagick/magick/compare.inc

@@ -0,0 +1,44 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick image compare methods.
+}
+
+//#include "magick/image.h"
+
+type
+ MetricType = (
+  UndefinedMetric,
+  MeanAbsoluteErrorMetric,
+  MeanSquaredErrorMetric,
+  PeakAbsoluteErrorMetric,
+  PeakSignalToNoiseRatioMetric,
+  RootMeanSquaredErrorMetric
+ );
+
+{extern MagickExport Image
+  *CompareImageChannels(Image *,const Image *,const ChannelType,
+    const MetricType,double *,ExceptionInfo *),
+  *CompareImages(Image *,const Image *,const MetricType,double *,
+    ExceptionInfo *);
+
+extern MagickExport MagickBooleanType
+  CompareImageCommand(ImageInfo *,int,char **,char **,ExceptionInfo *),
+  GetImageChannelDistortion(Image *,const Image *,const ChannelType,
+    const MetricType,double *,ExceptionInfo *),
+  GetImageDistortion(Image *,const Image *,const MetricType,double *,
+    ExceptionInfo *),
+  IsImagesEqual(Image *,const Image *);}
+

+ 45 - 0
packages/base/imagemagick/magick/constitute.inc

@@ -0,0 +1,45 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick image constitute methods.
+}
+
+type
+ StorageType = (
+  UndefinedPixel,
+  CharPixel,
+  DoublePixel,
+  FloatPixel,
+  IntegerPixel,
+  LongPixel,
+  QuantumPixel,
+  ShortPixel
+ );
+
+{extern MagickExport Image
+  *ConstituteImage(const unsigned long,const unsigned long,const char *,
+    const StorageType,const void *,ExceptionInfo *),
+  *PingImage(const ImageInfo *,ExceptionInfo *),
+  *ReadImage(const ImageInfo *,ExceptionInfo *),
+  *ReadInlineImage(const ImageInfo *,const char *,ExceptionInfo *);
+
+extern MagickExport MagickBooleanType
+  WriteImage(const ImageInfo *,Image *),
+  WriteImages(const ImageInfo *,Image *,const char *,ExceptionInfo *);
+
+extern MagickExport void
+  DestroyConstitute(void);}
+
+

+ 298 - 0
packages/base/imagemagick/magick/draw.inc

@@ -0,0 +1,298 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick drawing methods.
+}
+
+//#include "magick/type.h"
+
+type
+ AlignType = (
+  UndefinedAlign,
+  LeftAlign,
+  CenterAlign,
+  RightAlign
+ );
+
+type
+ ClipPathUnits = (
+  UndefinedPathUnits,
+  UserSpace,
+  UserSpaceOnUse,
+  ObjectBoundingBox
+ );
+
+type
+ DecorationType = (
+  UndefinedDecoration,
+  NoDecoration,
+  UnderlineDecoration,
+  OverlineDecoration,
+  LineThroughDecoration
+ );
+
+type
+ FillRule = (
+  UndefinedRule,
+//#undef EvenOddRule
+  EvenOddRule,
+  NonZeroRule
+ );
+
+type
+ GradientType = (
+  UndefinedGradient,
+  LinearGradient,
+  RadialGradient
+ );
+
+type
+ LineCap = (
+  UndefinedCap,
+  ButtCap,
+  RoundCap,
+  SquareCap
+ );
+
+type
+ LineJoin = (
+  UndefinedJoin,
+  MiterJoin,
+  RoundJoin,
+  BevelJoin
+ );
+
+type
+ PaintMethod = (
+  UndefinedMethod,
+  PointMethod,
+  ReplaceMethod,
+  FloodfillMethod,
+  FillToBorderMethod,
+  ResetMethod
+ );
+
+type
+ PrimitiveType = (
+  UndefinedPrimitive,
+  PointPrimitive,
+  LinePrimitive,
+  RectanglePrimitive,
+  RoundRectanglePrimitive,
+  ArcPrimitive,
+  EllipsePrimitive,
+  CirclePrimitive,
+  PolylinePrimitive,
+  PolygonPrimitive,
+  BezierPrimitive,
+  ColorPrimitive,
+  MattePrimitive,
+  TextPrimitive,
+  ImagePrimitive,
+  PathPrimitive
+ );
+
+type
+ ReferenceType = (
+  UndefinedReference,
+  GradientReference
+ );
+
+type
+ SpreadMethod = (
+  UndefinedSpread,
+  PadSpread,
+  ReflectSpead,
+  RepeatSpread
+ );
+
+type
+  GradientInfo = record
+    type_: GradientType;
+
+    color: PixelPacket;
+
+    stop: SegmentInfo;
+
+    length: Cardinal;
+
+    spread: SpreadMethod;
+
+    debug: MagickBooleanType;
+
+    signature: Cardinal;
+
+    previous, next: Pointer;
+{  struct _GradientInfo
+    *previous,
+    *next;}
+  end;
+
+type
+  ElementReference = record
+    id: PChar;
+
+    type_: ReferenceType;
+
+    gradient: GradientInfo;
+
+    signature: Cardinal;
+
+    previous, next: Pointer;
+{  struct _ElementReference
+    *previous,
+    *next;}
+  end;
+
+type
+  DrawInfo = record
+    primitive,
+    geometry: PChar;
+
+    viewbox: RectangleInfo;
+
+    affine: AffineMatrix;
+
+    gravity: GravityType;
+
+    fill,
+    stroke: PixelPacket;
+
+    stroke_width: double;
+
+    gradient: GradientInfo;
+
+    fill_pattern,
+    tile,
+    stroke_pattern: PImage;
+
+    stroke_antialias,
+    text_antialias: MagickBooleanType;
+
+    fill_rule: FillRule;
+
+    linecap_: LineCap;
+
+    linejoin_: LineJoin;
+
+    miterlimit: Cardinal;
+
+    dash_offset: double;
+
+    decorate: DecorationType;
+
+    compose: CompositeOperator;
+
+    text: PChar;
+
+    face: Cardinal;
+
+    font,
+    metrics,
+    family: PChar;
+
+    style: StyleType;
+
+    stretch: StretchType;
+
+    weight: Cardinal;
+    
+    encoding: PChar;
+
+    pointsize: double;
+
+    density: PChar;
+
+    align: AlignType;
+
+    undercolor,
+    border_color: PixelPacket;
+
+    server_name: PChar;
+
+    dash_pattern: Pdouble;
+
+    clip_path: PChar;
+
+    bounds: SegmentInfo;
+
+    clip_units: ClipPathUnits;
+
+    opacity: Quantum;
+
+    render: MagickBooleanType;
+
+    element_reference: ElementReference;
+
+    debug: MagickBooleanType;
+
+    signature: Cardinal;
+  end;
+  
+  PDrawInfo = ^DrawInfo;
+  
+  PPDrawInfo = ^PDrawInfo;
+
+type
+  PointInfo = record
+    x, y: double;
+  end;
+  
+  PPointInfo = ^PointInfo;
+
+type
+  PrimitiveInfo = record
+    point: PointInfo;
+
+    coordinates: Cardinal;
+
+    primitive: PrimitiveType;
+
+    method: PaintMethod;
+
+    text: PChar;
+  end;
+
+type
+  TypeMetric = record
+    pixels_per_em: PointInfo;
+
+    ascent,
+    descent,
+    width,
+    height,
+    max_advance,
+    underline_position,
+    underline_thickness: double;
+
+    bounds: SegmentInfo;
+  end;
+
+{extern MagickExport DrawInfo
+  *CloneDrawInfo(const ImageInfo *,const DrawInfo *),
+  *DestroyDrawInfo(DrawInfo *);
+
+extern MagickExport MagickBooleanType
+  DrawAffineImage(Image *,const Image *,const AffineMatrix *),
+  DrawClipPath(Image *,const DrawInfo *,const char *),
+  DrawImage(Image *,const DrawInfo *),
+  DrawPatternPath(Image *,const DrawInfo *,const char *,Image **),
+  DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *);
+
+extern MagickExport void
+  GetAffineMatrix(AffineMatrix *),
+  GetDrawInfo(const ImageInfo *,DrawInfo *);}
+
+

+ 71 - 0
packages/base/imagemagick/magick/effect.inc

@@ -0,0 +1,71 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick image effects methods.
+}
+
+type
+  NoiseType = ( 
+  UndefinedNoise,
+  UniformNoise,
+  GaussianNoise,
+  MultiplicativeGaussianNoise,
+  ImpulseNoise,
+  LaplacianNoise,
+  PoissonNoise
+ );
+
+{extern MagickExport Image
+  *AdaptiveThresholdImage(const Image *,const unsigned long,const unsigned long,    const long,ExceptionInfo *),
+  *AddNoiseImage(const Image *,const NoiseType,ExceptionInfo *),
+  *AddNoiseImageChannel(const Image *,const ChannelType,const NoiseType,
+    ExceptionInfo *),
+  *BlurImage(const Image *,const double,const double,ExceptionInfo *),
+  *BlurImageChannel(const Image *,const ChannelType,const double,const double,
+    ExceptionInfo *),
+  *DespeckleImage(const Image *,ExceptionInfo *),
+  *EdgeImage(const Image *,const double,ExceptionInfo *),
+  *EmbossImage(const Image *,const double,const double,ExceptionInfo *),
+  *GaussianBlurImage(const Image *,const double,const double,ExceptionInfo *),
+  *GaussianBlurImageChannel(const Image *,const ChannelType,const double,
+    const double,ExceptionInfo *),
+  *MedianFilterImage(const Image *,const double,ExceptionInfo *),
+  *MotionBlurImage(const Image *,const double,const double,const double,
+    ExceptionInfo *),
+  *PreviewImage(const Image *,const PreviewType,ExceptionInfo *),
+  *RadialBlurImage(const Image *,const double,ExceptionInfo *),
+  *RadialBlurImageChannel(const Image *,const ChannelType,const double,
+    ExceptionInfo *),
+  *ReduceNoiseImage(const Image *,const double,ExceptionInfo *),
+  *ShadeImage(const Image *,const MagickBooleanType,const double,const double,
+    ExceptionInfo *),
+  *SharpenImage(const Image *,const double,const double,ExceptionInfo *),
+  *SharpenImageChannel(const Image *,const ChannelType,const double,
+    const double,ExceptionInfo *),
+  *SpreadImage(const Image *,const double,ExceptionInfo *),
+  *UnsharpMaskImage(const Image *,const double,const double,const double,
+    const double,ExceptionInfo *),
+  *UnsharpMaskImageChannel(const Image *,const ChannelType,const double,
+    const double,const double,const double,ExceptionInfo *);
+
+extern MagickExport MagickBooleanType
+  BlackThresholdImage(Image *,const char *),
+  BilevelImage(Image *,const double),
+  BilevelImageChannel(Image *,const ChannelType,const double),
+  RandomThresholdImage(Image *,const char *,ExceptionInfo *),
+  RandomThresholdImageChannel(Image *,const ChannelType,const char *,
+    ExceptionInfo *),
+  WhiteThresholdImage(Image *,const char *);}
+

+ 63 - 0
packages/base/imagemagick/magick/fx.inc

@@ -0,0 +1,63 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick image f/x methods.
+}
+
+type
+ MagickEvaluateOperator = (
+  UndefinedEvaluateOperator,
+  AddEvaluateOperator,
+  AndEvaluateOperator,
+  DivideEvaluateOperator,
+  LeftShiftEvaluateOperator,
+  MaxEvaluateOperator,
+  MinEvaluateOperator,
+  MultiplyEvaluateOperator,
+  OrEvaluateOperator,
+  RightShiftEvaluateOperator,
+  SetEvaluateOperator,
+  SubtractEvaluateOperator,
+  XorEvaluateOperator
+ );
+
+{extern MagickExport Image
+  *CharcoalImage(const Image *,const double,const double,ExceptionInfo *),
+  *ColorizeImage(const Image *,const char *,const PixelPacket,ExceptionInfo *),
+  *ConvolveImage(const Image *,const unsigned long,const double *,
+    ExceptionInfo *),
+  *ConvolveImageChannel(const Image *,const ChannelType,const unsigned long,
+    const double *,ExceptionInfo *),
+  *FxImage(const Image *,const char *,ExceptionInfo *),
+  *FxImageChannel(const Image *,const ChannelType,const char *,ExceptionInfo *),
+  *ImplodeImage(const Image *,const double,ExceptionInfo *),
+  *MorphImages(const Image *,const unsigned long,ExceptionInfo *),
+  *OilPaintImage(const Image *,const double,ExceptionInfo *),
+  *SepiaToneImage(const Image *,const double,ExceptionInfo *),
+  *ShadowImage(const Image *,const double,const double,const long,const long,
+    ExceptionInfo *),
+  *SteganoImage(const Image *,const Image *,ExceptionInfo *),
+  *StereoImage(const Image *,const Image *,ExceptionInfo *),
+  *SwirlImage(const Image *,double,ExceptionInfo *),
+  *TintImage(const Image *,const char *,const PixelPacket,ExceptionInfo *),
+  *WaveImage(const Image *,const double,const double,ExceptionInfo *);
+
+extern MagickExport MagickBooleanType
+  EvaluateImage(Image *,const MagickEvaluateOperator,const double,
+    ExceptionInfo *),
+  EvaluateImageChannel(Image *,const ChannelType,const MagickEvaluateOperator,
+    const double,ExceptionInfo *),
+  SolarizeImage(Image *,const double);}
+

+ 115 - 0
packages/base/imagemagick/magick/imagemagick.pas

@@ -0,0 +1,115 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick Application Programming Interface declarations.
+  
+  Converted from c by: Felipe Monteiro de Carvalho Dez/2005
+}
+{Version 0.2}
+unit ImageMagick;
+
+{$ifdef FPC}
+  {$mode objfpc}
+{$endif}
+
+interface
+
+uses SysUtils;
+
+{$PACKRECORDS C}
+{$MINENUMSIZE 1}
+
+const
+{$ifdef Win32}
+  WandExport = 'CORE_RL_wand_.dll';
+{$else}
+  WandExport = 'libWand';
+{$endif}
+
+{# include "magick/methods.h"
+#endif}
+{$include magick_type.inc}
+{$include type.inc}
+
+{#$include animate.inc}
+{#$include annotate.inc}
+{#$include attribute.inc}
+{#$include blob.inc}
+{#$include cache.inc}
+{$include cache_view.inc}
+{#include "magick/coder.h"
+#include "magick/client.h"
+#include "magick/color.h"
+#include "magick/colorspace.h"}
+{$include compare.inc}
+{#include "magick/composite.h"
+#include "magick/compress.h"
+#include "magick/configure.h"
+#include "magick/conjure.h"}
+{$include constitute.inc}
+{#include "magick/convert.h"
+#include "magick/decorate.h"
+#include "magick/delegate.h"
+#include "magick/deprecate.h"
+#include "magick/display.h"}
+{$include draw.inc}
+{$include effect.inc}
+{#include "magick/enhance.h"
+#include "magick/exception.h"}
+{$include fx.inc}
+{#include "magick/gem.h"
+#include "magick/geometry.h"
+#include "magick/hashmap.h"
+#include "magick/identify.h"
+#include "magick/image.h"
+#include "magick/import.h"
+#include "magick/list.h"
+#include "magick/locale_.h"
+#include "magick/log.h"
+#include "magick/magic.h"
+#include "magick/magick.h"
+#include "magick/memory_.h"
+#include "magick/module.h"
+#include "magick/mogrify.h"
+#include "magick/monitor.h"
+#include "magick/montage.h"
+#include "magick/option.h"
+#include "magick/paint.h"}
+{$include pixel.inc}
+{#include "magick/prepress.h"
+#include "magick/profile.h"}
+{$include quantize.inc}
+{#include "magick/quantum.h"
+#include "magick/registry.h"
+#include "magick/random_.h"
+#include "magick/resize.h"
+#include "magick/resource_.h"
+#include "magick/segment.h"
+#include "magick/shear.h"
+#include "magick/signature.h"
+#include "magick/splay-tree.h"
+#include "magick/stream.h"}
+{$include statistic.inc}
+{#include "magick/string_.h"
+#include "magick/timer.h"
+#include "magick/token.h"
+#include "magick/transform.h"
+#include "magick/utility.h"
+#include "magick/version.h"
+#include "magick/xwindow.h"}
+
+implementation
+
+end.

+ 635 - 0
packages/base/imagemagick/magick/magick_type.inc

@@ -0,0 +1,635 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick structure members.
+
+  NOTE: This is a simplifyed version of magick/magick-type.h
+}
+
+const MaxTextExtent = 4096;
+
+const
+  MagickFalse = 0;
+  MagickTrue = 1;
+
+type
+  MagickBooleanType = Byte;
+
+  PMagickBooleanType = ^MagickBooleanType;
+
+//#include "magick/semaphore.h"
+
+{
+  The Quantum Depth was fixed at 16 to make the code simpler
+
+  In the future there is the possibility to go to the c bindings
+ and implement the variable QuantumDepth here
+}
+const
+  QuantumDepth = 16;
+
+{$define QuantumLeap}
+
+const
+  MagickEpsilon = 1.0E-10;
+  MaxColormapSize = 65536;
+  MaxMap = 65535;
+  QuantumFormat = '%u';
+  QuantumRange = 65535;
+
+type
+  MagickRealType = double;
+  Quantum = Word;
+
+{
+  Type declarations.
+}
+type
+  MagickStatusType = Word;
+  MagickOffsetType = Int64;
+  MagickSizeType = Int64;
+
+const
+  UndefinedChannel = 0;
+  RedChannel = $0001;
+  GrayChannel = $0001;
+  CyanChannel = $0001;
+  GreenChannel = $0002;
+  MagentaChannel = $0002;
+  BlueChannel = $0004;
+  YellowChannel = $0004;
+  AlphaChannel = $0008;
+  OpacityChannel = $0008;
+  MatteChannel = $0008;  // deprecated
+  BlackChannel = $0020;
+  IndexChannel = $0020;
+  AllChannels = $ff;
+  
+type
+  ChannelType = Byte;
+
+  PChannelType = ^ChannelType;
+
+type
+ ClassType = (
+  UndefinedClass,
+  DirectClass,
+  PseudoClass
+ );
+
+  PClassType = ^ClassType;
+
+type
+ ColorspaceType = (
+  UndefinedColorspace,
+  RGBColorspace,
+  GRAYColorspace,
+  TransparentColorspace,
+  OHTAColorspace,
+  LABColorspace,
+  XYZColorspace,
+  YCbCrColorspace,
+  YCCColorspace,
+  YIQColorspace,
+  YPbPrColorspace,
+  YUVColorspace,
+  CMYKColorspace,
+  sRGBColorspace,
+  HSBColorspace,
+  HSLColorspace,
+  HWBColorspace,
+  Rec601LumaColorspace,
+  Rec709LumaColorspace,
+  LogColorspace
+ );
+
+  PColorspaceType = ^ColorspaceType;
+
+type
+ CompositeOperator = (
+  UndefinedCompositeOp,
+  NoCompositeOp,
+  AddCompositeOp,
+  AtopCompositeOp,
+  BlendCompositeOp,
+  BumpmapCompositeOp,
+  ClearCompositeOp,
+  ColorBurnCompositeOp,
+  ColorDodgeCompositeOp,
+  ColorizeCompositeOp,
+  CopyBlackCompositeOp,
+  CopyBlueCompositeOp,
+  CopyCompositeOp,
+  CopyCyanCompositeOp,
+  CopyGreenCompositeOp,
+  CopyMagentaCompositeOp,
+  CopyOpacityCompositeOp,
+  CopyRedCompositeOp,
+  CopyYellowCompositeOp,
+  DarkenCompositeOp,
+  DstAtopCompositeOp,
+  DstCompositeOp,
+  DstInCompositeOp,
+  DstOutCompositeOp,
+  DstOverCompositeOp,
+  DifferenceCompositeOp,
+  DisplaceCompositeOp,
+  DissolveCompositeOp,
+  ExclusionCompositeOp,
+  HardLightCompositeOp,
+  HueCompositeOp,
+  InCompositeOp,
+  LightenCompositeOp,
+  LuminizeCompositeOp,
+  MinusCompositeOp,
+  ModulateCompositeOp,
+  MultiplyCompositeOp,
+  OutCompositeOp,
+  OverCompositeOp,
+  OverlayCompositeOp,
+  PlusCompositeOp,
+  ReplaceCompositeOp,
+  SaturateCompositeOp,
+  ScreenCompositeOp,
+  SoftLightCompositeOp,
+  SrcAtopCompositeOp,
+  SrcCompositeOp,
+  SrcInCompositeOp,
+  SrcOutCompositeOp,
+  SrcOverCompositeOp,
+  SubtractCompositeOp,
+  ThresholdCompositeOp,
+  XorCompositeOp
+ );
+
+  PCompositeOperator = ^CompositeOperator;
+
+type
+ CompressionType = (
+  UndefinedCompression,
+  NoCompression,
+  BZipCompression,
+  FaxCompression,
+  Group4Compression,
+  JPEGCompression,
+  JPEG2000Compression,
+  LosslessJPEGCompression,
+  LZWCompression,
+  RLECompression,
+  ZipCompression
+ );
+
+  PCompressionType = ^CompressionType;
+  
+const
+  UnrecognizedDispose = 0;
+  UndefinedDispose = 0;
+  NoneDispose = 1;
+  BackgroundDispose = 2;
+  PreviousDispose = 3;
+
+type
+  DisposeType = Byte;
+
+  PDisposeType = ^DisposeType;
+  
+type
+ EndianType = (
+  UndefinedEndian,
+  LSBEndian,
+  MSBEndian
+ );
+
+  PEndianType = ^EndianType;
+
+const
+  UndefinedException = 0;
+  WarningException = 300;
+  ResourceLimitWarning = 300;
+  TypeWarning = 305;
+  OptionWarning = 310;
+  DelegateWarning = 315;
+  MissingDelegateWarning = 320;
+  CorruptImageWarning = 325;
+  FileOpenWarning = 330;
+  BlobWarning = 335;
+  StreamWarning = 340;
+  CacheWarning = 345;
+  CoderWarning = 350;
+  ModuleWarning = 355;
+  DrawWarning = 360;
+  ImageWarning = 365;
+  WandWarning = 370;
+  XServerWarning = 380;
+  MonitorWarning = 385;
+  RegistryWarning = 390;
+  ConfigureWarning = 395;
+  ErrorException = 400;
+  ResourceLimitError = 400;
+  TypeError = 405;
+  OptionError = 410;
+  DelegateError = 415;
+  MissingDelegateError = 420;
+  CorruptImageError = 425;
+  FileOpenError = 430;
+  BlobError = 435;
+  StreamError = 440;
+  CacheError = 445;
+  CoderError = 450;
+  ModuleError = 455;
+  DrawError = 460;
+  ImageError = 465;
+  WandError = 470;
+  XServerError = 480;
+  MonitorError = 485;
+  RegistryError = 490;
+  ConfigureError = 495;
+  FatalErrorException = 700;
+  ResourceLimitFatalError = 700;
+  TypeFatalError = 705;
+  OptionFatalError = 710;
+  DelegateFatalError = 715;
+  MissingDelegateFatalError = 720;
+  CorruptImageFatalError = 725;
+  FileOpenFatalError = 730;
+  BlobFatalError = 735;
+  StreamFatalError = 740;
+  CacheFatalError = 745;
+  CoderFatalError = 750;
+  ModuleFatalError = 755;
+  DrawFatalError = 760;
+  ImageFatalError = 765;
+  WandFatalError = 770;
+  XServerFatalError = 780;
+  MonitorFatalError = 785;
+  RegistryFatalError = 790;
+  ConfigureFatalError = 795;
+  
+type
+  ExceptionType = Word;
+  
+  PExceptionType = ^ExceptionType;
+
+type
+ FilterTypes = (
+  UndefinedFilter,
+  PointFilter,
+  BoxFilter,
+  TriangleFilter,
+  HermiteFilter,
+  HanningFilter,
+  HammingFilter,
+  BlackmanFilter,
+  GaussianFilter,
+  QuadraticFilter,
+  CubicFilter,
+  CatromFilter,
+  MitchellFilter,
+  LanczosFilter,
+  BesselFilter,
+  SincFilter
+ );
+
+  PFilterTypes = ^FilterTypes;
+
+const
+  UndefinedGravity = 0;
+  ForgetGravity = 0;
+  NorthWestGravity = 1;
+  NorthGravity = 2;
+  NorthEastGravity = 3;
+  WestGravity = 4;
+  CenterGravity = 5;
+  EastGravity = 6;
+  SouthWestGravity = 7;
+  SouthGravity = 8;
+  SouthEastGravity = 9;
+  StaticGravity = 10;
+
+type
+  GravityType = Byte;
+
+  PGravityType = ^GravityType;
+
+type ImageType = (
+  UndefinedType,
+  BilevelType,
+  GrayscaleType,
+  GrayscaleMatteType,
+  PaletteType,
+  PaletteMatteType,
+  TrueColorType,
+  TrueColorMatteType,
+  ColorSeparationType,
+  ColorSeparationMatteType,
+  OptimizeType
+ );
+
+  PImageType = ^ImageType;
+
+type
+ InterlaceType = (
+  UndefinedInterlace,
+  NoInterlace,
+  LineInterlace,
+  PlaneInterlace,
+  PartitionInterlace
+ );
+
+  PInterlaceType = ^InterlaceType;
+
+type
+ OrientationType = (
+  UndefinedOrientation,
+  TopLeftOrientation,
+  TopRightOrientation,
+  BottomRightOrientation,
+  BottomLeftOrientation,
+  LeftTopOrientation,
+  RightTopOrientation,
+  RightBottomOrientation,
+  LeftBottomOrientation
+ );
+
+  POrientationType = ^OrientationType;
+
+type PreviewType = (
+  UndefinedPreview,
+  RotatePreview,
+  ShearPreview,
+  RollPreview,
+  HuePreview,
+  SaturationPreview,
+  BrightnessPreview,
+  GammaPreview,
+  SpiffPreview,
+  DullPreview,
+  GrayscalePreview,
+  QuantizePreview,
+  DespecklePreview,
+  ReduceNoisePreview,
+  AddNoisePreview,
+  SharpenPreview,
+  BlurPreview,
+  ThresholdPreview,
+  EdgeDetectPreview,
+  SpreadPreview,
+  SolarizePreview,
+  ShadePreview,
+  RaisePreview,
+  SegmentPreview,
+  SwirlPreview,
+  ImplodePreview,
+  WavePreview,
+  OilPaintPreview,
+  CharcoalDrawingPreview,
+  JPEGPreview
+ );
+
+  PPreviewType = ^PreviewType;
+
+type RenderingIntent = (
+  UndefinedIntent,
+  SaturationIntent,
+  PerceptualIntent,
+  AbsoluteIntent,
+  RelativeIntent
+ );
+
+  PRenderingIntent = ^RenderingIntent;
+
+type ResolutionType = (
+  UndefinedResolution,
+  PixelsPerInchResolution,
+  PixelsPerCentimeterResolution
+ );
+
+  PResolutionType = ^ResolutionType;
+
+type TimerState = (
+  UndefinedTimerState,
+  StoppedTimerState,
+  RunningTimerState
+ );
+
+  PTimerState = ^TimerState;
+
+type
+  AffineMatrix = record
+    sx, rx, ry, sy, tx, ty: double;
+  end;
+  
+  PAffineMatrix = ^AffineMatrix;
+
+type
+ IndexPacket = Quantum;
+
+type
+  PixelPacket = record
+{$ifdef WORDS_BIGENDIAN}
+   red, green, blue, opacity: Quantum;
+{$else}
+   blue, green, red, opacity: Quantum;
+{$endif}
+  end;
+  
+  PPixelPacket = ^PixelPacket;
+
+type
+  ColorPacket = record
+   pixel: PixelPacket;
+   index: IndexPacket;
+   count: Cardinal;
+  end;
+  
+  PColorPacket = ^ColorPacket;
+
+type
+  ErrorInfo = record
+   mean_error_per_pixel, normalized_mean_error, normalized_maximum_error: double;
+  end;
+
+type
+  PrimaryInfo = record
+   x, y, z: double;
+  end;
+
+type 
+  ProfileInfo = record
+   name: PChar;
+   length: Integer;
+   info: PChar;
+   signature: Cardinal;
+  end;
+  
+  PProfileInfo = ^ProfileInfo;
+
+type 
+  RectangleInfo = record
+   width, height: Cardinal;
+   x, y: Cardinal;
+  end;
+
+type
+  SegmentInfo = record
+   x1, y1, x2, y2: double;
+  end;
+
+type
+  Timer = record
+   start, stop, total: double;
+  end;
+  
+  PTimer = ^Timer;
+
+type
+  TimerInfo = record
+   user, elapsed: Timer;
+   state: TimerState;
+   signature: Cardinal;
+  end;
+  
+  PTimerInfo = ^TimerInfo;
+
+type
+  ChromaticityInfo = record
+   red_primary, green_primary, blue_primary, white_point: PrimaryInfo;
+ end;
+
+type
+  ExceptionInfo = record
+   severity: ExceptionType;
+   error_number: Shortint;
+   reason, description: PChar;
+   signature: Cardinal;
+  end;
+  
+  PExceptionInfo = ^ExceptionInfo;
+
+//typedef struct _Ascii85Info _Ascii85Info_;
+
+//typedef struct _BlobInfo _BlobInfo_;
+
+type
+  MagickProgressMonitor = function (const str: PChar; const para: MagickOffsetType;
+   const sizetype: MagickSizeType; param: Pointer): PMagickBooleanType;
+
+type
+  Image = record
+   storage_class: ClassType;
+   colorspace: ColorspaceType;
+   compression: CompressionType;
+   quality: Cardinal;
+   orientation: OrientationType;
+   taint, matte: MagickBooleanType;
+   columns, rows, depth, colors: Cardinal;
+   colormap: PPixelPacket;
+   background_color, border_color, matte_color: PixelPacket;
+   gamma: double;
+   chromaticity: ChromaticityInfo;
+   rendering_intent: RenderingIntent;
+   profiles: Pointer;
+   units: ResolutionType;
+   montage, directory, geometry: PChar;
+   offset: Integer;
+   x_resolution, y_resolution: double;
+   page, extract_info, tile_info: RectangleInfo;  // deprecated
+   bias, blur, fuzz: double;
+   filter: FilterTypes;
+   interlace: InterlaceType;
+   endian: EndianType;
+   gravity: GravityType;
+   compose: CompositeOperator;
+   dispose: DisposeType;
+   clip_mask: Pointer; // PImage
+   scene, delay, iterations, total_colors: Cardinal;
+   start_loop: Integer;
+   error: ErrorInfo;
+   timer: TimerInfo;
+   progress_monitor: MagickProgressMonitor;
+   client_data: Pointer;
+   cache: Pointer;
+   attributes: Pointer;
+   ascii85: Pointer; //_Ascii85Info_
+   blob: Pointer; // _BlobInfo_
+   filename, magick_filename, magick: array[1..MaxTextExtent] of char;
+   magick_columns, magick_rows: Integer;
+   exception: ExceptionInfo;
+   debug: MagickBooleanType;
+   reference_count: Integer;
+   semaphore: Pointer; //PSemaphoreInfo;
+   color_profile, iptc_profile: ProfileInfo;
+   generic_profile: PProfileInfo;
+   generic_profiles: Cardinal;  // this & ProfileInfo is deprecated
+   signature: Cardinal;
+   previous, list, next: Pointer;
+{  struct _Image
+    *previous,
+    *list,
+    *next;}
+ end;
+ 
+ PImage = ^Image;
+
+//type
+//  size_t = PStreamHandler(procedure (const image: PImage;
+//   const param: Pointer; const) );
+
+type
+  ImageInfo = record
+   compression: CompressionType;
+   orientation: OrientationType;
+   temporary, adjoin, affirm, antialias: MagickBooleanType;
+   size, extract, page, scenes: PChar;
+   scene, number_scenes, depth: Cardinal;
+   interlace: InterlaceType;
+   endian: EndianType;
+   units: ResolutionType;
+   quality: Cardinal;
+   sampling_factor, server_name, font, texture, density: PChar;
+   pointsize, fuzz: double;
+   background_color, border_color, matte_color: PixelPacket;
+   dither, monochrome: MagickBooleanType;
+   colors: Cardinal;
+   colorspace: ColorspaceType;
+   type_: ImageType ;
+   preview_type: PreviewType;
+   group: Integer;
+   ping, verbose: MagickBooleanType;
+   view, authenticate: PChar;
+   channel: ChannelType;
+   attributes: PImage;
+   options: Pointer;
+   progress_monitor: MagickProgressMonitor;
+   client_data, cache: Pointer;
+   stream: Cardinal; //StreamHandler;
+   file_: Pointer; // *file
+   blob: Pointer;
+   length: Integer;
+   magick, unique, zero, filename: array[1..MaxTextExtent] of char;
+   debug: MagickBooleanType;
+
+  {
+    Deprecated.
+  }
+   tile: PChar;
+   subimage, subrange: Cardinal;
+   pen: PixelPacket;
+   signature: Cardinal;
+ end;
+
+  PImageInfo = ^ImageInfo;
+
+

+ 82 - 0
packages/base/imagemagick/magick/pixel.inc

@@ -0,0 +1,82 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick image constitute methods.
+}
+
+//#include <magick/constitute.h>
+
+type
+  QuantumType = (
+  UndefinedQuantum,
+  AlphaQuantum,
+  BlackQuantum,
+  BlueQuantum,
+  CMYKAQuantum,
+  CMYKQuantum,
+  CyanQuantum,
+  GrayAlphaQuantum,
+  GrayQuantum,
+  GreenQuantum,
+  IndexAlphaQuantum,
+  IndexQuantum,
+  MagentaQuantum,
+  OpacityQuantum,
+  RedQuantum,
+  RGBAQuantum,
+  RGBOQuantum,
+  RGBQuantum,
+  YellowQuantum,
+  GrayPadQuantum,
+  RGBPadQuantum
+ );
+
+type
+  LongPixelPacket = record
+    red,
+    green,
+    blue,
+    opacity,
+    index: Cardinal;
+  end;
+
+type
+  MagickPixelPacket = record
+    colorspace: ColorspaceType;
+
+    matte: MagickBooleanType;
+
+    fuzz: double;
+
+    depth: Cardinal;
+
+    red,
+    green,
+    blue,
+    opacity,
+    index: MagickRealType;
+  end;
+
+  PMagickPixelPacket = ^MagickPixelPacket;
+
+{extern MagickExport MagickBooleanType
+  ExportImagePixels(const Image *,const long,const long,const unsigned long,
+    const unsigned long,const char *,const StorageType,void *,ExceptionInfo *),
+  ExportQuantumPixels(Image *,const QuantumType,const size_t,
+    const unsigned char *),
+  ImportImagePixels(Image *,const long,const long,const unsigned long,
+    const unsigned long,const char *,const StorageType,const void *),
+  ImportQuantumPixels(Image *,const QuantumType,const size_t,unsigned char *);}
+

+ 49 - 0
packages/base/imagemagick/magick/quantize.inc

@@ -0,0 +1,49 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick image quantization methods.
+}
+
+type
+  QuantizeInfo = record
+    number_colors: Cardinal;
+
+    tree_depth: Cardinal;
+
+    dither: MagickBooleanType;
+
+    colorspace: ColorspaceType;
+
+    measure_error: MagickBooleanType;
+
+    signature: Cardinal;
+  end;
+
+{extern MagickExport MagickBooleanType
+  GetImageQuantizeError(Image *),
+  MapImage(Image *,const Image *,const MagickBooleanType),
+  MapImages(Image *,const Image *,const MagickBooleanType),
+  OrderedDitherImage(Image *),
+  PosterizeImage(Image *,const unsigned long,const MagickBooleanType),
+  QuantizeImage(const QuantizeInfo *,Image *),
+  QuantizeImages(const QuantizeInfo *,Image *);
+
+extern MagickExport QuantizeInfo
+  *CloneQuantizeInfo(const QuantizeInfo *),
+  *DestroyQuantizeInfo(QuantizeInfo *);
+
+extern MagickExport void
+  CompressImageColormap(Image *),
+  GetQuantizeInfo(QuantizeInfo *);}

+ 37 - 0
packages/base/imagemagick/magick/semaphore.inc

@@ -0,0 +1,37 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick methods to lock and unlock semaphores.
+}
+#ifndef _MAGICK_SEMAPHORE_H
+#define _MAGICK_SEMAPHORE_H
+#endif
+
+typedef struct SemaphoreInfo
+  SemaphoreInfo;
+
+extern MagickExport MagickBooleanType
+  LockSemaphoreInfo(SemaphoreInfo *),
+  UnlockSemaphoreInfo(SemaphoreInfo *);
+
+extern MagickExport SemaphoreInfo
+  *AllocateSemaphoreInfo(void),
+  *DestroySemaphoreInfo(SemaphoreInfo *);
+
+extern MagickExport void
+  AcquireSemaphoreInfo(SemaphoreInfo **),
+  DestroySemaphore(void),
+  InitializeSemaphore(void),
+  RelinquishSemaphoreInfo(SemaphoreInfo *);

+ 53 - 0
packages/base/imagemagick/magick/statistic.inc

@@ -0,0 +1,53 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick image methods.
+}
+
+type
+  ChannelStatistics = record
+    depth: Cardinal;
+
+    minima, maxima: Quantum;
+
+    mean, standard_deviation: double;
+
+    scale: Cardinal;
+  end;
+  
+  PChannelStatistics = ^ChannelStatistics;
+
+{extern MagickExport ChannelStatistics
+  *GetImageChannelStatistics(const Image *,ExceptionInfo *);
+
+extern MagickExport MagickBooleanType
+  GetImageChannelExtrema(const Image *,const ChannelType,unsigned long *,
+    unsigned long *,ExceptionInfo *),
+  GetImageExtrema(const Image *,unsigned long *,unsigned long *,
+    ExceptionInfo *),
+  GetImageChannelMean(const Image *,const ChannelType,double *,double *,
+    ExceptionInfo *),
+  GetImageMean(const Image *,double *,double *,ExceptionInfo *),
+  SetImageChannelDepth(Image *,const ChannelType,const unsigned long),
+  SetImageDepth(Image *,const unsigned long);
+
+extern MagickExport RectangleInfo
+  GetImageBoundingBox(const Image *,ExceptionInfo *exception);
+
+extern MagickExport unsigned long
+  GetImageChannelDepth(const Image *,const ChannelType,ExceptionInfo *),
+  GetImageDepth(const Image *,ExceptionInfo *),
+  GetImageQuantumDepth(const Image *,const MagickBooleanType);}
+

+ 88 - 0
packages/base/imagemagick/magick/type.inc

@@ -0,0 +1,88 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick image type methods.
+}
+
+type
+ StretchType = (
+  UndefinedStretch,
+  NormalStretch,
+  UltraCondensedStretch,
+  ExtraCondensedStretch,
+  CondensedStretch,
+  SemiCondensedStretch,
+  SemiExpandedStretch,
+  ExpandedStretch,
+  ExtraExpandedStretch,
+  UltraExpandedStretch,
+  AnyStretch
+ );
+
+type
+ StyleType = (
+  UndefinedStyle,
+  NormalStyle,
+  ItalicStyle,
+  ObliqueStyle,
+  AnyStyle
+ );
+
+type
+  TypeInfo = record
+    face: Cardinal;
+
+    path,
+    name,
+    description,
+    family: PChar;
+
+    style: StyleType;
+
+    stretch: StretchType;
+
+    weight: Cardinal;
+
+    encoding,
+    foundry,
+    format,
+    metrics,
+    glyphs: PChar;
+
+    stealth: MagickBooleanType;
+
+    previous, next: Pointer;
+{  struct _TypeInfo
+    *previous,
+    *next;  /* deprecated, use GetTypeInfoList() */}
+
+    signature: Cardinal;
+  end;
+
+{function GetTypeList(const char *,unsigned long *,ExceptionInfo *): PPChar; external MagickExport;
+
+extern MagickExport MagickBooleanType
+  ListTypeInfo(FILE *,ExceptionInfo *);
+
+extern MagickExport const TypeInfo
+  *GetTypeInfo(const char *,ExceptionInfo *),
+  *GetTypeInfoByFamily(const char *,const StyleType,const StretchType,
+    const unsigned long,ExceptionInfo *),
+  **GetTypeInfoList(const char *,unsigned long *,ExceptionInfo *);
+
+MagickExport void
+  DestroyTypeList(void);}
+
+

+ 283 - 0
packages/base/imagemagick/wand/drawing_wand.inc

@@ -0,0 +1,283 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick drawing wand API.
+}
+
+{
+  Declaration from drawing-wand.c
+}
+type
+ PathOperation = (
+  PathDefaultOperation,
+  PathCloseOperation,                        // Z|z (none) */
+  PathCurveToOperation,                      // C|c (x1 y1 x2 y2 x y)+ */
+  PathCurveToQuadraticBezierOperation,       // Q|q (x1 y1 x y)+ */
+  PathCurveToQuadraticBezierSmoothOperation, // T|t (x y)+ */
+  PathCurveToSmoothOperation,                // S|s (x2 y2 x y)+ */
+  PathEllipticArcOperation,                  // A|a (rx ry x-axis-rotation large-arc-flag sweep-flag x y)+ */
+  PathLineToHorizontalOperation,             // H|h x+ */
+  PathLineToOperation,                       // L|l (x y)+ */
+  PathLineToVerticalOperation,               // V|v y+ */
+  PathMoveToOperation                        // M|m (x y)+ */
+ );
+
+type
+ PathMode = (
+  DefaultPathMode,
+  AbsolutePathMode,
+  RelativePathMode
+ );
+
+  DrawingWand = record
+    id: Cardinal;
+
+    name: array[0..MaxTextExtent] of Char;
+
+    { Support structures }
+  
+    image: PImage;
+
+    exception: ExceptionInfo;
+
+    { MVG output string and housekeeping }
+  
+    mvg: PChar;               // MVG data
+
+    mvg_alloc,                // total allocated memory
+//    mvg_length: size_t;       // total MVG length
+
+    mvg_width: Cardinal;      // current line width 
+
+    { Pattern support }
+    
+    pattern_id: PChar;
+
+    pattern_bounds: RectangleInfo;
+
+//    pattern_offset: size_t;
+
+    { Graphic wand }
+    
+    index: Cardinal;          // array index
+
+    graphic_context: PPDrawInfo;
+
+    filter_off: MagickBooleanType;    // true if not filtering attributes
+
+    { Pretty-printing depth }
+  
+    indent_depth: Cardinal;       // number of left-hand pad characters 
+
+    { Path operation support }
+  
+    path_operation: PathOperation;
+
+    path_mode: PathMode;
+
+    destroy,
+    debug: MagickBooleanType;
+
+    signature: Cardinal;
+  end;
+ 
+  PDrawingWand = ^DrawingWand;
+
+const x = 9;
+
+function DrawGetTextAlignment(const wand: PDrawingWand): AlignType; cdecl; external WandExport;
+
+function DrawGetClipPath(const wand: PDrawingWand): PChar; cdecl; external WandExport;
+function DrawGetException(const wand: PDrawingWand; severity: PExceptionType): PChar; cdecl; external WandExport;
+function DrawGetFont(const wand: PDrawingWand): PChar; cdecl; external WandExport;
+function DrawGetFontFamily(const wand: PDrawingWand): PChar; cdecl; external WandExport;
+function DrawGetTextEncoding(const wand: PDrawingWand): PChar; cdecl; external WandExport;
+function DrawGetVectorGraphics(const wand: PDrawingWand): PChar; cdecl; external WandExport;
+
+function DrawGetClipUnits(const wand: PDrawingWand): ClipPathUnits; external WandExport;
+
+function DrawGetTextDecoration(const wand: PDrawingWand): DecorationType; external WandExport;
+
+function DrawGetFillAlpha(const wand: PDrawingWand): double; cdecl; external WandExport;
+function DrawGetFontSize(const wand: PDrawingWand): double; cdecl; external WandExport;
+function DrawGetStrokeDashArray(const wand: PDrawingWand; number_elements: Cardinal): PDouble; cdecl; external WandExport;
+function DrawGetStrokeDashOffset(const wand: PDrawingWand): double; cdecl; external WandExport;
+function DrawGetStrokeAlpha(const wand: PDrawingWand): double; cdecl; external WandExport;
+function DrawGetStrokeWidth(const wand: PDrawingWand): double; cdecl; external WandExport;
+
+function PeekDrawingWand(const wand: PDrawingWand): PDrawInfo; cdecl; external WandExport;
+
+function CloneDrawingWand(const wand: PDrawingWand): PDrawingWand; cdecl; external WandExport;
+function DestroyDrawingWand(wand: PDrawingWand): PDrawingWand; cdecl; external WandExport;
+{ Sem documentação
+function DrawAllocateWand(const DrawInfo *,Image *): PDrawingWand; external WandExport;
+}
+function NewDrawingWand: PDrawingWand; cdecl; external WandExport;
+
+function DrawGetClipRule(const wand: PDrawingWand): FillRule; cdecl; external WandExport;
+function DrawGetFillRule(const wand: PDrawingWand): FillRule; cdecl; external WandExport;
+
+function DrawGetGravity(const wand: PDrawingWand): GravityType; cdecl; external WandExport;
+
+function DrawGetStrokeLineCap(const wand: PDrawingWand): LineCap; cdecl; external WandExport;
+
+function DrawGetStrokeLineJoin(const wand: PDrawingWand): LineJoin; cdecl; external WandExport;
+
+function DrawClearException(wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
+function DrawComposite(wand: PDrawingWand; const compose: CompositeOperator;
+ const x, y, width, height: double; magick_wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function DrawGetStrokeAntialias(const wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
+function DrawGetTextAntialias(const wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
+function DrawPopPattern(wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
+function DrawPushPattern(wand: PDrawingWand; const pattern_id: PChar;
+ const x, y, width, height: double): MagickBooleanType; cdecl; external WandExport;
+function DrawRender(wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
+function DrawSetClipPath(wand: PDrawingWand; const clip_path: PChar): MagickBooleanType; cdecl; external WandExport;
+function DrawSetFillPatternURL(wand: PDrawingWand; const fill_url: PChar): MagickBooleanType; cdecl; external WandExport;
+function DrawSetFont(wand: PDrawingWand; const font_name: PChar): MagickBooleanType; cdecl; external WandExport;
+function DrawSetFontFamily(wand: PDrawingWand; const font_family: PChar): MagickBooleanType; cdecl; external WandExport;
+function DrawSetStrokeDashArray(wand: PDrawingWand; const number_elements: Cardinal;
+ const dash_array: Pdouble): MagickBooleanType; cdecl; external WandExport;
+function DrawSetStrokePatternURL(wand: PDrawingWand; const stroke_url: PChar): MagickBooleanType; cdecl; external WandExport;
+function DrawSetVectorGraphics(wand: PDrawingWand; const xml: PChar): MagickBooleanType; cdecl; external WandExport;
+function IsDrawingWand(const wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
+function PopDrawingWand(wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
+function PushDrawingWand(wand: PDrawingWand): MagickBooleanType; cdecl; external WandExport;
+
+function DrawGetFontStretch(const wand: PDrawingWand): StretchType; cdecl; external WandExport;
+
+function DrawGetFontStyle(const wand: PDrawingWand): StyleType; cdecl; external WandExport;
+
+function DrawGetFontWeight(const wand: PDrawingWand): Cardinal; cdecl; external WandExport;
+function DrawGetStrokeMiterLimit(const wand: PDrawingWand): Cardinal; cdecl; external WandExport;
+
+procedure ClearDrawingWand(wand: PDrawingWand); cdecl; external WandExport;
+procedure DrawAffine(wand: PDrawingWand; const affine: PAffineMatrix); cdecl; external WandExport;
+procedure DrawAnnotation(wand: PDrawingWand; const  x, y: double;
+ const text: PChar); cdecl; external WandExport;
+procedure DrawArc(wand: PDrawingWand; const sx, sy, ex, ey, sd, ed: double); cdecl; external WandExport;
+procedure DrawBezier(wand: PDrawingWand; const number_coordinates: Cardinal;
+ const coordinates: PPointInfo); cdecl; external WandExport;
+procedure DrawCircle(wand: PDrawingWand; const ox, oy, px, py: double); cdecl; external WandExport;
+procedure DrawColor(wand: PDrawingWand; const x, y: double;
+ const paint_method: PaintMethod); cdecl; external WandExport;
+procedure DrawComment(wand: PDrawingWand; const comment: PChar); cdecl; external WandExport;
+procedure DrawEllipse(wand: PDrawingWand; const ox, oy, rx, ry, start, end_: double); cdecl; external WandExport;
+procedure DrawGetFillColor(const wand: PDrawingWand; fill_color: PPixelWand); cdecl; external WandExport;
+procedure DrawGetStrokeColor(const wand: PDrawingWand; stroke_color: PPixelWand); cdecl; external WandExport;
+procedure DrawGetTextUnderColor(const wand: PDrawingWand; under_color: PPixelWand); cdecl; external WandExport;
+procedure DrawLine(wand: PDrawingWand; const sx, sy, ex, ey: double); cdecl; external WandExport;
+procedure DrawMatte(wand: PDrawingWand; const x, y: double;
+ const paint_method: PaintMethod); cdecl; external WandExport;
+procedure DrawPathClose(wand: PDrawingWand); cdecl; external WandExport;
+procedure DrawPathCurveToAbsolute(wand: PDrawingWand;
+ const x1, y1, x2, y2, x, y: double); cdecl; external WandExport;
+procedure DrawPathCurveToRelative(wand: PDrawingWand;
+ const x1, y1, x2, y2, x, y: double); cdecl; external WandExport;
+procedure DrawPathCurveToQuadraticBezierAbsolute(wand: PDrawingWand;
+ const x1, y1, x, y: double); cdecl; external WandExport;
+procedure DrawPathCurveToQuadraticBezierRelative(wand: PDrawingWand;
+ const x1, y1, x, y: double); cdecl; external WandExport;
+procedure DrawPathCurveToQuadraticBezierSmoothAbsolute(wand: PDrawingWand;
+ const x, y: double); cdecl; external WandExport;
+procedure DrawPathCurveToQuadraticBezierSmoothRelative(wand: PDrawingWand;
+ const x, y: double); cdecl; external WandExport;
+procedure DrawPathCurveToSmoothAbsolute(wand: PDrawingWand;
+ const x2, y2, x, y: double); cdecl; external WandExport;
+procedure DrawPathCurveToSmoothRelative(wand: PDrawingWand;
+ const x2, y2, x, y: double); cdecl; external WandExport;
+procedure DrawPathEllipticArcAbsolute(wand: PDrawingWand;
+    const rx, ry, x_axis_rotation: double;
+    const large_arc_flag: MagickBooleanType;
+    const sweep_flag: MagickBooleanType; const x, y: double); cdecl; external WandExport;
+procedure DrawPathEllipticArcRelative(wand: PDrawingWand;
+    const rx, ry, x_axis_rotation: double;
+    const large_arc_flag: MagickBooleanType;
+    const sweep_flag: MagickBooleanType; const x, y: double); cdecl; external WandExport;
+procedure DrawPathFinish(wand: PDrawingWand); cdecl; external WandExport;
+procedure DrawPathLineToAbsolute(wand: PDrawingWand; const x, y: double); cdecl; external WandExport;
+procedure DrawPathLineToRelative(wand: PDrawingWand; const x, y: double); cdecl; external WandExport;
+{procedure DrawPathLineToHorizontalAbsolute(wand: PDrawingWand;
+ const mode: PathMode; const x: double); cdecl; external WandExport;
+procedure DrawPathLineToHorizontalRelative(wand: PDrawingWand); cdecl; external WandExport;
+
+Contradição na declaração
+}
+procedure DrawPathLineToVerticalAbsolute(wand: PDrawingWand; const y: double); cdecl; external WandExport;
+procedure DrawPathLineToVerticalRelative(wand: PDrawingWand; const y: double); cdecl; external WandExport;
+procedure DrawPathMoveToAbsolute(wand: PDrawingWand; const x, y: double); cdecl; external WandExport;
+procedure DrawPathMoveToRelative(wand: PDrawingWand; const x, y: double); cdecl; external WandExport;
+procedure DrawPathStart(wand: PDrawingWand); cdecl; external WandExport;
+procedure DrawPoint(wand: PDrawingWand; const x, y: double); cdecl; external WandExport;
+procedure DrawPolygon(wand: PDrawingWand; const number_coordinates: Cardinal; const coordinates: PPointInfo
+ ); cdecl; external WandExport;
+procedure DrawPolyline(wand: PDrawingWand; const number_coordinates: Cardinal; const coordinates: PPointInfo
+ ); cdecl; external WandExport;
+procedure DrawPopClipPath(wand: PDrawingWand); cdecl; external WandExport;
+procedure DrawPopDefs(wand: PDrawingWand); cdecl; external WandExport;
+procedure DrawPushClipPath(wand: PDrawingWand; clip_path_id: PChar); cdecl; external WandExport;
+procedure DrawPushDefs(wand: PDrawingWand); cdecl; external WandExport;
+procedure DrawRectangle(wand: PDrawingWand; const x1, y1, x2, y2: double); cdecl; external WandExport;
+procedure DrawRotate(wand: PDrawingWand; const degrees: double); cdecl; external WandExport;
+procedure DrawRoundRectangle(wand: PDrawingWand; const x1, y1, x2, y2, rx, ry: double); cdecl; external WandExport;
+procedure DrawScale(wand: PDrawingWand; const x, y: double); cdecl; external WandExport;
+procedure DrawSetClipRule(wand: PDrawingWand; const fill_rule: FillRule); cdecl; external WandExport;
+procedure DrawSetClipUnits(wand: PDrawingWand; const clip_units: ClipPathUnits); cdecl; external WandExport;
+procedure DrawSetFillColor(wand: PDrawingWand; const fill_wand: PPixelWand); cdecl; external WandExport;
+procedure DrawSetFillAlpha(wand: PDrawingWand; const fill_opacity: double); cdecl; external WandExport;
+procedure DrawSetFillRule(wand: PDrawingWand; const fill_rule: FillRule); cdecl; external WandExport;
+procedure DrawSetFontSize(wand: PDrawingWand; const pointsize: double); cdecl; external WandExport;
+procedure DrawSetFontStretch(wand: PDrawingWand; const font_stretch: StretchType); cdecl; external WandExport;
+procedure DrawSetFontStyle(wand: PDrawingWand; const style: StyleType); cdecl; external WandExport;
+procedure DrawSetFontWeight(wand: PDrawingWand; const font_weight: Cardinal); cdecl; external WandExport;
+procedure DrawSetGravity(wand: PDrawingWand; const gravity: GravityType); cdecl; external WandExport;
+procedure DrawSkewX(wand: PDrawingWand; const degrees: double); cdecl; external WandExport;
+procedure DrawSkewY(wand: PDrawingWand; const degrees: double); cdecl; external WandExport;
+procedure DrawSetStrokeAntialias(wand: PDrawingWand; const stroke_antialias: MagickBooleanType
+ ); cdecl; external WandExport;
+procedure DrawSetStrokeColor(wand: PDrawingWand; const stroke_wand: PPixelWand); cdecl; external WandExport;
+procedure DrawSetStrokeDashOffset(wand: PDrawingWand; const dash_offset: double); cdecl; external WandExport;
+procedure DrawSetStrokeLineCap(wand: PDrawingWand; const linecap_: LineCap); cdecl; external WandExport;
+procedure DrawSetStrokeLineJoin(wand: PDrawingWand; const linejoin_: LineJoin); cdecl; external WandExport;
+procedure DrawSetStrokeMiterLimit(wand: PDrawingWand; const miterlimit: Cardinal); cdecl; external WandExport;
+procedure DrawSetStrokeAlpha(wand: PDrawingWand; const stroke_opacity: double); cdecl; external WandExport;
+procedure DrawSetStrokeWidth(wand: PDrawingWand; const troke_width: double); cdecl; external WandExport;
+procedure DrawSetTextAlignment(wand: PDrawingWand; const alignment: AlignType); cdecl; external WandExport;
+procedure DrawSetTextAntialias(wand: PDrawingWand; const text_antialias: MagickBooleanType
+ ); cdecl; external WandExport;
+procedure DrawSetTextDecoration(wand: PDrawingWand; const decoration: DecorationType); cdecl; external WandExport;
+procedure DrawSetTextEncoding(wand: PDrawingWand; const encoding: PChar); cdecl; external WandExport;
+procedure DrawSetTextUnderColor(wand: PDrawingWand; const under_wand: PPixelWand); cdecl; external WandExport;
+procedure DrawSetViewbox(wand: PDrawingWand; x1, y1, x2, y2: Cardinal); cdecl; external WandExport;
+procedure DrawTranslate(wand: PDrawingWand; const x, y: double); cdecl; external WandExport;
+
+{
+  Deprecated.
+}
+{typedef struct _DrawingWand
+  *DrawContext;
+
+extern WandExport double
+  DrawGetFillOpacity(const wand: PDrawingWand),
+  DrawGetStrokeOpacity(const wand: PDrawingWand);
+
+extern WandExport DrawInfo
+  *DrawPeekGraphicWand(const wand: PDrawingWand);
+
+extern WandExport void
+  DrawPopGraphicContext(DrawingWand *),
+  DrawPushGraphicContext(DrawingWand *),
+  DrawSetFillOpacity(DrawingWand *,const double),
+  DrawSetStrokeOpacity(DrawingWand *,const double);}

+ 80 - 0
packages/base/imagemagick/wand/magick_attribute.inc

@@ -0,0 +1,80 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  Set or Get Magick Wand Attributes.
+}
+
+function MagickGetException(wand: PMagickWand;
+ severity: PExceptionType): PChar; cdecl; external WandExport;
+function MagickGetFilename(const wand: PMagickWand): PChar; cdecl; external WandExport;
+function MagickGetFormat(wand: PMagickWand): PChar; cdecl; external WandExport;
+function MagickGetHomeURL: PChar; cdecl; external WandExport;
+function MagickGetOption(wand: PMagickWand;
+ const key: PChar): PChar; cdecl; external WandExport;
+{sem documentação
+extern WandExport char
+  *MagickQueryConfigureOption(const char *),
+  **MagickQueryConfigureOptions(const char *,unsigned long *),
+  **MagickQueryFonts(const char *,unsigned long *),
+  **MagickQueryFormats(const char *,unsigned long *);}
+
+function MagickGetCompression(wand: PMagickWand): CompressionType; cdecl; external WandExport;
+
+function MagickGetCopyright: PChar; cdecl; external WandExport;
+function MagickGetPackageName: PChar; cdecl; external WandExport;
+function MagickGetQuantumDepth(depth: PCardinal): PChar; cdecl; external WandExport;
+function MagickGetQuantumRange(range: PCardinal): PChar; cdecl; external WandExport;
+function MagickGetReleaseDate: PChar; cdecl; external WandExport;
+function MagickGetVersion(version: PCardinal): PChar; cdecl; external WandExport;
+
+function MagickGetSamplingFactors(wand: PMagickWand;
+ number_factors: PCardinal): Pdouble; cdecl; external WandExport;
+{function (wand: PMagickWand): Pdouble; cdecl; external WandExport;
+  *MagickQueryFontMetrics(MagickWand *,const DrawingWand *,const char *),
+  *MagickQueryMultilineFontMetrics(MagickWand *,const DrawingWand *,
+    const char *);}
+
+function MagickGetInterlaceScheme(wand: PMagickWand): InterlaceType; cdecl; external WandExport;
+
+{function (const wand: PMagickWand): ; cdecl; external WandExport;
+extern WandExport MagickBooleanType
+  MagickGetPage(MagickWand *,unsigned long *,unsigned long *,long *,long *),
+  MagickGetSize(const MagickWand *,unsigned long *,unsigned long *),
+  MagickSetBackgroundColor(MagickWand *,const PixelWand *),
+  MagickSetCompression(MagickWand *,const CompressionType),
+  MagickSetCompressionQuality(MagickWand *,const unsigned long),
+  MagickSetFilename(MagickWand *,const char *),
+  MagickSetFormat(MagickWand *,const char *),
+  MagickSetInterlaceScheme(MagickWand *,const InterlaceType),
+  MagickSetOption(MagickWand *,const char *,const char *),
+  MagickSetPage(MagickWand *,const unsigned long,const unsigned long,
+    const long,const long),
+  MagickSetPassphrase(MagickWand *,const char *),
+  MagickSetResolution(MagickWand *,const double,const double),
+  MagickSetResourceLimit(const ResourceType type,const unsigned long limit),
+  MagickSetSamplingFactors(MagickWand *,const unsigned long,const double *),
+  MagickSetSize(MagickWand *,const unsigned long,const unsigned long),
+  MagickSetType(MagickWand *,const ImageType);
+
+function (const wand: PMagickWand): ; cdecl; external WandExport;
+extern WandExport MagickProgressMonitor
+  MagickSetProgressMonitor(MagickWand *,const MagickProgressMonitor,void *);
+
+function (const wand: PMagickWand): ; cdecl; external WandExport;
+extern WandExport unsigned long
+  MagickGetCompressionQuality(MagickWand *),
+  MagickGetResource(const ResourceType),
+  MagickGetResourceLimit(const ResourceType);}
+

+ 417 - 0
packages/base/imagemagick/wand/magick_image.inc

@@ -0,0 +1,417 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  Magick Wand Image Methods.
+}
+
+function MagickGetImageChannelStatistics(wand: PMagickWand): PChannelStatistics; cdecl; external WandExport;
+
+function MagickGetImageAttribute(wand: PMagickWand): PChar; cdecl; external WandExport;
+function MagickGetImageFilename(wand: PMagickWand): PChar; cdecl; external WandExport;
+function MagickGetImageFormat(wand: PMagickWand): PChar; cdecl; external WandExport;
+function MagickGetImageSignature(wand: PMagickWand): PChar; cdecl; external WandExport;
+function MagickIdentifyImage(wand: PMagickWand): PChar; cdecl; external WandExport;
+
+function MagickGetImageCompose(wand: PMagickWand): CompositeOperator; cdecl; external WandExport;
+
+function MagickGetImageColorspace(wand: PMagickWand): ColorspaceType; cdecl; external WandExport;
+
+function MagickGetImageCompression(wand: PMagickWand): CompressionType; cdecl; external WandExport;
+
+function MagickGetImageDispose(wand: PMagickWand): DisposeType; cdecl; external WandExport;
+
+function MagickGetImageGamma(wand: PMagickWand): double; cdecl; external WandExport;
+function MagickGetImageTotalInkDensity(wand: PMagickWand): double; cdecl; external WandExport;
+
+function GetImageFromMagickWand(wand: PMagickWand): PImage; cdecl; external WandExport;
+
+function MagickGetImageType(wand: PMagickWand): ImageType; cdecl; external WandExport;
+
+function MagickGetImageInterlaceScheme(wand: PMagickWand): InterlaceType; cdecl; external WandExport;
+
+function MagickGetImageIndex(wand: PMagickWand): Integer; cdecl; external WandExport;
+
+function MagickAdaptiveThresholdImage(wand: PMagickWand;
+     const width, height: Cardinal; const offset: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickAddImage(wand: PMagickWand; const add_wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickAddNoiseImage(wand: PMagickWand; const noise_type: NoiseType): MagickBooleanType; cdecl; external WandExport;
+function MagickAffineTransformImage(wand: PMagickWand;
+ const drawing_wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickAnnotateImage(wand: PMagickWand;
+ const drawing_wand: PMagickWand; const x, y, angle: double;
+ const text: PChar): MagickBooleanType; cdecl; external WandExport;
+function MagickAnimateImages(wand: PMagickWand;
+ const server_name: PChar): MagickBooleanType; cdecl; external WandExport;
+function MagickBlackThresholdImage(wand: PMagickWand;
+ const threshold: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickBlurImage(wand: PMagickWand;
+ const radius, sigma: double): MagickBooleanType; cdecl; external WandExport;
+function MagickBlurImageChannel(wand: PMagickWand;
+ const channel: ChannelType; const radius, sigma: double): MagickBooleanType; cdecl; external WandExport;
+function MagickBorderImage(wand: PMagickWand;
+ const bordercolor: PPixelWand; const width, height: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickCharcoalImage(wand: PMagickWand;
+   const radius, sigma: double): MagickBooleanType; cdecl; external WandExport;
+function MagickChopImage(wand: PMagickWand;
+ const width, height: Cardinal; const x, y: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickClipImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickClipPathImage(wand: PMagickWand;
+ const pathname: PChar; const inside: MagickBooleanType): MagickBooleanType; cdecl; external WandExport;
+function MagickColorFloodfillImage(wand: PMagickWand;
+ const fill: PPixelWand; const fuzz: double; const bordercolor: PPixelWand;
+ const x, y: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickColorizeImage(wand: PMagickWand;
+ const colorize, opacity: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickCommentImage(wand: PMagickWand;
+ const comment: PChar): MagickBooleanType; cdecl; external WandExport;
+function MagickCompositeImage(wand: PMagickWand;
+ const composite_wand: MagickWand; const compose: CompositeOperator;
+ const x, y: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickConstituteImage(wand: PMagickWand;
+ const columns, rows: Cardinal; const map: PChar;
+ const storage: StorageType; pixels: Pointer): MagickBooleanType; cdecl; external WandExport;
+function MagickContrastImage(wand: PMagickWand;
+ const sharpen: MagickBooleanType): MagickBooleanType; cdecl; external WandExport;
+function MagickConvolveImage(wand: PMagickWand;
+ const order: Cardinal; const kernel: PDouble): MagickBooleanType; cdecl; external WandExport;
+function MagickConvolveImageChannel(wand: PMagickWand;
+ const channel: ChannelType; const order: Cardinal;
+ const kernel: PDouble): MagickBooleanType; cdecl; external WandExport;
+function MagickCropImage(wand: PMagickWand;
+ const width, height: Cardinal; const x, y: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickCycleColormapImage(wand: PMagickWand;
+ const displace: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickDespeckleImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickDisplayImage(wand: PMagickWand;
+ const server_name: PChar): MagickBooleanType; cdecl; external WandExport;
+function MagickDisplayImages(wand: PMagickWand;
+ const server_name: PChar): MagickBooleanType; cdecl; external WandExport;
+function MagickDrawImage(wand: PMagickWand;
+ const drawing_wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickEdgeImage(wand: PMagickWand;
+ const radius: double): MagickBooleanType; cdecl; external WandExport;
+function MagickEmbossImage(wand: PMagickWand;
+ const radius, sigma: double): MagickBooleanType; cdecl; external WandExport;
+function MagickEnhanceImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickEqualizeImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickEvaluateImage(wand: PMagickWand;
+ const op: MagickEvaluateOperator; const constant: double): MagickBooleanType; cdecl; external WandExport;
+function MagickEvaluateImageChannel(wand: PMagickWand;
+ const op: MagickEvaluateOperator; const constant: double): MagickBooleanType; cdecl; external WandExport;
+function MagickFlipImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickFlopImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickFrameImage(wand: PMagickWand;
+ const matte_color: PPixelWand; const width, height: Cardinal;
+ const inner_bevel, outer_bevel: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickGammaImage(wand: PMagickWand; const gamma: double): MagickBooleanType; cdecl; external WandExport;
+function MagickGammaImageChannel(wand: PMagickWand;
+ const channel: ChannelType; const gamma: double): MagickBooleanType; cdecl; external WandExport;
+function MagickGaussianBlurImage(wand: PMagickWand;
+ const radius, sigma: double): MagickBooleanType; cdecl; external WandExport;
+function MagickGaussianBlurImageChannel(wand: PMagickWand;
+ const channel: ChannelType; const radius, sigma: double): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageBackgroundColor(wand: PMagickWand;
+ background_color: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageBluePrimary(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageBorderColor(wand: PMagickWand; border_color: PPixelWand
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageChannelDistortion(wand: PMagickWand;
+ const reference: PMagickWand; const channel: ChannelType;
+ const metric: MetricType; distortion: Pdouble): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageDistortion(wand: PMagickWand;
+ const reference: PMagickWand; const metric: MetricType;
+ distortion: Pdouble): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageChannelExtrema(wand: PMagickWand;
+ const channel: ChannelType; minima, maxima: PCardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageChannelMean(wand: PMagickWand;
+ const channel: ChannelType; mean, standard_deviation: Pdouble): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageColormapColor(wand: PMagickWand;
+ const index: Cardinal; color: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageExtrema(wand: PMagickWand;
+ min, max: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageGreenPrimary(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; external WandExport;
+function MagickGetImageMatteColor(wand: PMagickWand;
+ matte_color: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImagePage(wand: PMagickWand;
+ width, height: PCardinal; x, y: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImagePixelColor(wand: PMagickWand;
+ const x, y: Integer; color: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImagePixels(wand: PMagickWand;
+ const x, y: Integer; const columns, rows: Cardinal;
+ const map: PChar; const storage: StorageType; pixels: Pointer): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageRedPrimary(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageResolution(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; cdecl; external WandExport;
+function MagickGetImageWhitePoint(wand: PMagickWand; x, y: Pdouble): MagickBooleanType; cdecl; external WandExport;
+function MagickHasNextImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickHasPreviousImage(wand: PMagickWand): MagickBooleanType; external WandExport;
+function MagickImplodeImage(wand: PMagickWand; const radius: double): MagickBooleanType; cdecl; external WandExport;
+function MagickLabelImage(wand: PMagickWand; const _label: PChar): MagickBooleanType; cdecl; external WandExport;
+function MagickLevelImage(wand: PMagickWand;
+ const black_point, gamma, white_point: double): MagickBooleanType; cdecl; external WandExport;
+function MagickLevelImageChannel(wand: PMagickWand;
+ const channel: ChannelType; const black_point, gamma, white_point: double
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickMagnifyImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickMapImage(wand: PMagickWand;
+ const map_wand: PMagickWand; const dither: MagickBooleanType): MagickBooleanType; cdecl; external WandExport;
+function MagickMatteFloodfillImage(wand: PMagickWand;
+ const opacity: Quantum; const fuzz: double; const bordercolor: PPixelWand;
+ const x, y: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickMedianFilterImage(wand: PMagickWand; const radius: double): MagickBooleanType; cdecl; external WandExport;
+function MagickMinifyImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickModulateImage(wand: PMagickWand;
+ const brightness, saturation, hue: double): MagickBooleanType; cdecl; external WandExport;
+function MagickMotionBlurImage(wand: PMagickWand;
+ const radius, sigma, angle: double): MagickBooleanType; cdecl; external WandExport;
+function MagickNegateImage(wand: PMagickWand; const gray: MagickBooleanType): MagickBooleanType; cdecl; external WandExport;
+{
+function MagickNegateImageChannel(wand: PMagickWand): MagickBooleanType; external WandExport;
+  (MagickWand *,const ChannelType,
+    const MagickBooleanType),
+  Documentation not found
+}
+function MagickNewImage(wand: PMagickWand;
+ const columns, rows: Cardinal; const background: PPixelWand): MagickBooleanType; external WandExport;
+function MagickNextImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickNormalizeImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickOilPaintImage(wand: PMagickWand; const radius: double): MagickBooleanType; cdecl; external WandExport;
+function MagickPaintOpaqueImage(wand: PMagickWand;
+ const target, fill: PPixelWand; const fuzz: double): MagickBooleanType; external WandExport;
+function MagickPaintTransparentImage(wand: PMagickWand;
+ const target: PPixelWand; const opacity: Quantum; const fuzz: double): MagickBooleanType; external WandExport;
+function MagickPingImage(wand: PMagickWand;
+ const filename: PChar): MagickBooleanType; cdecl; external WandExport;
+{
+function MagickPosterizeImage(wand: PMagickWand;
+ const levels: Word; const dither: MagickBooleanType): MagickBooleanType; external WandExport;
+??
+}
+function MagickPreviousImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickProfileImage(wand: PMagickWand; const name: PChar;
+ const profile: PChar; const length: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickQuantizeImage(wand: PMagickWand;
+ const number_colors: Cardinal; const colorspace: ColorspaceType;
+ const treedepth: Cardinal; const dither, measure_error): MagickBooleanType; cdecl; external WandExport;
+function MagickQuantizeImages(wand: PMagickWand;
+ const number_colors: Cardinal; const colorspace: ColorspaceType;
+ const treedepth: Cardinal; const dither: MagickBooleanType;
+ const measure_error: MagickBooleanType): MagickBooleanType; cdecl; external WandExport;
+function MagickRadialBlurImage(wand: PMagickWand; const angle: double): MagickBooleanType; external WandExport;
+function MagickRadialBlurImageChannel(wand: PMagickWand;
+ const channel: ChannelType; const angle: double): MagickBooleanType; cdecl; external WandExport;
+function MagickRaiseImage(wand: PMagickWand;
+ const width, height: Cardinal; const x, y: Integer;
+ const raise_: MagickBooleanType): MagickBooleanType; cdecl; external WandExport;
+function MagickReadImage(wand: PMagickWand; const filename: PChar
+): MagickBooleanType; cdecl; external WandExport;
+function MagickReadImageBlob(wand: PMagickWand;
+ const blob: Pointer; const length: Integer): MagickBooleanType; cdecl; external WandExport;
+//function MagickReadImageFile(wand: PMagickWand; file_: file): MagickBooleanType; external WandExport;
+
+function MagickReduceNoiseImage(wand: PMagickWand; const radius: double): MagickBooleanType; external WandExport;
+function MagickRemoveImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickResampleImage(wand: PMagickWand;
+ const x_resolution, y_resolution: double;
+ const filter: FilterTypes; const blur: double): MagickBooleanType; cdecl; external WandExport;
+function MagickResizeImage(wand: PMagickWand;
+ const columns, rows: Cardinal; const filter: FilterTypes;
+ const blur: double): MagickBooleanType; cdecl; external WandExport;
+function MagickRollImage(wand: PMagickWand;
+ const x: Integer; const y: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickRotateImage(wand: PMagickWand; const background: PPixelWand;
+ const degrees: double): MagickBooleanType; cdecl; external WandExport;
+function MagickSampleImage(wand: PMagickWand; const columns, rows: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickScaleImage(wand: PMagickWand; const columns, rows: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickSeparateImageChannel(wand: PMagickWand; const channel: ChannelType): MagickBooleanType; cdecl; external WandExport;
+
+// MagickSepiaToneImage(MagickWand *,const double),
+
+function MagickSetImage(wand: PMagickWand; const set_wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageAttribute(wand: PMagickWand; const key, attribute: PChar): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageBackgroundColor(wand: PMagickWand; const background: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageBias(wand: PMagickWand; const bias: double): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageBluePrimary(wand: PMagickWand; const x, y: double): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageBorderColor(wand: PMagickWand; const border: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageChannelDepth(wand: PMagickWand; const channel: ChannelType; const depth: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageColormapColor(wand: PMagickWand; const index: Cardinal; const color: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageColorspace(wand: PMagickWand; const colorspace: ColorspaceType): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageCompose(wand: PMagickWand; const compose: CompositeOperator): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageCompression(wand: PMagickWand; const compression: CompressionType): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageCompressionQuality(wand: PMagickWand; const quality: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageDelay(wand: PMagickWand; const delay: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageDepth(wand: PMagickWand; const depth: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageDispose(wand: PMagickWand; const dispose: DisposeType): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageExtent(wand: PMagickWand; const columns, rows: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageFilename(wand: PMagickWand; const filename: PChar): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageFormat(wand: PMagickWand; const format: PChar): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageGamma(wand: PMagickWand; const gamma: Double): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageGreenPrimary(wand: PMagickWand; const x, y: Double): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageIndex(wand: PMagickWand; const index: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageInterlaceScheme(wand: PMagickWand; const interlace_scheme: InterlaceType): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageIterations(wand: PMagickWand; const iterations: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageMatteColor(wand: PMagickWand; const matte: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImagePage(wand: PMagickWand; const width, height: Cardinal; const x, y: Integer): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImagePixels(wand: PMagickWand; const x, y: Integer; const columns, rows: Cardinal;
+ const map: PChar; const storage: StorageType; const pixels: Pointer): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageProfile(wand: PMagickWand; const name: PChar; const profile: Pointer;
+ const length: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageRedPrimary(wand: PMagickWand; const x, y: Double): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageRenderingIntent(wand: PMagickWand; const rendering_intent: RenderingIntent
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageResolution(wand: PMagickWand; const x_resolution, y_resolution: double
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageScene(wand: PMagickWand; const scene: Cardinal): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageType(wand: PMagickWand; const image_type: ImageType
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageUnits(wand: PMagickWand; const units: ResolutionType
+ ): MagickBooleanType; cdecl; external WandExport;
+//function MagickSetImageVirtualPixelMethod(wand: PMagickWand;
+// const method: VirtualPixelMethod): MagickBooleanType; cdecl; external WandExport;
+function MagickSetImageWhitePoint(wand: PMagickWand; const x, y: double
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickShadowImage(wand: PMagickWand; const radius, sigma: double; const x, y: Integer
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickSharpenImage(wand: PMagickWand; const radius, sigma: double
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickSharpenImageChannel(wand: PMagickWand; const channel: ChannelType;
+ const radius, sigma: double): MagickBooleanType; cdecl; external WandExport;
+function MagickShaveImage(wand: PMagickWand; const columns, rows: Cardinal
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickShearImage(wand: PMagickWand; const background: PPixelWand;
+ const x_shear, y_shear: double): MagickBooleanType; cdecl; external WandExport;
+function MagickSigmoidalContrastImage(wand: PMagickWand;
+ const sharpen: MagickBooleanType; const alpha, beta: double
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickSigmoidalContrastImageChannel(wand: PMagickWand;
+ const channel: ChannelType; const sharpen: MagickBooleanType; const alpha, beta: double
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickSolarizeImage(wand: PMagickWand; const threshold: double
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickSpliceImage(wand: PMagickWand; const width, height: Cardinal; const x, y: Integer
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickSpreadImage(wand: PMagickWand; const radius: double): MagickBooleanType; cdecl; external WandExport;
+function MagickStripImage(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickSwirlImage(wand: PMagickWand; const degrees: double): MagickBooleanType; cdecl; external WandExport;
+function MagickTintImage(wand: PMagickWand; const tint: PPixelWand; const opacity: PPixelWand
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickThresholdImage(wand: PMagickWand; const threshold: double): MagickBooleanType; cdecl; external WandExport;
+function MagickThresholdImageChannel(wand: PMagickWand; const channel: ChannelType;
+ const threshold: double): MagickBooleanType; cdecl; external WandExport;
+function MagickTrimImage(wand: PMagickWand; const fuzz: double): MagickBooleanType; cdecl; external WandExport;
+function MagickUnsharpMaskImage(wand: PMagickWand;
+ const radius, sigma, amount, threshold: double): MagickBooleanType; cdecl; external WandExport;
+function MagickUnsharpMaskImageChannel(wand: PMagickWand;
+ const channel: ChannelType; const radius, sigma, amount, threshold: double
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickWaveImage(wand: PMagickWand; const amplitude, wave_length: double
+ ): MagickBooleanType; cdecl; external WandExport;
+function MagickWhiteThresholdImage(wand: PMagickWand; const threshold: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function MagickWriteImage(wand: PMagickWand;
+ const filename: PChar): MagickBooleanType; cdecl; external WandExport;
+//  MagickWriteImageFile(MagickWand *,FILE *),
+function MagickWriteImages(wand: PMagickWand;
+ const filename: PChar; const adjoin: MagickBooleanType
+ ): MagickBooleanType; cdecl; external WandExport;
+//  MagickWriteImagesFile(MagickWand *,FILE *);
+
+
+function MagickSetImageProgressMonitor(wand: PMagickWand;
+ const progress_monitor: MagickProgressMonitor; client_data: Pointer): MagickProgressMonitor; cdecl; external WandExport;
+
+function MagickGetImageSize(wand: PMagickWand): MagickSizeType; cdecl; external WandExport;
+
+function MagickAppendImages(wand: PMagickWand; const stack: MagickBooleanType): PMagickWand; cdecl; external WandExport;
+function MagickAverageImages(wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+function MagickCoalesceImages(wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+function MagickCombineImages(wand: PMagickWand; para2: ChannelType): PMagickWand; cdecl; external WandExport;
+function MagickCompareImageChannels(wand: PMagickWand;
+ const reference: PMagickWand; const channel: ChannelType; const metric: MetricType; distortion: PDouble
+ ): PMagickWand; cdecl; external WandExport;
+function MagickCompareImages(wand: PMagickWand;
+ const reference: PMagickWand; const metric: MetricType; distortion: PDouble
+ ): PMagickWand; cdecl; external WandExport;
+function MagickDeconstructImages(wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+function MagickFlattenImages(wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+function MagickFxImage(wand: PMagickWand; const expression: PChar): PMagickWand; cdecl; external WandExport;
+function MagickFxImageChannel(wand: PMagickWand; const channel: ChannelType; const expression: PChar
+ ): PMagickWand; cdecl; external WandExport;
+function MagickGetImage(wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+function MagickGetImageRegion(wand: PMagickWand;
+ const width, height: Cardinal; const x, y: Integer
+ ): PMagickWand; cdecl; external WandExport;
+function MagickMorphImages(wand: PMagickWand; const number_frames: Cardinal): PMagickWand; cdecl; external WandExport;
+function MagickMosaicImages(wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+//function MagickMontageImage(wand: PMagickWand;
+// const drawing_wand: DrawingWand; const tile_geometry: PChar;
+// const thumbnail_geometry: PChar; const mode: MontageMode; const frame: PChar
+// ): PMagickWand; cdecl; external WandExport;
+function MagickPreviewImages(wand: PMagickWand; const preview: PreviewType): PMagickWand; cdecl; external WandExport;
+function MagickSteganoImage(wand: PMagickWand; const watermark_wand: PMagickWand;
+ const offset: Integer): PMagickWand; cdecl; external WandExport;
+function MagickStereoImage(wand: PMagickWand; const offset_wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+function MagickTextureImage(wand: PMagickWand; const texture_wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+function MagickTransformImage(wand: PMagickWand; const crop, geometry: PChar): PMagickWand; cdecl; external WandExport;
+function NewMagickWandFromImage(para1: PImage): PMagickWand; cdecl; external WandExport;
+
+function MagickGetImageHistogram(wand: PMagickWand; number_colors: PCardinal): PPPixelWand; cdecl; external  WandExport;
+
+function MagickGetImageRenderingIntent(wand: PMagickWand): RenderingIntent; cdecl; external WandExport;
+
+function MagickGetImageUnits(wand: PMagickWand): ResolutionType; cdecl; external WandExport;
+
+{function MagickGetImageBlob(wand: PMagickWand; length: Psize_t): PByte; cdecl; external WandExport;
+function (wand: PMagickWand): PByte; cdecl; external WandExport;
+function (wand: PMagickWand): PByte; cdecl; external WandExport;
+function (wand: PMagickWand): PByte; cdecl; external WandExport;
+
+extern WandExport unsigned char
+  *MagickGetImageBlob(MagickWand *,size_t *),
+  *MagickGetImagesBlob(MagickWand *,size_t *),
+  *MagickGetImageProfile(MagickWand *,const char *,unsigned long *),
+  *MagickRemoveImageProfile(MagickWand *,const char *,unsigned long *);}
+
+function MagickGetImageColors(wand: PMagickWand): Cardinal; cdecl; external WandExport;
+function MagickGetImageCompressionQuality(wand: PMagickWand): Cardinal; cdecl; external WandExport;
+function MagickGetImageDelay(wand: PMagickWand): Cardinal; cdecl; external WandExport;
+function MagickGetImageChannelDepth(wand: PMagickWand; const channel: ChannelType): Cardinal; cdecl; external WandExport;
+function MagickGetImageDepth(wand: PMagickWand): Cardinal; cdecl; external WandExport;
+function MagickGetImageHeight(wand: PMagickWand): Cardinal; cdecl; external WandExport;
+function MagickGetImageIterations(wand: PMagickWand): Cardinal; cdecl; external WandExport;
+function MagickGetImageScene(wand: PMagickWand): Cardinal; cdecl; external WandExport;
+function MagickGetImageWidth(wand: PMagickWand): Cardinal; cdecl; external WandExport;
+function MagickGetNumberImages(wand: PMagickWand): Cardinal; cdecl; external WandExport;
+
+//function MagickGetImageVirtualPixelMethod(wand: PMagickWand): VirtualPixelMethod; cdecl; external WandExport;
+
+{
+  Deprecated methods.
+}
+{extern WandExport char
+  *MagickDescribeImage(MagickWand *);
+
+extern WandExport MagickBooleanType
+  MagickOpaqueImage(MagickWand *,const PixelWand *,const PixelWand *,
+    const double),
+  MagickSetImageOption(MagickWand *,const char *,const char *,const char *),
+  MagickTransparentImage(MagickWand *,const PixelWand *,const Quantum,
+    const double);
+
+extern WandExport MagickWand
+  *MagickRegionOfInterestImage(MagickWand *,const unsigned long,
+	  const unsigned long,const long,const long);
+
+extern WandExport unsigned char
+  *MagickWriteImageBlob(MagickWand *,size_t *);
+}

+ 71 - 0
packages/base/imagemagick/wand/magick_wand.pas

@@ -0,0 +1,71 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick MagickWand API.
+  
+  Converted from c by: Felipe Monteiro de Carvalho Dez/2005
+}
+{Version 0.2}
+unit magick_wand;
+
+{$IFDEF FPC}
+  {$mode objfpc}
+{$ENDIF}
+
+{$PACKRECORDS C}
+{$MINENUMSIZE 1}
+
+interface
+
+uses ImageMagick;
+
+type
+  MagickWand = record
+    id: Cardinal;
+    name: array[0..MaxTextExtent] of Char;
+    exception: ExceptionInfo;
+    image_info: PImageInfo;
+    quantize_info: QuantizeInfo;
+    images: Image;
+    iterator, debug: MagickBooleanType;
+    signature: Cardinal;
+  end;
+
+  PMagickWand = ^MagickWand;
+
+{$include pixel_wand.inc}
+{$include drawing_wand.inc}
+{$include magick_attribute.inc}
+{$include magick_image.inc}
+{$include pixel_iterator.inc}
+
+function IsMagickWand(const wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+function MagickClearException(wand: PMagickWand): MagickBooleanType; cdecl; external WandExport;
+
+function CloneMagickWand(const wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+function DestroyMagickWand(wand: PMagickWand): PMagickWand; cdecl; external WandExport;
+function NewMagickWand: PMagickWand; cdecl; external WandExport;
+
+procedure ClearMagickWand(wand: PMagickWand); cdecl; external WandExport;
+procedure MagickWandGenesis; cdecl; external WandExport;
+procedure MagickWandTerminus; cdecl; external WandExport;
+function MagickRelinquishMemory(resource: Pointer): Pointer; cdecl; external WandExport;
+procedure MagickResetIterator(wand: PMagickWand); cdecl; external WandExport;
+procedure MagickSetFirstIterator(wand: PMagickWand); cdecl; external WandExport;
+procedure MagickSetLastIterator(wand: PMagickWand); cdecl; external WandExport;
+
+implementation
+
+end.

+ 74 - 0
packages/base/imagemagick/wand/pixel_iterator.inc

@@ -0,0 +1,74 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  Pixel Iterator Methods.
+}
+
+type
+  PixelIterator = record
+    id: Cardinal;
+
+    name: array[0..MaxTextExtent] of char;
+
+    exception: ExceptionInfo;
+
+    view: PViewInfo;
+
+    region: RectangleInfo;
+
+    y: Integer;
+
+    pixel_wand: PPPixelWand;
+
+    debug: MagickBooleanType;
+
+    signature: Cardinal;
+  end;
+  
+  PPixelIterator = ^PixelIterator;
+
+
+function PixelGetIteratorException(const iterator: PPixeliterator;
+ severity: PExceptionType): PChar; cdecl; external WandExport;
+
+function IsPixelIterator(const iterator: PPixeliterator): MagickBooleanType; cdecl; external WandExport;
+function PixelClearIteratorException(iterator: PPixeliterator): MagickBooleanType; cdecl; external WandExport;
+function PixelSetIteratorRow(iterator: PPixeliterator;
+ const row: Integer): MagickBooleanType; cdecl; external WandExport;
+function PixelSyncIterator(iterator: PPixeliterator): MagickBooleanType; cdecl; external WandExport;
+
+function DestroyPixelIterator(iterator: PPixeliterator): PPixelIterator; cdecl; external WandExport;
+function NewPixelIterator(wand: PMagickWand): PPixelIterator; cdecl; external WandExport;
+function NewPixelRegionIterator(
+ wand: PMagickWand; const x, y: Integer; const columns, rows: Cardinal;
+ const modify: MagickBooleanType): PPixelIterator; cdecl; external WandExport;
+
+function PixelGetNextIteratorRow(iterator: PPixeliterator; var wandCount: Cardinal): PPPixelWand; cdecl; external WandExport;
+function PixelGetPreviousIteratorRow(iterator: PPixeliterator; var wandCount: Cardinal): PPPixelWand; cdecl; external WandExport;
+
+procedure ClearPixelIterator(iterator: PPixeliterator); cdecl; external WandExport;
+procedure PixelResetIterator(iterator: PPixeliterator); cdecl; external WandExport;
+procedure PixelSetFirstIteratorRow(iterator: PPixeliterator); cdecl; external WandExport;
+procedure PixelSetLastIteratorRow(iterator: PPixeliterator); cdecl; external WandExport;
+
+{
+  Deprecated.
+}
+{extern WandExport char
+  *PixelIteratorGetException(const PixelIterator *,ExceptionType *);
+
+extern WandExport PixelWand
+  **PixelGetNextRow(PixelIterator *);}
+

+ 109 - 0
packages/base/imagemagick/wand/pixel_wand.inc

@@ -0,0 +1,109 @@
+{
+  Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
+  dedicated to making software imaging solutions freely available.
+  
+  You may not use this file except in compliance with the License.
+  obtain a copy of the License at
+  
+    http://www.imagemagick.org/script/license.php
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  ImageMagick pixel wand API.
+}
+
+
+{
+  Declaration from pixel-wand.c
+}
+type
+  PixelWand = record
+    id: Cardinal;
+
+    name: array[1..MaxTextExtent] of char;
+
+    exception: ExceptionInfo;
+
+    pixel: MagickPixelPacket;
+
+    count: Cardinal;
+
+    debug: MagickBooleanType;
+
+    signature: Cardinal;
+  end;
+  
+  PPixelWand = ^PixelWand;
+  
+  PPPixelWand = ^PPixelWand;
+  
+
+function PixelGetException(const wand: PPixelWand; severity: PExceptionType): PChar; cdecl; external WandExport;
+function PixelGetColorAsString(const wand: PPixelWand): PChar; cdecl; external WandExport;
+
+function PixelGetAlpha(const wand: PPixelWand): Double; cdecl; external WandExport;
+function PixelGetBlack(const wand: PPixelWand): Double; cdecl; external WandExport;
+function PixelGetBlue(const wand: PPixelWand): Double; cdecl; external WandExport;
+function PixelGetCyan(const wand: PPixelWand): Double; cdecl; external WandExport;
+function PixelGetGreen(const wand: PPixelWand): Double; cdecl; external WandExport;
+function PixelGetMagenta(const wand: PPixelWand): Double; cdecl; external WandExport;
+function PixelGetOpacity(const wand: PPixelWand): Double; cdecl; external WandExport;
+function PixelGetRed(const wand: PPixelWand): Double; cdecl; external WandExport;
+function PixelGetYellow(const wand: PPixelWand): Double; cdecl; external WandExport;
+
+function PixelGetIndex(const wand: PPixelWand): IndexPacket; cdecl; external WandExport;
+
+function IsPixelWand(const wand: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function IsPixelWandSimilar(p: PPixelWand; q: PPixelWand;
+ const fuzz: double): MagickBooleanType; cdecl; external WandExport;
+function PixelClearException(wand: PPixelWand): MagickBooleanType; cdecl; external WandExport;
+function PixelSetColor(wand: PPixelWand; const color: PChar): MagickBooleanType; cdecl; external WandExport;
+
+function DestroyPixelWand(wand: PPixelWand): PPixelWand; cdecl; external WandExport;
+function DestroyPixelWands(wand: PPPixelWand;
+ const number_wands: Cardinal): PPPixelWand; cdecl; external WandExport;
+function NewPixelWand: PPixelWand; cdecl; external WandExport;
+function NewPixelWands(const number_wands: Cardinal): PPPixelWand; cdecl; external WandExport;
+
+function PixelGetAlphaQuantum(const wand: PPixelWand): Quantum; cdecl; external  WandExport;
+function PixelGetBlackQuantum(const wand: PPixelWand): Quantum; cdecl; external WandExport;
+function PixelGetBlueQuantum(const wand: PPixelWand): Quantum; cdecl; external WandExport;
+function PixelGetCyanQuantum(const wand: PPixelWand): Quantum; cdecl; external WandExport;
+function PixelGetGreenQuantum(const wand: PPixelWand): Quantum; cdecl; external WandExport;
+function PixelGetMagentaQuantum(const wand: PPixelWand): Quantum; cdecl; external WandExport;
+function PixelGetOpacityQuantum(const wand: PPixelWand): Quantum; cdecl; external WandExport;
+function PixelGetRedQuantum(const wand: PPixelWand): Quantum; cdecl; external WandExport;
+function PixelGetYellowQuantum(const wand: PPixelWand): Quantum; cdecl; external WandExport;
+
+function PixelGetColorCount(const wand: PPixelWand): Cardinal; cdecl; external WandExport;
+
+procedure ClearPixelWand(wand: PPixelWand); cdecl; external WandExport;
+procedure PixelGetMagickColor(const wand: PPixelWand; packet: PMagickPixelPacket); cdecl; external WandExport;
+procedure PixelGetQuantumColor(const wand: PPixelWand; color: PPixelPacket); cdecl; external WandExport;
+procedure PixelSetAlpha(wand: PPixelWand; const opacity: Double); cdecl; external WandExport;
+procedure PixelSetAlphaQuantum(wand: PPixelWand; const opacity: Quantum); cdecl; external WandExport;
+procedure PixelSetBlack(wand: PPixelWand; const opacity: Double); cdecl; external WandExport;
+procedure PixelSetBlackQuantum(wand: PPixelWand; const opacity: Quantum); cdecl; external WandExport;
+procedure PixelSetBlue(wand: PPixelWand; const opacity: Double); cdecl; external WandExport;
+procedure PixelSetBlueQuantum(wand: PPixelWand; const opacity: Quantum); cdecl; external WandExport;
+procedure PixelSetColorCount(wand: PPixelWand; const count: Cardinal); cdecl; external WandExport;
+procedure PixelSetCyan(wand: PPixelWand; const opacity: Double); cdecl; external WandExport;
+procedure PixelSetCyanQuantum(wand: PPixelWand; const opacity: Quantum); cdecl; external WandExport;
+procedure PixelSetGreen(wand: PPixelWand; const opacity: Double); cdecl; external WandExport;
+procedure PixelSetGreenQuantum(wand: PPixelWand; const opacity: Quantum); cdecl; external WandExport;
+procedure PixelSetIndex(wand: PPixelWand; const index: IndexPacket); cdecl; external WandExport;
+procedure PixelSetMagenta(wand: PPixelWand; const opacity: Double); cdecl; external WandExport;
+procedure PixelSetMagentaQuantum(wand: PPixelWand; const opacity: Quantum); cdecl; external WandExport;
+procedure PixelSetOpacity(wand: PPixelWand; const opacity: Double); cdecl; external WandExport;
+procedure PixelSetOpacityQuantum(wand: PPixelWand; const opacity: Quantum); cdecl; external WandExport;
+procedure PixelSetQuantumColor(wand: PPixelWand; const color: PPixelPacket); cdecl; external WandExport;
+procedure PixelSetRed(wand: PPixelWand; const opacity: Double); cdecl; external WandExport;
+procedure PixelSetRedQuantum(wand: PPixelWand; const opacity: Quantum); cdecl; external WandExport;
+procedure PixelSetYellow(wand: PPixelWand; const opacity: Double); cdecl; external WandExport;
+procedure PixelSetYellowQuantum(wand: PPixelWand; const opacity: Quantum); cdecl; external WandExport;
+
+

+ 1 - 0
packages/base/mysql/mysql.inc

@@ -1629,6 +1629,7 @@ begin
   else if UnloadLibrary(MysqlLibraryHandle) then 
     begin
     Dec(RefCount);
+    MysqlLibraryHandle := NilHandle;
     LoadedLibrary:='';
     end;
 end;

+ 53 - 36
packages/base/netdb/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/02/13]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/06/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-darwin 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-palmos arm-wince powerpc64-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince 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-palmos arm-wince arm-gba powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -346,11 +346,14 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_UNITS+=uriparser
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=uriparser
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_UNITS+=uriparser  netdb
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 override TARGET_EXAMPLES+=testuri
@@ -362,16 +365,16 @@ ifeq ($(FULL_TARGET),i386-os2)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 override TARGET_EXAMPLES+=testuri
@@ -380,13 +383,13 @@ ifeq ($(FULL_TARGET),i386-netware)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_EXAMPLES+=testuri
@@ -401,13 +404,13 @@ ifeq ($(FULL_TARGET),i386-wince)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 override TARGET_EXAMPLES+=testuri
@@ -416,46 +419,46 @@ ifeq ($(FULL_TARGET),m68k-atari)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 override TARGET_EXAMPLES+=testuri
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 override TARGET_EXAMPLES+=testuri
@@ -463,8 +466,11 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_EXAMPLES+=testuri
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_EXAMPLES+=testuri
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet
+override TARGET_EXAMPLES+=testuri  testdns testhst testsvc testnet testhosts
 endif
 override INSTALL_FPCPACKAGE=y
 ifdef REQUIRE_UNITSDIR
@@ -675,6 +681,7 @@ STATICLIBEXT=.a
 SHAREDLIBEXT=.so
 SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 ifeq ($(OS_TARGET),go32v1)
@@ -787,6 +794,11 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=dwn
 endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
 else
 ifeq ($(OS_TARGET),go32v1)
 PPUEXT=.pp1
@@ -1107,12 +1119,17 @@ endif
 endif
 export ZIPPROG
 ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
 TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG= __missing_command_TARPROG
 else
 TARPROG:=$(firstword $(TARPROG))
 endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
 endif
 export TARPROG
 ASNAME=$(BINUTILSPREFIX)as
@@ -1314,6 +1331,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1349,6 +1369,9 @@ endif
 ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
 ifeq ($(OS_SOURCE),openbsd)
 override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
@@ -1383,14 +1406,15 @@ override FPCOPT+=-gl
 override FPCOPTDEF+=DEBUG
 endif
 ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
 ifeq ($(CPU_TARGET),i386)
 FPCCPUOPT:=-OG2p3
-else
+endif
 ifeq ($(CPU_TARGET),powerpc)
 FPCCPUOPT:=-O1r
-else
-FPCCPUOPT:=
 endif
+else
+FPCCPUOPT:=-O2
 endif
 override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
 override FPCOPTDEF+=RELEASE
@@ -1399,9 +1423,7 @@ ifdef STRIP
 override FPCOPT+=-Xs
 endif
 ifdef OPTIMIZE
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-OG2p3
-endif
+override FPCOPT+=-O2
 endif
 ifdef VERBOSE
 override FPCOPT+=-vwni
@@ -1445,11 +1467,6 @@ 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 CREATESHARED
 override FPCOPT+=-Cg
 ifeq ($(CPU_TARGET),i386)
@@ -1506,7 +1523,7 @@ ifneq ($(TARGET_EXAMPLES),)
 HASEXAMPLES=1
 override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .pp,$(TARGET_EXAMPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)) $(addsuffix .lpr,$(TARGET_EXAMPLES)) $(addsuffix .dpr,$(TARGET_EXAMPLES)))
 override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))
-override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
+override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
 override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
 ifeq ($(OS_TARGET),os2)
 override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
@@ -1600,7 +1617,7 @@ 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)))
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
 ifneq ($(UNITTARGETDIRPREFIX),)
 override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
 override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
@@ -1752,7 +1769,7 @@ ifdef CLEAN_UNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
 endif
 ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
 ifdef DEBUGSYMEXT
 override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
 endif

+ 6 - 6
packages/base/netdb/Makefile.fpc

@@ -14,12 +14,12 @@ units_openbsd=netdb
 units_netbsd=netdb
 units_darwin=netdb
 units_solaris=netdb
-examples_linux=testdns testhst testsvc testnet
-examples_freebsd=testdns testhst testsvc testnet
-examples_openbsd=testdns testhst testsvc testnet
-examples_netbsd=testdns testhst testsvc testnet
-examples_darwin=testdns testhst testsvc testnet
-examples_solaris=testdns testhst testsvc testnet
+examples_linux=testdns testhst testsvc testnet testhosts
+examples_freebsd=testdns testhst testsvc testnet testhosts
+examples_openbsd=testdns testhst testsvc testnet testhosts
+examples_netbsd=testdns testhst testsvc testnet testhosts
+examples_darwin=testdns testhst testsvc testnet testhosts
+examples_solaris=testdns testhst testsvc testnet testhosts
 examples=testuri
 
 [require]

+ 288 - 151
packages/base/netdb/netdb.pp

@@ -63,24 +63,35 @@ Type
     Addr : THostAddr;
     Aliases : String;
   end;  
+  PHostEntry = ^THostEntry;
+  THostEntryArray = Array of THostEntry;
   
   TNetworkEntry = Record
     Name : String;
     Addr : TNetAddr;
     Aliases : String;
   end;  
+  PNetworkEntry = ^TNetworkEntry;
 
   TProtocolEntry = Record
     Name : String;
     Number : integer;
     Aliases : String;
   end;  
+  PProtocolEntry = ^TProtocolEntry;
+
+  PHostListEntry = ^THostListEntry;
+  THostListEntry = Record
+    Entry : THostEntry;
+    Next : PHostListEntry;
+  end;
 
 Var  
   DNSServers            : TDNSServerArray;
   DNSServerCount        : Integer;
   DefaultDomainList     : String;
   CheckResolveFileAge   : Boolean; 
+  CheckHostsFileAge     : Boolean; 
   TimeOutS,TimeOutMS    : Longint;
   
   
@@ -111,6 +122,11 @@ Function GetProtocolByName(ProtoName: String;  Var H : TProtocolEntry) : boolean
 Function GetProtocolByNumber(proto: Integer;  Var H : TProtocolEntry) : boolean;
 
 
+
+Function ProcessHosts(FileName : String) : PHostListEntry;
+Function FreeHostsList(var List : PHostListEntry) : Integer;
+Procedure HostsListToArray(var List : PHostListEntry; Var Hosts : THostEntryArray; FreeList : Boolean);
+
 Implementation
 
 uses 
@@ -162,13 +178,250 @@ Type
     RDLength : Word;
   end;
 
+{ ---------------------------------------------------------------------
+    Some Parsing routines
+  ---------------------------------------------------------------------}
+
+Const 
+  Whitespace = [' ',#9];
+
+Function NextWord(Var Line : String) : String;
+
+Var 
+  I,J : Integer;
+
+begin
+  I:=1;
+  While (I<=Length(Line)) and (Line[i] in Whitespace) do
+    inc(I);
+  J:=I;
+  While (J<=Length(Line)) and Not (Line[J] in WhiteSpace) do
+    inc(j);
+  Result:=Copy(Line,I,J-I);  
+  Delete(Line,1,J);  
+end;
+  
+Function StripComment(var L : String) : Boolean;
+
 Var
-  ResolveFileAge  : Longint;
-  ResolveFileName : String;
+  i : Integer;
+
+begin
+  I:=Pos('#',L);
+  If (I<>0) then
+    L:=Copy(L,1,I-1)
+  else
+    begin
+      I:=Pos(';',L);
+      If (I<>0) then
+        L:=Copy(L,1,I-1)
+    end;
+  Result:=Length(L)>0;
+end;
+
+Function MatchNameOrAlias(Const Entry,Name: String; Aliases : String) : Boolean;
+
+Var
+  P : Integer;
+  A : String;
+
+begin
+  Result:=CompareText(Entry,Name)=0;
+  If Not Result then
+    While (Not Result) and (Length(Aliases)>0) do
+      begin
+      P:=Pos(',',Aliases);
+      If (P=0) then
+        P:=Length(Aliases)+1;
+      A:=Copy(Aliases,1,P-1);
+      Delete(Aliases,1,P);
+      Result:=CompareText(A,Entry)=0;
+      end;
+end;
+
+{ ---------------------------------------------------------------------
+    hosts processing
+  ---------------------------------------------------------------------}
+
+Function GetAddr(Var L : String; Var Addr : THostAddr) : Boolean;
+
+Var
+  S : String;
+  i,p,a : Integer;
+  
+begin
+  Result:=True;
+  S:=NextWord(L);
+  Addr:=StrToNetAddr(S);
+//  Writeln(s,'->',Addr.s_bytes[1],'.',Addr.s_bytes[2],'.',Addr.s_bytes[3],'.',Addr.s_bytes[4]);
+  Result:=Addr.s_bytes[1]<>0;
+end;
+
+
+Function FillHostEntry (Var Entry : THostEntry; L: String) : boolean;
+
+Var
+  H : String;
+
+begin
+  Repeat
+  H:=NextWord(L);
+  If (H<>'') then
+    if (Entry.Name='') then
+      Entry.Name:=H
+    else  
+      begin
+      If (Entry.Aliases<>'') then
+        Entry.Aliases:=Entry.Aliases+',';
+      Entry.Aliases:=Entry.Aliases+H;
+      end;
+  until (H='');
+end;
+
+Function ProcessHosts(FileName : String) : PHostListEntry;
+
+Var
+  F : Text;
+  L : String;
+  A : THostAddr;
+  T : PHostListEntry;
+  
+begin
+  Result:=Nil;
+  Assign(F,FileName);
+  {$I-}
+  Reset(F);
+  {$I+};
+  If (IOResult<>0) then
+    Exit;
+  Try  
+    While Not EOF(F) do
+      begin
+      Readln(F,L);
+      If StripComment(L) then
+        begin
+        If GetAddr(L,A) then
+          begin
+          T:=New(PHostListEntry);
+          T^.Entry.Addr:=A;
+          FillHostEntry(T^.Entry,L);
+          T^.Next:=Result;
+          Result:=T;
+          end;
+        end;
+      end;
+  Finally  
+    Close(F);
+  end;
+end;
+
+{ Internal lookup, used in GetHostByName and friends. }
+
+Var
+  HostsList : PHostListEntry = Nil;  
+  HostsFileAge  : Longint;
+  HostsFileName : String;
+
+Function FreeHostsList(var List : PHostListEntry) : Integer;
+
+Var
+  P : PHostListEntry;
+
+begin
+  Result:=0;
+  While (List<>Nil) do
+    begin
+    Inc(Result);
+    P:=List^.Next;
+    FreeMem(List);
+    List:=P;
+    end;
+end;
+
+Procedure HostsListToArray(var List : PHostListEntry; Var Hosts : THostEntryArray; FreeList : Boolean);
+
+Var
+  P : PHostListEntry;
+  Len : Integer;
+
+begin
+  Len:=0;
+  P:=List;
+  While P<> Nil do
+    begin
+    Inc(Len);
+    P:=P^.Next;
+    end;
+  SetLength(Hosts,Len);
+  If (Len>0) then
+    begin
+    Len:=0;
+    P:=List;
+    While (P<>Nil) do
+      begin
+      Hosts[Len]:=P^.Entry;
+      P:=P^.Next;
+      Inc(Len);
+      end;
+    end;
+  If FreeList then
+    FreeHostsList(List);
+end;
+
+Procedure CheckHostsFile;
+
+Var
+  F : Integer;
+
+begin
+  If CheckHostsFileAge then
+    begin
+    F:=FileAge(SHostsFile);
+    If HostsFileAge<F then
+      begin
+      // Rescan.
+      FreeHostsList(HostsList);
+      HostsList:=ProcessHosts(SHostsFile);
+      HostsFileAge:=F;
+      end;
+    end;  
+end;
+
+Function FindHostEntryInHostsFile(N: String; Addr: THostAddr; Var H : THostEntry) : boolean;
+
+Var
+  F : Text;
+  HE : THostEntry;
+  P : PHostListEntry;
+  
+begin
+  Result:=False;
+  CheckHostsFile;
+  P:=HostsList;
+  While (Not Result) and (P<>Nil) do
+    begin
+    HE:=P^.Entry;
+    If (N<>'') then
+      Result:=MatchNameOrAlias(N,HE.Name,HE.Aliases)
+    else
+      Result:=Cardinal(hosttonet(Addr))=Cardinal(HE.Addr);
+    P:=P^.Next;  
+    end; 
+ If Result then
+   begin
+   H.Name:=HE.Name;
+   H.Addr:=nettohost(HE.Addr);
+   H.Aliases:=HE.Aliases;
+   end;
+end;
 
 { ---------------------------------------------------------------------
    Resolve.conf handling
   ---------------------------------------------------------------------}
+
+Var
+  ResolveFileAge  : Longint;
+  ResolveFileName : String;
   
 Function GetDNSServers(Fn : String) : Integer;
 
@@ -177,7 +430,8 @@ Var
   L : String;
   I : Integer;
   H : THostAddr;
-
+  E : THostEntry;
+  
   Function CheckDirective(Dir : String) : Boolean;
   
   Var
@@ -207,28 +461,25 @@ begin
     While not EOF(R) do
       begin
       Readln(R,L);
-      I:=Pos('#',L);
-      If (I<>0) then
-        L:=Copy(L,1,I-1)
-      else
-        begin
-          I:=Pos(';',L);
-          If (I<>0) then
-            L:=Copy(L,1,I-1)
-	end;
-      If CheckDirective('nameserver') then
-        begin
-        H:=HostToNet(StrToHostAddr(L));
-        If H.s_bytes[1]<>0 then
+      if StripComment(L) then
+        If CheckDirective('nameserver') then
           begin
-          Inc(Result);
-          DNSServers[Result]:=H;
-          end;
-        end
-      else if CheckDirective('domain') then
-        DefaultDomainList:=L
-      else if CheckDirective('search') then
-        DefaultDomainList:=L;
+          H:=HostToNet(StrToHostAddr(L));
+          If (H.s_bytes[1]<>0) then
+            begin
+            Inc(Result);
+            DNSServers[Result]:=H;
+            end
+          else if FindHostEntryInHostsFile(L,H,E) then
+            begin
+            Inc(Result);
+            DNSServers[Result]:=E.Addr;
+            end;
+          end
+        else if CheckDirective('domain') then
+          DefaultDomainList:=L
+        else if CheckDirective('search') then
+          DefaultDomainList:=L;
       end;
   Finally
     Close(R);
@@ -794,133 +1045,6 @@ begin
     end;
 end;
 
-{ ---------------------------------------------------------------------
-    Some Parsing routines
-  ---------------------------------------------------------------------}
-
-Const 
-  Whitespace = [' ',#9];
-
-Function NextWord(Var Line : String) : String;
-
-Var 
-  I,J : Integer;
-
-begin
-  I:=1;
-  While (I<=Length(Line)) and (Line[i] in Whitespace) do
-    inc(I);
-  J:=I;
-  While (J<=Length(Line)) and Not (Line[J] in WhiteSpace) do
-    inc(j);
-  Result:=Copy(Line,I,J-I);  
-  Delete(Line,1,J);  
-end;
-  
-Procedure StripComment(Var line : String);
-
-Var
-  P : Integer;
-
-begin
-  P:=Pos('#',Line);
-  If (P<>0) then
-    Line:=Trim(Copy(Line,1,P-1));
-end;
-
-Function MatchNameOrAlias(Const Entry,Name: String; Aliases : String) : Boolean;
-
-Var
-  P : Integer;
-  A : String;
-
-begin
-  Result:=CompareText(Entry,Name)=0;
-  If Not Result then
-    While (Not Result) and (Length(Aliases)>0) do
-      begin
-      P:=Pos(',',Aliases);
-      If (P=0) then
-        P:=Length(Aliases)+1;
-      A:=Copy(Aliases,1,P-1);
-      Delete(Aliases,1,P);
-      Result:=CompareText(A,Entry)=0;
-      end;
-end;
-
-{ ---------------------------------------------------------------------
-    /etc/hosts handling.
-  ---------------------------------------------------------------------}
-
-Function GetNextHostEntry(var F : Text; Var H : THostEntry): boolean;
-
-Var
-  Line,S : String;
-  
-begin
-  Result:=False;
-  Repeat
-    ReadLn(F,Line);
-    StripComment(Line);
-    S:=NextWord(Line);
-    If (S<>'') then
-      begin
-      H.Addr:=StrTonetAddr(S);		// endianness problem here. (fixed)
-      if (H.Addr.s_bytes[1]<>0) then
-        begin
-        S:=NextWord(Line);
-        If (S<>'') then
-          begin
-          H.Name:=S;
-          Result:=True;
-          H.Aliases:='';
-          Repeat
-            S:=NextWord(line);
-            If (S<>'') then
-              If (H.Aliases='') then
-                H.Aliases:=S
-              else
-                H.Aliases:=H.Aliases+','+S;  
-          until (S='');
-          end;
-        end;      
-      end;
-  until Result or EOF(F);
-end;  
-
-Function FindHostEntryInHostsFile(N: String; Addr: THostAddr; Var H : THostEntry) : boolean;
-
-Var
-  F : Text;
-  HE : THostEntry;
-  
-begin
-  Result:=False;
-  If FileExists(SHostsFile) then
-    begin
-    Assign(F,SHostsFile);
-    {$i-}
-    Reset(F);
-    {$i+}
-    If (IOResult=0) then
-      begin
-      While Not Result and GetNextHostEntry(F,HE) do
-        begin
-        If (N<>'') then
-          Result:=MatchNameOrAlias(N,HE.Name,HE.Aliases)
-        else
-          Result:=Cardinal(hosttonet(Addr))=Cardinal(HE.Addr);
-        end; 
-      Close(f);
-      If Result then
-        begin
-        H.Name:=HE.Name;
-        H.Addr:=nettohost(HE.Addr);
-        H.Aliases:=HE.Aliases;
-        end;
-      end;  
-    end;
-end;
 
 //const NoAddress : in_addr = (s_addr: 0);
 
@@ -937,6 +1061,7 @@ begin
   Result:=FindHostEntryInHostsFile('',Addr,H);
 end;
 
+
 { ---------------------------------------------------------------------
     /etc/protocols handling.
   ---------------------------------------------------------------------}
@@ -1232,11 +1357,23 @@ Var
 begin
   TimeOutS :=5;
   TimeOutMS:=0;
+  CheckHostsFileAge:=False;
+  If FileExists(SHostsFile) then
+    HostsList:=ProcessHosts(SHostsFile);
   CheckResolveFileAge:=False;
   If FileExists(SResolveFile) then
     GetDNsservers(SResolveFile);
 end;
 
+Procedure DoneResolver;
+
 begin
+  FreeHostsList(HostsList);
+end;
+
+
+Initialization
   InitResolver;
+Finalization
+  DoneResolver;  
 end.

+ 44 - 0
packages/base/netdb/testhosts.pp

@@ -0,0 +1,44 @@
+{$mode objfpc}
+{$h+}
+program testhosts;
+
+uses sockets,netdb;
+
+Const 
+{$ifdef unix}
+  hosts = '/etc/hosts';
+{$else}
+{$ifdef win32}
+  hosts = 'c:\windows\system32\drivers\etc\hosts';
+{$else}
+  hosts = 'hosts';  { Fallback !! }
+{$endif}
+{$endif}  
+  
+var
+  L,P : PHostListEntry;
+  I : Integer;
+
+begin
+  L:=ProcessHosts(Hosts);
+  Try
+    P:=L;
+    I:=0;
+    While (P<>Nil) do 
+      begin
+      With P^ do
+        begin
+        Inc(I);
+        Write(i:3,' Address : ',HostAddrToStr(NetToHost(P^.entry.addr)):15);
+        Write(' hostname : ',P^.entry.Name);
+        If (P^.entry.Aliases<>'') then
+          Writeln(' Aliases : ',P^.entry.Aliases)
+        else
+          Writeln;   
+        P:=P^.next;  
+        end;
+      end
+  finally
+    FreeHostslist(L);    
+  end;   
+end.  

+ 73 - 53
packages/base/sqlite/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/02/06]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/06/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-palmos arm-wince powerpc64-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince 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-palmos arm-wince arm-gba powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -233,118 +233,124 @@ PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/ext
 override PACKAGE_NAME=sqlite
 override PACKAGE_VERSION=2.0.3
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=sqlite sqlite3
+override TARGET_UNITS+=sqlite sqlite3 sqlitedb
 endif
 override INSTALL_FPCPACKAGE=y
 override SHARED_BUILD=n
@@ -557,6 +563,7 @@ STATICLIBEXT=.a
 SHAREDLIBEXT=.so
 SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 ifeq ($(OS_TARGET),go32v1)
@@ -669,6 +676,11 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=dwn
 endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
 else
 ifeq ($(OS_TARGET),go32v1)
 PPUEXT=.pp1
@@ -989,12 +1001,17 @@ endif
 endif
 export ZIPPROG
 ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
 TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG= __missing_command_TARPROG
 else
 TARPROG:=$(firstword $(TARPROG))
 endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
 endif
 export TARPROG
 ASNAME=$(BINUTILSPREFIX)as
@@ -1118,6 +1135,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1193,6 +1213,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1228,6 +1251,9 @@ endif
 ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
 ifeq ($(OS_SOURCE),openbsd)
 override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
@@ -1262,14 +1288,15 @@ override FPCOPT+=-gl
 override FPCOPTDEF+=DEBUG
 endif
 ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
 ifeq ($(CPU_TARGET),i386)
 FPCCPUOPT:=-OG2p3
-else
+endif
 ifeq ($(CPU_TARGET),powerpc)
 FPCCPUOPT:=-O1r
-else
-FPCCPUOPT:=
 endif
+else
+FPCCPUOPT:=-O2
 endif
 override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
 override FPCOPTDEF+=RELEASE
@@ -1278,9 +1305,7 @@ ifdef STRIP
 override FPCOPT+=-Xs
 endif
 ifdef OPTIMIZE
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-OG2p3
-endif
+override FPCOPT+=-O2
 endif
 ifdef VERBOSE
 override FPCOPT+=-vwni
@@ -1324,11 +1349,6 @@ 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 CREATESHARED
 override FPCOPT+=-Cg
 ifeq ($(CPU_TARGET),i386)
@@ -1461,7 +1481,7 @@ 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)))
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
 ifneq ($(UNITTARGETDIRPREFIX),)
 override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
 override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
@@ -1613,7 +1633,7 @@ ifdef CLEAN_UNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
 endif
 ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
 ifdef DEBUGSYMEXT
 override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
 endif

+ 1 - 1
packages/base/sqlite/Makefile.fpc

@@ -7,7 +7,7 @@ name=sqlite
 version=2.0.3
 
 [target]
-units=sqlite sqlite3
+units=sqlite sqlite3 sqlitedb
 
 [require]
 

+ 6 - 0
packages/base/sqlite/sqlite.pp

@@ -1,5 +1,11 @@
 {$mode objfpc}
+
+{$ifdef bsd}
+  {$linklib c}
+{$endif}
+
 unit sqlite;
+
 interface
 
 {

+ 6 - 0
packages/base/sqlite/sqlite3.pp

@@ -1,4 +1,10 @@
 {$mode objfpc}
+
+{$ifdef BSD}
+  {$linklib c}
+  {$linklib pthread}
+{$endif}
+
 unit sqlite3;
 
 interface

+ 3 - 7
packages/base/sqlite/sqlitedb.pas

@@ -323,7 +323,7 @@ end;
 function TSQLite.Query(Sql: String; Table: TStrings ): boolean;
 //var
 //  fPMsg: PChar;
-var Psql : pchar;
+//var Psql : pchar;
 begin
   fError := SQLITE_ERROR;
   if fIsOpen then
@@ -333,13 +333,10 @@ begin
     fTable := Table;
     if fTable <> nil then
       fTable.Clear;
-   Psql:=StrAlloc (length(Sql)+1);
-   strpcopy(Psql,Sql);
    List_FieldName.clear;
    List_Field.clear;
    Nb_Champ:=-1;
-    fError := SQLite_Exec(fSQLite, Psql, @ExecCallback, Self, @fPMsg);
-    strdispose(Psql);
+    fError := SQLite_Exec(fSQLite, PChar(sql), @ExecCallback, Self, @fPMsg);
     SQLite_FreeMem(fPMsg);
     fChangeCount := SQLite_Changes(fSQLite);
     fTable := nil;
@@ -348,7 +345,7 @@ begin
       fOnQueryComplete(Self);
   end;
   fMsg := ErrorMessage(fError);
-  Result := (fError <> SQLITE_OK);
+  Result := (fError = SQLITE_OK);
 end;
 
 function TSQLite.Cancel: boolean;
@@ -385,7 +382,6 @@ end;
 
 function TSQLite.ErrorMessage(ErrNo: Integer): string;
 begin
-  exit;
   if ErrNo = 0 then
     Result := MsgNoError
   else

+ 3 - 4
packages/base/sqlite/test.pas

@@ -1,13 +1,12 @@
 program test;
-uses sqlite,sqlitedb, strings,classes;
-
 
+uses sqlite,sqlitedb, strings,classes;
 
 var
   MySQL: TSQLite;
   SQL: String;
-  i,j : Integer;
-  a : TStringList;
+  i, j: Integer;
+  a: TStringList;
 begin
   Writeln('Creating class');
   MySQL := TSQLite.Create('test.db');

+ 1 - 1
packages/base/sqlite/testapiv3x.pp

@@ -3,7 +3,7 @@ program testapiv3x;
 {$APPTYPE CONSOLE}
 {$MODE DELPHI}
 
-uses windows, sqlite3, sysutils;
+uses sqlite3, sysutils;
 
 const
  DBFILE='dbtest.db';

+ 60 - 16
packages/extra/gtk2/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/02/06]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/06/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-palmos arm-wince powerpc64-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince 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-palmos arm-wince arm-gba powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -268,6 +268,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_UNITS+=buildgtk2
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=buildgtk2
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_UNITS+=buildgtk2
 endif
@@ -343,6 +346,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_UNITS+=buildgtk2
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=buildgtk2
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_UNITS+=buildgtk2
 endif
@@ -382,6 +388,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_IMPLICITUNITS+=glib2 atk pango gdk2pixbuf gdk2 gtk2 libglade2 gtkglext gdkglext
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_IMPLICITUNITS+=glib2 atk pango gdk2pixbuf gdk2 gtk2 libglade2 gtkglext gdkglext
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_IMPLICITUNITS+=glib2 atk pango gdk2pixbuf gdk2 gtk2 libglade2 gtkglext gdkglext
 endif
@@ -457,6 +466,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_IMPLICITUNITS+=glib2 atk pango gdk2pixbuf gdk2 gtk2 libglade2 gtkglext gdkglext
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_IMPLICITUNITS+=glib2 atk pango gdk2pixbuf gdk2 gtk2 libglade2 gtkglext gdkglext
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_IMPLICITUNITS+=glib2 atk pango gdk2pixbuf gdk2 gtk2 libglade2 gtkglext gdkglext
 endif
@@ -496,6 +508,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_EXAMPLEDIRS+=examples
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_EXAMPLEDIRS+=examples
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_EXAMPLEDIRS+=examples
 endif
@@ -571,6 +586,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_EXAMPLEDIRS+=examples
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_EXAMPLEDIRS+=examples
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_EXAMPLEDIRS+=examples
 endif
@@ -612,6 +630,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override COMPILER_UNITDIR+=glib atk pango gtk+/gdk-pixbuf gtk+/gdk gtk+/gtk libglade gtkglext
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_UNITDIR+=glib atk pango gtk+/gdk-pixbuf gtk+/gdk gtk+/gtk libglade gtkglext
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 override COMPILER_UNITDIR+=glib atk pango gtk+/gdk-pixbuf gtk+/gdk gtk+/gtk libglade gtkglext
 endif
@@ -687,6 +708,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_UNITDIR+=glib atk pango gtk+/gdk-pixbuf gtk+/gdk gtk+/gtk libglade gtkglext
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_UNITDIR+=glib atk pango gtk+/gdk-pixbuf gtk+/gdk gtk+/gtk libglade gtkglext
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_UNITDIR+=glib atk pango gtk+/gdk-pixbuf gtk+/gdk gtk+/gtk libglade gtkglext
 endif
@@ -931,6 +955,7 @@ STATICLIBEXT=.a
 SHAREDLIBEXT=.so
 SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 ifeq ($(OS_TARGET),go32v1)
@@ -1043,6 +1068,11 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=dwn
 endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
 else
 ifeq ($(OS_TARGET),go32v1)
 PPUEXT=.pp1
@@ -1363,12 +1393,17 @@ endif
 endif
 export ZIPPROG
 ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
 TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG= __missing_command_TARPROG
 else
 TARPROG:=$(firstword $(TARPROG))
 endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
 endif
 export TARPROG
 ASNAME=$(BINUTILSPREFIX)as
@@ -1492,6 +1527,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1567,6 +1605,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1602,6 +1643,9 @@ endif
 ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
 ifeq ($(OS_SOURCE),openbsd)
 override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
@@ -1636,14 +1680,15 @@ override FPCOPT+=-gl
 override FPCOPTDEF+=DEBUG
 endif
 ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
 ifeq ($(CPU_TARGET),i386)
 FPCCPUOPT:=-OG2p3
-else
+endif
 ifeq ($(CPU_TARGET),powerpc)
 FPCCPUOPT:=-O1r
-else
-FPCCPUOPT:=
 endif
+else
+FPCCPUOPT:=-O2
 endif
 override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
 override FPCOPTDEF+=RELEASE
@@ -1652,9 +1697,7 @@ ifdef STRIP
 override FPCOPT+=-Xs
 endif
 ifdef OPTIMIZE
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-OG2p3
-endif
+override FPCOPT+=-O2
 endif
 ifdef VERBOSE
 override FPCOPT+=-vwni
@@ -1698,11 +1741,6 @@ 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 CREATESHARED
 override FPCOPT+=-Cg
 ifeq ($(CPU_TARGET),i386)
@@ -1765,7 +1803,7 @@ ifneq ($(TARGET_EXAMPLES),)
 HASEXAMPLES=1
 override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .pp,$(TARGET_EXAMPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)) $(addsuffix .lpr,$(TARGET_EXAMPLES)) $(addsuffix .dpr,$(TARGET_EXAMPLES)))
 override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))
-override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
+override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
 override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
 ifeq ($(OS_TARGET),os2)
 override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
@@ -1859,7 +1897,7 @@ 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)))
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
 ifneq ($(UNITTARGETDIRPREFIX),)
 override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
 override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
@@ -2011,7 +2049,7 @@ ifdef CLEAN_UNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
 endif
 ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
 ifdef DEBUGSYMEXT
 override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
 endif
@@ -2212,6 +2250,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 TARGET_EXAMPLEDIRS_EXAMPLES=1
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 TARGET_EXAMPLEDIRS_EXAMPLES=1
 endif
@@ -2287,6 +2328,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 TARGET_EXAMPLEDIRS_EXAMPLES=1
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+TARGET_EXAMPLEDIRS_EXAMPLES=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 TARGET_EXAMPLEDIRS_EXAMPLES=1
 endif

+ 5 - 5
packages/extra/gtk2/examples/gtk_demo/appwindow.inc

@@ -279,11 +279,11 @@ begin
                               TGDestroyNotify (@g_object_unref));
 
     (* create menu items *)
-    menu_items[2].extra_data:=Pointer(GTK_STOCK_NEW);
-    menu_items[3].extra_data:=Pointer(GTK_STOCK_OPEN);
-    menu_items[4].extra_data:=Pointer(GTK_STOCK_SAVE);
-    menu_items[5].extra_data:=Pointer(GTK_STOCK_SAVE_AS);
-    menu_items[7].extra_data:=Pointer(GTK_STOCK_QUIT);
+    menu_items[2].extra_data:=PChar(GTK_STOCK_NEW);
+    menu_items[3].extra_data:=PChar(GTK_STOCK_OPEN);
+    menu_items[4].extra_data:=PChar(GTK_STOCK_SAVE);
+    menu_items[5].extra_data:=PChar(GTK_STOCK_SAVE_AS);
+    menu_items[7].extra_data:=PChar(GTK_STOCK_QUIT);
 
     gtk_item_factory_create_items (item_factory, high (menu_items),
                                    @menu_items[1], application_window );

+ 3 - 3
packages/extra/gtk2/examples/gtk_demo/textview.inc

@@ -333,9 +333,9 @@ begin
             + 'blah blah blah blah blah blah blah blah blah'#13#10#13#10, -1,
                                             'char_wrap', [NULL]);
 
-  gtk_text_buffer_insert_with_tags_by_name (buffer, @iter,
-            + 'This line has all wrapping turned off, so it makes the horizontal '
-            + 'scrollbar appear.'#13#10#13#10#13#10, -1,
+  gtk_text_buffer_insert_with_tags_by_name (buffer, @iter, PChar(
+              'This line has all wrapping turned off, so it makes the horizontal '
+            + 'scrollbar appear.'#13#10#13#10#13#10), -1,
                                             'no_wrap', [NULL]);
 
   gtk_text_buffer_insert_with_tags_by_name (buffer, @iter, 'Justification. ', -1,

+ 2 - 2
packages/extra/gtk2/examples/helloworld2/helloworld2.pas

@@ -66,7 +66,7 @@ begin
     (* Now when the button is clicked, we call the "callback" function
      * with a pointer to "button 1" as its argument *)
     g_signal_connect (G_OBJECT (button), 'clicked',
-                              G_CALLBACK (@callback), gpointer('button 1'));
+                              G_CALLBACK (@callback), PChar('button 1'));
 
     (* Instead of gtk_container_add, we pack this button into the invisible
      * box, which has been packed into the window. *)
@@ -82,7 +82,7 @@ begin
     (* Call the same callback function with a different argument,
      * passing a pointer to "button 2" instead. *)
     g_signal_connect (G_OBJECT (button), 'clicked',
-                              G_CALLBACK (@callback), gpointer ('button 2'));
+                              G_CALLBACK (@callback), PChar('button 2'));
 
     gtk_box_pack_start(GTK_BOX (box1), button, TRUE, TRUE, 0);
 

+ 17 - 1
packages/extra/gtk2/gtk+/gdk-pixbuf/gdk2pixbuf.pas

@@ -61,6 +61,9 @@ const
   {$endif}
 {$endif}
 
+{$define HasGTK2_4}
+{$define HasGTK2_6}
+
 { Pointers to basic pascal types, inserted by h2pas conversion program.}
 {$IFNDEF KYLIX}
   {$PACKRECORDS C}
@@ -72,11 +75,17 @@ const
 
 {$IFNDEF Kylix}
 var
+  {$IFDEF WIN32 }
+  gdk_pixbuf_major_version: guint; external gdkpixbuflib name 'gdk_pixbuf_major_version';
+  gdk_pixbuf_minor_version: guint; external gdkpixbuflib name 'gdk_pixbuf_minor_version';
+  gdk_pixbuf_micro_version: guint; external gdkpixbuflib name 'gdk_pixbuf_micro_version';
+  gdk_pixbuf_version: PChar ; external gdkpixbuflib name 'gdk_pixbuf_version';
+  {$ELSE }
   gdk_pixbuf_major_version: guint;cvar;external;
   gdk_pixbuf_minor_version: guint;cvar;external;
   gdk_pixbuf_micro_version: guint;cvar;external;
-
   gdk_pixbuf_version: PChar;cvar;external;
+  {$ENDIF }
 {$ENDIF}
 
 type
@@ -180,6 +189,13 @@ function gdk_pixbuf_new_from_data(data:Pguchar; colorspace:TGdkColorspace; has_a
 function gdk_pixbuf_new_from_xpm_data(data:PPchar):PGdkPixbuf; cdecl; external gdkpixbuflib;
 function gdk_pixbuf_new_from_inline(data_length:gint; var data:guint8; copy_pixels:gboolean; error:PPGError):PGdkPixbuf; cdecl; external gdkpixbuflib;
 
+{$IFDEF HasGTK2_4}
+function gdk_pixbuf_new_from_file_at_size(filename:Pchar; width, height: gint;error:PPGError):PGdkPixbuf; cdecl; external gdkpixbuflib;
+{$ENDIF HasGTK2_4}
+{$IFDEF HasGTK2_6}
+function gdk_pixbuf_new_from_file_at_scale(filename:Pchar; width, height: gint; preserve_aspect_ratio: gboolean; error:PPGError):PGdkPixbuf; cdecl; external gdkpixbuflib;
+{$ENDIF HasGTK2_6}
+
 { Mutations  }
 procedure gdk_pixbuf_fill(pixbuf:PGdkPixbuf; pixel:guint32); cdecl; external gdkpixbuflib;
 

+ 1 - 1
packages/extra/gtk2/gtk+/gdk/gdkdisplay.inc

@@ -46,7 +46,7 @@ function GDK_IS_DISPLAY_CLASS(klass : pointer) : boolean;
 function GDK_DISPLAY_GET_CLASS(obj : pointer) : PGdkDisplayClass;
 
 //function gdk_display_get_type:GType; cdecl; external gdklib;
-function gdk_open_display(display_name:Pgchar):PGdkDisplay; cdecl; external gdklib;
+function gdk_display_open(display_name:Pgchar):PGdkDisplay; cdecl; external gdklib;
 function gdk_display_get_name(display:PGdkDisplay):Pgchar; cdecl; external gdklib;
 function gdk_display_get_n_screens(display:PGdkDisplay):gint; cdecl; external gdklib;
 function gdk_display_get_screen(display:PGdkDisplay; screen_num:gint):PGdkScreen; cdecl; external gdklib;

+ 2 - 1
packages/extra/gtk2/gtk+/gtk/gtk2.pas

@@ -18,7 +18,8 @@
   }
 unit gtk2; // keep unit name lowercase for kylix
 
-{$define GTK2_2}
+// default GTK2_6
+{$define GTK2_6}
 
 { Smartlinking has problems on powerpc-linux because of commandline length, disable
   it for now }

+ 2 - 0
packages/extra/gtk2/gtk+/gtk/gtkentry.inc

@@ -166,6 +166,8 @@ procedure gtk_entry_get_layout_offsets(entry:PGtkEntry; x:Pgint; y:Pgint); cdecl
 {$IFDEF HasGTK2_4}
 function gtk_entry_get_alignment(window:PGtkEntry): GFloat; cdecl; external gtklib;
 procedure gtk_entry_set_alignment(window:PGtkEntry; xalign: GFloat); cdecl; external gtklib;
+function gtk_entry_get_completion(entry:PGtkEntry): PGtkEntryCompletion; cdecl; external gtklib;
+procedure gtk_entry_set_completion(entry:PGtkEntry; entryCompletion: PGtkEntryCompletion); cdecl; external gtklib;
 {$ENDIF HasGTK2_4}
 
 { Deprecated compatibility functions }

+ 3 - 1
packages/extra/gtk2/gtk+/gtk/gtkincludes.inc

@@ -160,7 +160,9 @@
 {$include gtkfilechooserentry.inc}
 {$include gtkiconview.inc}
 
-{$ENDIF}
+// new GtkCellRendererCombo widget
+{$include gtkcellrenderercombo.inc}
+{$ENDIF HasGTK2_6}
 
 {$include gtkfilechooser.inc}
 

+ 11 - 0
packages/extra/gtk2/gtk+/gtk/gtkstock.inc

@@ -26,6 +26,7 @@ const
    GTK_STOCK_DIALOG_QUESTION = 'gtk-dialog-question';
    GTK_STOCK_DND = 'gtk-dnd';
    GTK_STOCK_DND_MULTIPLE = 'gtk-dnd-multiple';
+	 GTK_STOCK_ABOUT = 'gtk-about';
    GTK_STOCK_ADD_name = 'gtk-add';
    GTK_STOCK_APPLY = 'gtk-apply';
    GTK_STOCK_BOLD = 'gtk-bold';
@@ -33,7 +34,9 @@ const
    GTK_STOCK_CDROM = 'gtk-cdrom';
    GTK_STOCK_CLEAR = 'gtk-clear';
    GTK_STOCK_CLOSE = 'gtk-close';
+	 GTK_STOCK_COLOR_PICKER = 'gtk-color-picker';
    GTK_STOCK_CONVERT = 'gtk-convert';
+	 GTK_STOCK_CONNECT = 'gtk-connect';
    GTK_STOCK_COPY = 'gtk-copy';
    GTK_STOCK_CUT = 'gtk-cut';
    GTK_STOCK_DELETE = 'gtk-delete';
@@ -58,6 +61,14 @@ const
    GTK_STOCK_JUSTIFY_FILL = 'gtk-justify-fill';
    GTK_STOCK_JUSTIFY_LEFT = 'gtk-justify-left';
    GTK_STOCK_JUSTIFY_RIGHT = 'gtk-justify-right';
+	 GTK_STOCK_MEDIA_FORWARD = 'gtk-media-forward';
+	 GTK_STOCK_MEDIA_NEXT = 'gtk-media-next';
+	 GTK_STOCK_MEDIA_PAUSE = 'gtk-media-pause';
+	 GTK_STOCK_MEDIA_PLAY = 'gtk-media-play';
+	 GTK_STOCK_MEDIA_PREVIOUS = 'gtk-media-previous';
+	 GTK_STOCK_MEDIA_RECORD = 'gtk-media-record';
+	 GTK_STOCK_MEDIA_REWIND = 'gtk-media-rewind';
+	 GTK_STOCK_MEDIA_STOP = 'gtk-media-stop';
    GTK_STOCK_MISSING_IMAGE = 'gtk-missing-image';
    GTK_STOCK_NEW = 'gtk-new';
    GTK_STOCK_NO = 'gtk-no';

+ 80 - 0
packages/extra/gtk2/gtkcellrenderercombo.inc

@@ -0,0 +1,80 @@
+// included by gtk2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+
+    PGtkCellRendererCombo = ^TGtkCellRendererCombo;
+    TGtkCellRendererCombo = record
+        parent : TGtkCellRendererText;
+        model : PGtkTreeModel;
+        text_column: gint;
+        has_entry: gboolean;
+        {< private >}
+       focus_out_id: guint;
+    end;
+
+    PGtkCellRendererComboClass = ^TGtkCellRendererComboClass;
+    TGtkCellRendererComboClass = record
+       parent_class : TGtkCellRendererTextClass;
+    end;
+
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+
+    function GTK_TYPE_CELL_RENDERER_COMBO: GType;
+    function GTK_CELL_RENDERER_COMBO(obj: Pointer): PGtkCellRendererCombo;
+    function GTK_CELL_RENDERER_COMBO_CLASS(klass: pointer): PGtkCellRendererComboClass;
+    function GTK_IS_CELL_RENDERER_COMBO(obj: pointer): boolean;
+    function GTK_IS_CELL_RENDERER_COMBO_CLASS(klass: pointer):boolean;
+    function GTK_CELL_RENDERER_COMBO_GET_CLASS(obj: pointer): PGtkCellRendererComboClass;
+
+    function gtk_cell_renderer_combo_get_type:TGtkType; cdecl; external gtklib;
+    function gtk_cell_renderer_combo_new: PGtkCellRendererCombo; cdecl; external gtklib;
+
+{$ENDIF read_interface_rest}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_implementation}
+
+    function GTK_TYPE_CELL_RENDERER_COMBO: GType;
+    begin
+      Result:= gtk_cell_renderer_combo_get_type ();
+    end;
+    
+    function GTK_CELL_RENDERER_COMBO(obj: Pointer): PGtkCellRendererCombo;
+    begin
+      Result:= PGtkCellRendererCombo(GTK_CHECK_CAST(obj, GTK_TYPE_CELL_RENDERER_COMBO));
+    end;
+    
+    function GTK_CELL_RENDERER_COMBO_CLASS(klass: pointer): PGtkCellRendererComboClass;
+    begin
+      Result:= PGtkCellRendererComboClass(GTK_CHECK_CLASS_CAST(klass, GTK_TYPE_CELL_RENDERER_COMBO));
+    end;
+     
+    function GTK_IS_CELL_RENDERER_COMBO(obj: pointer): boolean;
+    begin
+      Result:= GTK_CHECK_TYPE(obj, GTK_TYPE_CELL_RENDERER_COMBO);
+    end;
+    
+    function GTK_IS_CELL_RENDERER_COMBO_CLASS(klass: pointer):boolean;
+    begin
+      Result:= GTK_CHECK_CLASS_TYPE(klass, GTK_TYPE_CELL_RENDERER_COMBO);
+    end;
+    
+    function GTK_CELL_RENDERER_COMBO_GET_CLASS(obj: pointer): PGtkCellRendererComboClass;
+    begin
+      Result:= PGtkCellRendererComboClass(GTK_CHECK_GET_CLASS(obj, GTK_TYPE_CELL_RENDERER_COMBO));
+    end;
+
+
+{$ENDIF read_implementation}
+// included by gtk2.pas
+

+ 2 - 0
packages/extra/gtk2/pango/pango-font.inc

@@ -192,6 +192,8 @@ procedure pango_font_description_set_stretch(desc:PPangoFontDescription; stretch
 function pango_font_description_get_stretch(desc:PPangoFontDescription):TPangoStretch; cdecl; external pangolib;
 procedure pango_font_description_set_size(desc:PPangoFontDescription; size:gint); cdecl; external pangolib;
 function pango_font_description_get_size(desc:PPangoFontDescription):gint; cdecl; external pangolib;
+procedure pango_font_description_set_absolute_size(desc:PPangoFontDescription;size:double); cdecl; external pangolib;
+function pango_font_description_get_size_is_absolute (desc:PPangoFontDescription;size:double):gboolean; cdecl; external pangolib;
 function pango_font_description_get_set_fields(desc:PPangoFontDescription):TPangoFontMask; cdecl; external pangolib;
 procedure pango_font_description_unset_fields(desc:PPangoFontDescription; to_unset:TPangoFontMask); cdecl; external pangolib;
 procedure pango_font_description_merge(desc:PPangoFontDescription; desc_to_merge:PPangoFontDescription; replace_existing:gboolean); cdecl; external pangolib;