Browse Source

* excess packages deleted

git-svn-id: trunk@9949 -
marco 17 years ago
parent
commit
1e4187ce29
40 changed files with 0 additions and 11123 deletions
  1. 0 38
      .gitattributes
  2. 0 21
      .gitignore
  3. 0 2147
      packages/base/postgres/Makefile
  4. 0 27
      packages/base/postgres/Makefile.fpc
  5. 0 21
      packages/base/postgres/README
  6. 0 34
      packages/base/postgres/dllist.pp
  7. 0 101
      packages/base/postgres/dllistdyn.pp
  8. 0 32
      packages/base/postgres/dllisttypes.inc
  9. 0 15
      packages/base/postgres/fpmake.inc
  10. 0 17
      packages/base/postgres/fpmake.pp
  11. 0 26
      packages/base/postgres/mkdb
  12. 0 267
      packages/base/postgres/postgres.pp
  13. 0 322
      packages/base/postgres/postgres3.pp
  14. 0 358
      packages/base/postgres/postgres3dyn.pp
  15. 0 178
      packages/base/postgres/postgres3types.inc
  16. 0 16
      packages/base/postgres/rmdb
  17. 0 105
      packages/base/postgres/testpg1.pp
  18. 0 78
      packages/base/postgres/testpg2.pp
  19. 0 1931
      packages/base/pthreads/Makefile
  20. 0 22
      packages/base/pthreads/Makefile.fpc
  21. 0 9
      packages/base/pthreads/fpmake.inc
  22. 0 17
      packages/base/pthreads/fpmake.pp
  23. 0 357
      packages/base/pthreads/pthrbeos.inc
  24. 0 356
      packages/base/pthreads/pthrbsd.inc
  25. 0 48
      packages/base/pthreads/pthreads.pp
  26. 0 404
      packages/base/pthreads/pthrlinux.inc
  27. 0 359
      packages/base/pthreads/pthrsnos.inc
  28. 0 1933
      packages/base/sqlite/Makefile
  29. 0 25
      packages/base/sqlite/Makefile.fpc
  30. 0 9
      packages/base/sqlite/fpmake.inc
  31. 0 17
      packages/base/sqlite/fpmake.pp
  32. 0 162
      packages/base/sqlite/sqlite.pp
  33. 0 576
      packages/base/sqlite/sqlite3.inc
  34. 0 5
      packages/base/sqlite/sqlite3.pp
  35. 0 494
      packages/base/sqlite/sqlite3db.pas
  36. 0 7
      packages/base/sqlite/sqlite3dyn.pp
  37. 0 410
      packages/base/sqlite/sqlitedb.pas
  38. 0 52
      packages/base/sqlite/test.pas
  39. 0 44
      packages/base/sqlite/testapiv3x.README
  40. 0 83
      packages/base/sqlite/testapiv3x.pp

+ 0 - 38
.gitattributes

@@ -888,44 +888,6 @@ packages/base/mysql/ver323/mysqls.pp svneol=native#text/plain
 packages/base/mysql/ver40/mysql.pp svneol=native#text/plain
 packages/base/mysql/ver40/mysql_com.pp svneol=native#text/plain
 packages/base/mysql/ver40/mysql_version.pp svneol=native#text/plain
-packages/base/postgres/Makefile svneol=native#text/plain
-packages/base/postgres/Makefile.fpc svneol=native#text/plain
-packages/base/postgres/README -text
-packages/base/postgres/dllist.pp svneol=native#text/plain
-packages/base/postgres/dllistdyn.pp svneol=native#text/plain
-packages/base/postgres/dllisttypes.inc svneol=native#text/plain
-packages/base/postgres/fpmake.inc svneol=native#text/plain
-packages/base/postgres/fpmake.pp svneol=native#text/plain
-packages/base/postgres/mkdb -text
-packages/base/postgres/postgres.pp svneol=native#text/plain
-packages/base/postgres/postgres3.pp svneol=native#text/plain
-packages/base/postgres/postgres3dyn.pp svneol=native#text/plain
-packages/base/postgres/postgres3types.inc svneol=native#text/plain
-packages/base/postgres/rmdb -text
-packages/base/postgres/testpg1.pp svneol=native#text/plain
-packages/base/postgres/testpg2.pp svneol=native#text/plain
-packages/base/pthreads/Makefile svneol=native#text/plain
-packages/base/pthreads/Makefile.fpc svneol=native#text/plain
-packages/base/pthreads/fpmake.inc svneol=native#text/plain
-packages/base/pthreads/fpmake.pp svneol=native#text/plain
-packages/base/pthreads/pthrbeos.inc svneol=native#text/plain
-packages/base/pthreads/pthrbsd.inc svneol=native#text/plain
-packages/base/pthreads/pthreads.pp svneol=native#text/plain
-packages/base/pthreads/pthrlinux.inc svneol=native#text/plain
-packages/base/pthreads/pthrsnos.inc -text
-packages/base/sqlite/Makefile svneol=native#text/plain
-packages/base/sqlite/Makefile.fpc svneol=native#text/plain
-packages/base/sqlite/fpmake.inc svneol=native#text/plain
-packages/base/sqlite/fpmake.pp svneol=native#text/plain
-packages/base/sqlite/sqlite.pp svneol=native#text/plain
-packages/base/sqlite/sqlite3.inc svneol=native#text/plain
-packages/base/sqlite/sqlite3.pp svneol=native#text/plain
-packages/base/sqlite/sqlite3db.pas svneol=native#text/x-pascal
-packages/base/sqlite/sqlite3dyn.pp svneol=native#text/plain
-packages/base/sqlite/sqlitedb.pas svneol=native#text/plain
-packages/base/sqlite/test.pas svneol=native#text/plain
-packages/base/sqlite/testapiv3x.README -text
-packages/base/sqlite/testapiv3x.pp -text
 packages/dbus/Makefile svneol=native#text/plain
 packages/dbus/Makefile.fpc svneol=native#text/plain
 packages/dbus/examples/Makefile svneol=native#text/plain

+ 0 - 21
.gitignore

@@ -249,27 +249,6 @@ packages/base/mysql/ver40/*.ppu
 packages/base/mysql/ver40/*.s
 packages/base/mysql/ver40/fpcmade.*
 packages/base/mysql/ver40/units
-packages/base/postgres/*.bak
-packages/base/postgres/*.exe
-packages/base/postgres/*.o
-packages/base/postgres/*.ppu
-packages/base/postgres/*.s
-packages/base/postgres/fpcmade.*
-packages/base/postgres/units
-packages/base/pthreads/*.bak
-packages/base/pthreads/*.exe
-packages/base/pthreads/*.o
-packages/base/pthreads/*.ppu
-packages/base/pthreads/*.s
-packages/base/pthreads/fpcmade.*
-packages/base/pthreads/units
-packages/base/sqlite/*.bak
-packages/base/sqlite/*.exe
-packages/base/sqlite/*.o
-packages/base/sqlite/*.ppu
-packages/base/sqlite/*.s
-packages/base/sqlite/fpcmade.*
-packages/base/sqlite/units
 packages/base/units
 packages/extra/*.bak
 packages/extra/*.exe

+ 0 - 2147
packages/base/postgres/Makefile

@@ -1,2147 +0,0 @@
-#
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
-#
-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 i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
-BSDs = freebsd netbsd openbsd darwin
-UNIXs = linux $(BSDs) solaris qnx
-LIMIT83fs = go32v2 os2 emx watcom
-OSNeedsComspecToRunBatch = go32v2 watcom
-FORCE:
-.PHONY: FORCE
-override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
-ifneq ($(findstring darwin,$(OSTYPE)),)
-inUnix=1 #darwin
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-ifeq ($(findstring ;,$(PATH)),)
-inUnix=1
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-SEARCHPATH:=$(subst ;, ,$(PATH))
-endif
-endif
-SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
-PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
-ifeq ($(PWD),)
-PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
-ifeq ($(PWD),)
-$(error You need the GNU utils package to use this Makefile)
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=
-endif
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=.exe
-endif
-ifndef inUnix
-ifeq ($(OS),Windows_NT)
-inWinNT=1
-else
-ifdef OS2_SHELL
-inOS2=1
-endif
-endif
-else
-ifneq ($(findstring cygdrive,$(PATH)),)
-inCygWin=1
-endif
-endif
-ifdef inUnix
-SRCBATCHEXT=.sh
-else
-ifdef inOS2
-SRCBATCHEXT=.cmd
-else
-SRCBATCHEXT=.bat
-endif
-endif
-ifdef COMSPEC
-ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
-RUNBATCH=$(COMSPEC) /C
-endif
-endif
-ifdef inUnix
-PATHSEP=/
-else
-PATHSEP:=$(subst /,\,/)
-ifdef inCygWin
-PATHSEP=/
-endif
-endif
-ifdef PWD
-BASEDIR:=$(subst \,/,$(shell $(PWD)))
-ifdef inCygWin
-ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
-BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
-BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
-BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
-endif
-endif
-else
-BASEDIR=.
-endif
-ifdef inOS2
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-endif
-override DEFAULT_FPCDIR=../../..
-ifndef FPC
-ifdef PP
-FPC=$(PP)
-endif
-endif
-ifndef FPC
-FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
-ifneq ($(FPCPROG),)
-FPCPROG:=$(firstword $(FPCPROG))
-ifneq ($(CPU_TARGET),)
-FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
-else
-FPC:=$(shell $(FPCPROG) -PB)
-endif
-ifneq ($(findstring Error,$(FPC)),)
-override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
-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 $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
-override PACKAGE_NAME=postgres
-override PACKAGE_VERSION=2.0.0
-ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=dllist dllistdyn postgres postgres3 postgres3dyn
-endif
-ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_EXAMPLES+=testpg1 testpg2
-endif
-override INSTALL_FPCPACKAGE=y
-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
-ifeq ($(OS_TARGET),gba)
-EXEEXT=.gba
-SHAREDLIBEXT=.so
-SHORTSUFFIX=gba
-endif
-ifeq ($(OS_TARGET),symbian)
-SHAREDLIBEXT=.dll
-SHORTSUFFIX=symbian
-endif
-else
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-STATICLIBPREFIX=
-SHORTSUFFIX=v1
-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=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.library
-SHORTSUFFIX=amg
-endif
-ifeq ($(OS_TARGET),atari)
-PPUEXT=.ppu
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=.ttp
-SHORTSUFFIX=ata
-endif
-ifeq ($(OS_TARGET),beos)
-BATCHEXT=.sh
-PPUEXT=.ppu
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=
-SHORTSUFFIX=be
-endif
-ifeq ($(OS_TARGET),solaris)
-BATCHEXT=.sh
-PPUEXT=.ppu
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=
-SHORTSUFFIX=sun
-endif
-ifeq ($(OS_TARGET),qnx)
-BATCHEXT=.sh
-PPUEXT=.ppu
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=
-SHORTSUFFIX=qnx
-endif
-ifeq ($(OS_TARGET),netware)
-STATICLIBPREFIX=
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.nlm
-EXEEXT=.nlm
-SHORTSUFFIX=nw
-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),i386-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-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)
-endif
-ifneq ($(BINUTILSPREFIX),)
-override FPCOPT+=-Xr$(RLINKPATH)
-endif
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-ifdef LINKSMART
-override FPCOPT+=-XX
-endif
-ifdef CREATESMART
-override FPCOPT+=-CX
-endif
-ifdef DEBUG
-override FPCOPT+=-gl
-override FPCOPTDEF+=DEBUG
-endif
-ifdef RELEASE
-ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
-ifeq ($(CPU_TARGET),i386)
-FPCCPUOPT:=-OG2p3
-endif
-ifeq ($(CPU_TARGET),powerpc)
-FPCCPUOPT:=-O1r
-endif
-else
-FPCCPUOPT:=-O2
-endif
-override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
-override FPCOPTDEF+=RELEASE
-endif
-ifdef STRIP
-override FPCOPT+=-Xs
-endif
-ifdef OPTIMIZE
-override FPCOPT+=-O2
-endif
-ifdef VERBOSE
-override FPCOPT+=-vwni
-endif
-ifdef COMPILER_OPTIONS
-override FPCOPT+=$(COMPILER_OPTIONS)
-endif
-ifdef COMPILER_UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
-endif
-ifdef COMPILER_LIBRARYDIR
-override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
-endif
-ifdef COMPILER_OBJECTDIR
-override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
-endif
-ifdef COMPILER_INCLUDEDIR
-override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
-endif
-ifdef CROSSBINDIR
-override FPCOPT+=-FD$(CROSSBINDIR)
-endif
-ifdef COMPILER_TARGETDIR
-override FPCOPT+=-FE$(COMPILER_TARGETDIR)
-ifeq ($(COMPILER_TARGETDIR),.)
-override TARGETDIRPREFIX=
-else
-override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-endif
-ifdef COMPILER_UNITTARGETDIR
-override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
-ifeq ($(COMPILER_UNITTARGETDIR),.)
-override UNITTARGETDIRPREFIX=
-else
-override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
-endif
-else
-ifdef COMPILER_TARGETDIR
-override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
-override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
-endif
-endif
-ifdef CREATESHARED
-override FPCOPT+=-Cg
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-Aas
-endif
-endif
-ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
-ifeq ($(OS_TARGET),linux)
-ifeq ($(CPU_TARGET),x86_64)
-override FPCOPT+=-Cg
-endif
-endif
-endif
-ifdef LINKSHARED
-endif
-ifdef GCCLIBDIR
-override FPCOPT+=-Fl$(GCCLIBDIR)
-endif
-ifdef OTHERLIBDIR
-override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
-endif
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef FPCOPTDEF
-override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
-endif
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-ifdef USEENV
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
-endif
-override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
-override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
-ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
-override ACROSSCOMPILE=1
-endif
-ifdef ACROSSCOMPILE
-override FPCOPT+=$(CROSSOPT)
-endif
-override COMPILER:=$(FPC) $(FPCOPT)
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-ifeq ($(FULL_SOURCE),$(FULL_TARGET))
-ifdef RUNBATCH
-EXECPPAS:=@$(RUNBATCH) $(PPAS)
-else
-EXECPPAS:=@$(PPAS)
-endif
-endif
-endif
-.PHONY: fpc_units
-ifneq ($(TARGET_UNITS),)
-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_examples
-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))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
-override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
-ifeq ($(OS_TARGET),os2)
-override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
-endif
-ifeq ($(OS_TARGET),emx)
-override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
-endif
-endif
-ifneq ($(TARGET_EXAMPLEDIRS),)
-HASEXAMPLES=1
-endif
-fpc_examples: all $(EXAMPLEFILES) $(addsuffix _all,$(TARGET_EXAMPLEDIRS))
-.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
-$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
-	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_all: $(FPCMADE)
-fpc_smart:
-	$(MAKE) all LINKSMART=1 CREATESMART=1
-fpc_debug:
-	$(MAKE) all DEBUG=1
-fpc_release:
-	$(MAKE) all RELEASE=1
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
-$(COMPILER_UNITTARGETDIR):
-	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
-$(COMPILER_TARGETDIR):
-	$(MKDIRTREE) $(COMPILER_TARGETDIR)
-%$(PPUEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(PPUEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.lpr
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.dpr
-	$(COMPILER) $<
-	$(EXECPPAS)
-%.res: %.rc
-	windres -i $< -o $@
-vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.inc $(COMPILER_INCLUDEDIR)
-vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
-vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
-.PHONY: fpc_shared
-override INSTALLTARGET+=fpc_shared_install
-ifndef SHARED_LIBVERSION
-SHARED_LIBVERSION=$(FPC_VERSION)
-endif
-ifndef SHARED_LIBNAME
-SHARED_LIBNAME=$(PACKAGE_NAME)
-endif
-ifndef SHARED_FULLNAME
-SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
-endif
-ifndef SHARED_LIBUNITS
-SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
-override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
-endif
-fpc_shared:
-ifdef HASSHAREDLIB
-	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
-ifneq ($(SHARED_BUILD),n)
-	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
-endif
-else
-	@$(ECHO) Shared Libraries not supported
-endif
-fpc_shared_install:
-ifneq ($(SHARED_BUILD),n)
-ifneq ($(SHARED_LIBUNITS),)
-ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
-	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
-endif
-endif
-endif
-.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
-ifdef INSTALL_UNITS
-override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
-endif
-ifdef INSTALL_BUILDUNIT
-override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
-endif
-ifdef INSTALLPPUFILES
-override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
-ifneq ($(UNITTARGETDIRPREFIX),)
-override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
-override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
-endif
-override INSTALL_CREATEPACKAGEFPC=1
-endif
-ifdef INSTALLEXEFILES
-ifneq ($(TARGETDIRPREFIX),)
-override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
-endif
-endif
-fpc_install: all $(INSTALLTARGET)
-ifdef INSTALLEXEFILES
-	$(MKDIR) $(INSTALL_BINDIR)
-ifdef UPXPROG
-	-$(UPXPROG) $(INSTALLEXEFILES)
-endif
-	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
-endif
-ifdef INSTALL_CREATEPACKAGEFPC
-ifdef FPCMAKE
-ifdef PACKAGE_VERSION
-ifneq ($(wildcard Makefile.fpc),)
-	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
-endif
-endif
-endif
-endif
-ifdef INSTALLPPUFILES
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
-ifneq ($(INSTALLPPULINKFILES),)
-	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
-endif
-ifneq ($(wildcard $(LIB_FULLNAME)),)
-	$(MKDIR) $(INSTALL_LIBDIR)
-	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
-ifdef inUnix
-	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
-endif
-endif
-endif
-ifdef INSTALL_FILES
-	$(MKDIR) $(INSTALL_DATADIR)
-	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
-endif
-fpc_sourceinstall: distclean
-	$(MKDIR) $(INSTALL_SOURCEDIR)
-	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
-fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
-ifdef HASEXAMPLES
-	$(MKDIR) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef EXAMPLESOURCEFILES
-	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef TARGET_EXAMPLEDIRS
-	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
-endif
-.PHONY: fpc_distinstall
-fpc_distinstall: install exampleinstall
-.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
-ifndef PACKDIR
-ifndef inUnix
-PACKDIR=$(BASEDIR)/../fpc-pack
-else
-PACKDIR=/tmp/fpc-pack
-endif
-endif
-ifndef ZIPNAME
-ifdef DIST_ZIPNAME
-ZIPNAME=$(DIST_ZIPNAME)
-else
-ZIPNAME=$(PACKAGE_NAME)
-endif
-endif
-ifndef FULLZIPNAME
-FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
-endif
-ifndef ZIPTARGET
-ifdef DIST_ZIPTARGET
-ZIPTARGET=DIST_ZIPTARGET
-else
-ZIPTARGET=install
-endif
-endif
-ifndef USEZIP
-ifdef inUnix
-USETAR=1
-endif
-endif
-ifndef inUnix
-USEZIPWRAPPER=1
-endif
-ifdef USEZIPWRAPPER
-ZIPPATHSEP=$(PATHSEP)
-ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
-else
-ZIPPATHSEP=/
-endif
-ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
-ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
-ifdef USETAR
-ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
-ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
-else
-ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
-ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
-endif
-fpc_zipinstall:
-	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
-	$(MKDIR) $(DIST_DESTDIR)
-	$(DEL) $(ZIPDESTFILE)
-ifdef USEZIPWRAPPER
-ifneq ($(ECHOREDIR),echo)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
-else
-	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
-	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
-	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
-endif
-ifdef inUnix
-	/bin/sh $(ZIPWRAPPER)
-else
-ifdef RUNBATCH
-	$(RUNBATCH) (ZIPWRAPPER)
-else
-	$(ZIPWRAPPER)
-endif
-endif
-	$(DEL) $(ZIPWRAPPER)
-else
-	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
-endif
-	$(DELTREE) $(PACKDIR)
-fpc_zipsourceinstall:
-	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
-fpc_zipexampleinstall:
-ifdef HASEXAMPLES
-	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
-endif
-fpc_zipdistinstall:
-	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
-.PHONY: fpc_clean fpc_cleanall fpc_distclean
-ifdef EXEFILES
-override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
-endif
-ifdef CLEAN_UNITS
-override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
-endif
-ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
-ifdef DEBUGSYMEXT
-override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
-endif
-override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
-override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
-endif
-fpc_clean: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-ifdef CLEAN_FILES
-	-$(DEL) $(CLEAN_FILES)
-endif
-ifdef LIB_NAME
-	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
-endif
-	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
-	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
-fpc_cleanall: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef COMPILER_UNITTARGETDIR
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-endif
-	-$(DELTREE) units
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-ifneq ($(PPUEXT),.ppu)
-	-$(DEL) *.o *.ppu *.a
-endif
-	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
-	-$(DEL) *_ppas$(BATCHEXT)
-ifdef AOUTEXT
-	-$(DEL) *$(AOUTEXT)
-endif
-ifdef DEBUGSYMEXT
-	-$(DEL) *$(DEBUGSYMEXT)
-endif
-fpc_distclean: cleanall
-.PHONY: fpc_baseinfo
-override INFORULES+=fpc_baseinfo
-fpc_baseinfo:
-	@$(ECHO)
-	@$(ECHO)  == Package info ==
-	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
-	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPC.......... $(FPC)
-	@$(ECHO)  FPC Version.. $(FPC_VERSION)
-	@$(ECHO)  Source CPU... $(CPU_SOURCE)
-	@$(ECHO)  Target CPU... $(CPU_TARGET)
-	@$(ECHO)  Source OS.... $(OS_SOURCE)
-	@$(ECHO)  Target OS.... $(OS_TARGET)
-	@$(ECHO)  Full Source.. $(FULL_SOURCE)
-	@$(ECHO)  Full Target.. $(FULL_TARGET)
-	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
-	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
-	@$(ECHO)
-	@$(ECHO)  == Directory info ==
-	@$(ECHO)
-	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
-	@$(ECHO)
-	@$(ECHO)  Basedir......... $(BASEDIR)
-	@$(ECHO)  FPCDir.......... $(FPCDIR)
-	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
-	@$(ECHO)  UnitsDir........ $(UNITSDIR)
-	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
-	@$(ECHO)
-	@$(ECHO)  GCC library..... $(GCCLIBDIR)
-	@$(ECHO)  Other library... $(OTHERLIBDIR)
-	@$(ECHO)
-	@$(ECHO)  == Tools info ==
-	@$(ECHO)
-	@$(ECHO)  As........ $(AS)
-	@$(ECHO)  Ld........ $(LD)
-	@$(ECHO)  Ar........ $(AR)
-	@$(ECHO)  Rc........ $(RC)
-	@$(ECHO)
-	@$(ECHO)  Mv........ $(MVPROG)
-	@$(ECHO)  Cp........ $(CPPROG)
-	@$(ECHO)  Rm........ $(RMPROG)
-	@$(ECHO)  GInstall.. $(GINSTALL)
-	@$(ECHO)  Echo...... $(ECHO)
-	@$(ECHO)  Shell..... $(SHELL)
-	@$(ECHO)  Date...... $(DATE)
-	@$(ECHO)  FPCMake... $(FPCMAKE)
-	@$(ECHO)  PPUMove... $(PPUMOVE)
-	@$(ECHO)  Upx....... $(UPXPROG)
-	@$(ECHO)  Zip....... $(ZIPPROG)
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
-	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
-	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
-	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
-	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
-	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
-	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
-	@$(ECHO)
-	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
-	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
-	@$(ECHO)
-	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
-	@$(ECHO)  Install Files....... $(INSTALL_FILES)
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-	@$(ECHO)  DateStr.............. $(DATESTR)
-	@$(ECHO)  ZipName.............. $(ZIPNAME)
-	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
-	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
-	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
-	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
-	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
-	@$(ECHO)
-	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
-	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
-	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
-	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
-	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
-	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
-	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
-	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
-	@$(ECHO)
-	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
-	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
-	@$(ECHO)
-.PHONY: fpc_info
-fpc_info: $(INFORULES)
-.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
-	fpc_makefile_dirs
-fpc_makefile:
-	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
-fpc_makefile_sub1:
-ifdef TARGET_DIRS
-	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
-endif
-ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
-endif
-fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
-fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
-fpc_makefiles: fpc_makefile fpc_makefile_dirs
-all: fpc_all
-debug: fpc_debug
-smart: fpc_smart
-release: fpc_release
-units: fpc_units
-examples: fpc_examples
-shared: fpc_shared
-install: fpc_install
-sourceinstall: fpc_sourceinstall
-exampleinstall: fpc_exampleinstall
-distinstall: fpc_distinstall
-zipinstall: fpc_zipinstall
-zipsourceinstall: fpc_zipsourceinstall
-zipexampleinstall: fpc_zipexampleinstall
-zipdistinstall: fpc_zipdistinstall
-clean: fpc_clean
-distclean: fpc_distclean
-cleanall: fpc_cleanall
-info: fpc_info
-makefiles: fpc_makefiles
-.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
-ifneq ($(wildcard fpcmake.loc),)
-include fpcmake.loc
-endif
-.NOTPARALLEL:

+ 0 - 27
packages/base/postgres/Makefile.fpc

@@ -1,27 +0,0 @@
-#
-#   Makefile.fpc for Postgres bindings
-#
-
-[package]
-name=postgres
-version=2.0.0
-
-[target]
-units=dllist dllistdyn postgres postgres3 postgres3dyn
-examples=testpg1 testpg2
-
-[require]
-libc=y
-
-[install]
-fpcpackage=y
-
-[default]
-fpcdir=../../..
-
-[shared]
-build=n
-
-[rules]
-.NOTPARALLEL:
-

+ 0 - 21
packages/base/postgres/README

@@ -1,21 +0,0 @@
-This is the PostGresSQL interface of Free Pascal.
-
-It has been tested with versions 6.2.xxx and 6.3.xxx of PostGreSQL.
-You need at least compiler version 0.99.8 to compile this.
-
-To Compile
-- You must know where the PostGreSQL libraries (libpq) are.
-- You must set the variable OLD in the makefile to 'yes', if your
-  postgresql version is 6.2.xxx or earlier.
-
-Both these things must be set in the Makefile. After that a simple 'make'
-and 'make install' should compile and install everything.
-
-You can test with 'make test', but this supposes that there is a 'testdb'
-database available. If not, you must run
-  mkdb databasename
-  testdb databasename
-  rmdb databasename
-manually. You need create permission on the database for this to work.
-
-Michael.

+ 0 - 34
packages/base/postgres/dllist.pp

@@ -1,34 +0,0 @@
-unit dllist;
-
-interface
-
-{$linklib pq}
-
-{$i dllisttypes.inc}
-
-function  DLNewList:PDllist;cdecl; external;
-procedure DLFreeList(_para1:PDllist);cdecl; external;
-function  DLNewElem(val : pointer) :PDlelem;cdecl;external;
-procedure DLFreeElem(_para1:PDlelem);cdecl; external;
-function  DLGetHead(_para1:PDllist):PDlelem;cdecl; external;
-function  DLGetTail(_para1:PDllist):PDlelem;cdecl; external;
-function  DLRemTail(l:PDllist):PDlelem;cdecl; external;
-function  DLGetPred(_para1:PDlelem):PDlelem;cdecl; external;
-function  DLGetSucc(_para1:PDlelem):PDlelem;cdecl; external;
-procedure DLRemove(_para1:PDlelem);cdecl; external;
-procedure DLAddHead(list:PDllist; node:PDlelem);cdecl; external;
-procedure DLAddTail(list:PDllist; node:PDlelem);cdecl; external;
-function  DLRemHead(list:PDllist):PDlelem;cdecl; external;
-
-{ Macro translated }
-Function  DLE_VAL(elem : PDlelem) : pointer;
-
-implementation
-
-// This function is also defined in DllistDyn!
-Function DLE_VAL(elem : PDlelem) : pointer;
-begin
-  DLE_VAL:=elem^.dle_val
-end;
-
-end.

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

@@ -1,101 +0,0 @@
-{
-  Call InitialiseDllist before using any of the calls, and call ReleaseDllist
-  when finished.
-}
-
-unit DllistDyn;
-
-{$mode objfpc}{$H+}
-
-interface
-
-uses
-  dynlibs, SysUtils;
-
-{$PACKRECORDS C}
-
-{$IFDEF Unix}
-  const
-    pqlib = 'libpq.so';
-{$ENDIF}
-{$IFDEF Windows}
-  const
-    pqlib = 'libpq.dll';
-{$ENDIF}
-
-{$i dllisttypes.inc}
-
-var
-  DLNewList : function : PDllist;cdecl;
-  DLFreeList : procedure (_para1:PDllist);cdecl;
-  DLNewElem : function (val : pointer) :PDlelem;cdecl;
-  DLFreeElem : procedure (_para1:PDlelem);cdecl;
-  DLGetHead : function (_para1:PDllist):PDlelem;cdecl;
-  DLGetTail : function (_para1:PDllist):PDlelem;cdecl;
-  DLRemTail : function (l:PDllist):PDlelem;cdecl;
-  DLGetPred : function (_para1:PDlelem):PDlelem;cdecl;
-  DLGetSucc : function (_para1:PDlelem):PDlelem;cdecl;
-  DLRemove : procedure (_para1:PDlelem);cdecl;
-  DLAddHead : procedure (list:PDllist; node:PDlelem);cdecl;
-  DLAddTail : procedure (list:PDllist; node:PDlelem);cdecl;
-  DLRemHead : function (list:PDllist):PDlelem;cdecl;
-
-{ Macro translated }
-Function  DLE_VAL(elem : PDlelem) : pointer;
-
-Procedure InitialiseDllist;
-Procedure ReleaseDllist;
-
-var DllistLibraryHandle : TLibHandle;
-
-implementation
-
-var RefCount : integer;
-
-Procedure InitialiseDllist;
-
-begin
-  inc(RefCount);
-  if RefCount = 1 then
-    begin
-    DllistLibraryHandle := loadlibrary(pqlib);
-    if DllistLibraryHandle = nilhandle then
-      begin
-      RefCount := 0;
-      Raise EInOutError.Create('Can not load PosgreSQL client. Is it installed? ('+pqlib+')');
-      end;
-
-    pointer(DLNewList) := GetProcedureAddress(DllistLibraryHandle,'DLNewList');
-    pointer(DLFreeList) := GetProcedureAddress(DllistLibraryHandle,'DLFreeList');
-    pointer( DLNewElem) := GetProcedureAddress(DllistLibraryHandle,' DLNewElem');
-    pointer(DLFreeElem) := GetProcedureAddress(DllistLibraryHandle,'DLFreeElem');
-    pointer( DLGetHead) := GetProcedureAddress(DllistLibraryHandle,' DLGetHead');
-    pointer( DLGetTail) := GetProcedureAddress(DllistLibraryHandle,' DLGetTail');
-    pointer( DLRemTail) := GetProcedureAddress(DllistLibraryHandle,' DLRemTail');
-    pointer( DLGetPred) := GetProcedureAddress(DllistLibraryHandle,' DLGetPred');
-    pointer( DLGetSucc) := GetProcedureAddress(DllistLibraryHandle,' DLGetSucc');
-    pointer(DLRemove) := GetProcedureAddress(DllistLibraryHandle,'DLRemove');
-    pointer(DLAddHead) := GetProcedureAddress(DllistLibraryHandle,'DLAddHead');
-    pointer(DLAddTail) := GetProcedureAddress(DllistLibraryHandle,'DLAddTail');
-    pointer( DLRemHead) := GetProcedureAddress(DllistLibraryHandle,' DLRemHead');
-    end;
-end;
-
-Procedure ReleaseDllist;
-
-begin
-  if RefCount > 0 then dec(RefCount);
-  if RefCount = 0 then
-    begin
-    if not UnloadLibrary(DllistLibraryHandle) then inc(RefCount);
-    end;
-end;
-
-// This function is also defined in Dllist!
-Function DLE_VAL(elem : PDlelem) : pointer;
-begin
-  DLE_VAL:=elem^.dle_val
-end;
-
-
-end.

+ 0 - 32
packages/base/postgres/dllisttypes.inc

@@ -1,32 +0,0 @@
-{
-  Contains the types needed for dllist
-}
-
-{ Pointers to basic pascal types, inserted by h2pas conversion program.}
-Type
-  PCardinal = ^Cardinal;
-  PReal     = ^Real;
-  PDouble   = ^Double;
-
-{ next element }
-{ previous element }
-{ value of the element }
-{ what list this element is in }
-
-type
-   { Pointer types }
-   PDllist= ^TDllist;
-   PDlelem= ^TDlelem;
-
-   TDlelem = record
-        dle_next : PDlelem;
-        dle_prev : PDlElem;
-        dle_val : pointer;
-        dle_list : PDllist;
-     end;
-
-   TDllist = record
-        dll_head : PDlelem;
-        dll_tail : PDlelem;
-     end;
-

+ 0 - 15
packages/base/postgres/fpmake.inc

@@ -1,15 +0,0 @@
-    StartPackage('postgres');
-    {$IF defined(ALLPACKAGES)}
-    Directory:='base/postgres';
-    {$ELSEIF defined(BASEPACKAGES)}
-    Directory:='postgres';
-    {$ENDIF}
-    OS:=[linux,win32,netbsd,openbsd,freebsd,darwin];
-    T:=Targets.AddUnit('dllist');
-    T:=Targets.AddUnit('dllistdyn');
-    T:=Targets.AddUnit('postgres');
-    T:=Targets.AddUnit('postgres3');
-    T:=Targets.AddUnit('postgres3dyn');
-    T:=Targets.AddExampleunit('testpg1');
-    T:=Targets.AddExampleunit('testpg2');
-    EndPackage;

+ 0 - 17
packages/base/postgres/fpmake.pp

@@ -1,17 +0,0 @@
-{$mode objfpc}{$H+}
-program fpmake;
-
-uses fpmkunit;
-
-Var
-  T : TTarget;
-
-begin
-  With Installer do 
-    begin
-    { Base packages }
-    {$i fpmake.inc}
-    Run;
-    end;
-end.
-

+ 0 - 26
packages/base/postgres/mkdb

@@ -1,26 +0,0 @@
-#!/bin/sh
-#
-# Script to create a table 'email' and to fill it with data.
-# The script accepts an optional argument : 
-# A database to connect to. (default 'testdb')
-echo -n "Creating and filling table email in database ${1-testdb}..."
-psql ${1-testdb} << EOF >/dev/null 2>&1
-create table email ( 
-id int4,
-name text,
-email text);
-insert into email values (1,'Michael Van Canneyt','[email protected]');
-insert into email values (2,'Florian Klaempfl','[email protected]');
-insert into email values (3,'Carl-Eric Codere','[email protected]');
-insert into email values (4,'Daniel Mantione','[email protected]');
-insert into email values (5,'Pierre Muller','[email protected]');
-insert into email values (6,'Jonas Maebe','[email protected]');
-insert into email values (7,'Peter Vreman','[email protected]');
-insert into email values (8,'Gerry Dubois','[email protected]');
-EOF
-if [ ! $? = 0 ]; then
-  echo "Failed."
-else
-  echo "Done."
-fi
-# Ready

+ 0 - 267
packages/base/postgres/postgres.pp

@@ -1,267 +0,0 @@
-unit postgres;
-
-interface
-
-uses dllist;
-
-{$linklib pq}
-{$linklib c}
-
-{ Not always needed. If you have problems linking, try to add this  }
-{ $linklib crypt}
-
-{ $include "libpq/pqcomm.h"}
-
-
-Type
-   Oid = cardinal;
-   MsgType = Cardinal;
-   PLongint = ^Longint;
-   TSockAddr = Array [1..112] of byte; { Testded using C version sizeof() }
-
-Const
-   NAMEDATALEN = 32;
-   OIDNAMELEN = 36;
-
-Type
-   TFILE = Longint;
-   PFIle = ^TFILE;
-
-type
-   TConnStatusType = (CONNECTION_OK,CONNECTION_BAD);
-   PConnStatusType= ^TConnStatusType;
-
-   TExecStatusType = (PGRES_EMPTY_QUERY,PGRES_COMMAND_OK,PGRES_TUPLES_OK,
-     PGRES_COPY_OUT,
-     PGRES_COPY_IN,
-     PGRES_BAD_RESPONSE,
-     PGRES_NONFATAL_ERROR,
-     PGRES_FATAL_ERROR
-     );
-   PExecStatusType= ^TExecStatusType;
-{
-        extern const char  pgresStatus[];
-}
-
-const
-   ERROR_MSG_LENGTH = 4096;
-   COMMAND_LENGTH = 20;
-   REMARK_LENGTH = 80;
-   PORTAL_NAME_LENGTH = 16;
-
-type
-   TPQArgBlock = record
-        len : longint;
-        isint : longint;
-        u : record
-            case longint of
-               0 : ( ptr:Plongint );
-               1 : ( integer:longint );
-          end;
-     end;
-   PPQArgBlock= ^TPQArgBlock;
-
-   TPGresAttDesc = record
-        name : Pchar;
-        adtid : Oid;
-        adtsize : integer;
-     end;
-   PPGresAttDesc= ^TPGresAttDesc;
-   PPPGresAttDesc= ^PPGresAttDesc;
-
-const
-   NULL_LEN = -1;
-
-type
-   TPGresAttValue = record
-        len : longint;
-        value : Pchar;
-     end;
-   PPGresAttValue= ^TPGresAttValue;
-   PPPGresAttValue= ^PPGresAttValue;
-
-   TPGnotify = record
-        relname : array[0..(NAMEDATALEN)-1] of char;
-        be_pid : longint;
-     end;
-   PPGnotify= ^TPGnotify;
-
-   TPGlobjfuncs = record
-        fn_lo_open : Oid;
-        fn_lo_close : Oid;
-        fn_lo_creat : Oid;
-        fn_lo_unlink : Oid;
-        fn_lo_lseek : Oid;
-        fn_lo_tell : Oid;
-        fn_lo_read : Oid;
-        fn_lo_write : Oid;
-     end;
-   PPGlobjfuncs= ^TPGlobjfuncs;
-
-   TPGconn = record
-        pghost : Pchar;
-        pgtty : Pchar;
-        pgport : Pchar;
-        pgoptions : Pchar;
-        dbName : Pchar;
-        status : TConnStatusType;
-        errorMessage : array[0..(ERROR_MSG_LENGTH)-1] of char;
-        Pfin : PFILE;
-        Pfout : PFILE;
-        Pfdebug : PFILE;
-        sock : longint;
-        laddr : TSockAddr;
-        raddr : TSockAddr;
-        salt : array[0..(2)-1] of char;
-        asyncNotifyWaiting : longint;
-        notifyList : PDllist;
-        pguser : Pchar;
-        pgpass : Pchar;
-        lobjfuncs : PPGlobjfuncs;
-     end;
-   PPGconn= ^TPGconn;
-
-const
-   CMDSTATUS_LEN = 40;
-
-type
-   TPGresult = record
-        ntups : longint;
-        numAttributes : longint;
-        attDescs : PPGresAttDesc;
-        tuples : PPPGresAttValue;
-        tupArrSize : longint;
-        resultStatus : TExecStatusType;
-        cmdStatus : array[0..(CMDSTATUS_LEN)-1] of char;
-        binary : longint;
-        conn : PPGconn;
-     end;
-   PPGresult= ^TPGresult;
-
-   pqbool = char;
-
-   TPQprintopt = record
-        header : pqbool;
-        align : pqbool;
-        standard : pqbool;
-        html3 : pqbool;
-        expanded : pqbool;
-        pager : pqbool;
-        fieldSep : Pchar;
-        tableOpt : Pchar;
-        caption : Pchar;
-     end;
-   PPQprintopt= ^TPQprintopt;
-
-
-   TPQconninfoOption = Record
-      keyword   : pchar;
-      environ   : pchar;
-      compiled  : pchar;
-      val       : pchar;
-      Thelabel  : pchar;
-      dispchar  : pchar;
-      dispsize  : longint;
-   end;
-   PPQconninfoOption = ^TPQconninfoOption;
-
-const
-   MAX_MESSAGE_LEN = 8193;
-   BYTELEN = 8;
-   MAX_FIELDS = 512;
-   DefaultHost     : pchar = 'localhost';
-   DefaultTty      : pchar = '';
-   DefaultOption   : pchar = '';
-   DefaultAuthtype : pchar = '';
-   DefaultPassword : pchar = '';
-
-type
-   TTUPLE = pointer;
-   PTUPLE = ^TTUPLE;
-
-
-  function  PQconnectdb(conninfo:Pchar):PPGconn;cdecl; external;
-  function  PQconndefaults:PPQconninfoOption;cdecl; external;
-  function  PQsetdbLogin(pghost,pgport,pgoptions,pgtty,dbName,login,pwd : pchar):PPGConn;cdecl;external;
-  procedure PQfinish(conn:PPGconn);cdecl; external;
-  procedure PQreset(conn:PPGconn);cdecl; external;
-  function  PQdb(conn:PPGconn):Pchar;cdecl; external;
-  function  PQuser(conn:PPGconn):Pchar;cdecl; external;
-  function  PQhost(conn:PPGconn):Pchar;cdecl; external;
-  function  PQoptions(conn:PPGconn):Pchar;cdecl; external;
-  function  PQport(conn:PPGconn):Pchar;cdecl; external;
-  function  PQtty(conn:PPGconn):Pchar;cdecl; external;
-  function  PQstatus(conn:PPGconn):TConnStatusType;cdecl; external;
-  function  PQerrorMessage(conn:PPGconn):Pchar;cdecl; external;
-  procedure PQtrace(conn:PPGconn; debug_port:PFILE);cdecl; external;
-  procedure PQuntrace(conn:PPGconn);cdecl; external;
-  function  PQexec(conn:PPGconn; query:Pchar):PPGresult;cdecl; external;
-  function  PQgetline(conn:PPGconn; str:Pchar; len:longint):longint;cdecl; external;
-  function  PQendcopy(conn:PPGconn):longint;cdecl; external;
-  function PQputline(conn:PPGconn; str:Pchar) : longint;cdecl; external;
-  function  PQresultStatus(res:PPGresult):TExecStatusType;cdecl; external;
-  function  PQntuples(res:PPGresult):longint;cdecl; external;
-  function  PQnfields(res:PPGresult):longint;cdecl; external;
-  function  PQfname(res:PPGresult; field_num:longint):Pchar;cdecl; external;
-  function  PQfnumber(res:PPGresult; field_name:Pchar):longint;cdecl; external;
-  function  PQftype(res:PPGresult; field_num:longint):Oid;cdecl; external;
-  function  PQfsize(res:PPGresult; field_num:longint):integer;cdecl; external;
-  function  PQcmdStatus(res:PPGresult):Pchar;cdecl; external;
-  function  PQgetvalue(res:PPGresult; tup_num:longint; field_num:longint):Pchar;cdecl; external;
-  function  PQgetlength(res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl; external;
-  function  PQgetisnull(res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl; external;
-  procedure PQclear(res:PPGresult);cdecl; external;
-  procedure PQdisplayTuples(res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:Pchar; printHeader:longint; quiet:longint);cdecl; external;
-  procedure PQprintTuples(res:PPGresult; fout:PFILE; printAttName:longint; terseOutput:longint; width:longint);cdecl; external;
-  procedure PQprint(fout:PFILE; res:PPGresult; ps:PPQprintOpt);cdecl; external;
-  function  PQnotifies(conn:PPGconn):PPGnotify;cdecl; external;
-  function  PQfn(conn:PPGconn; fnid:longint; result_buf:Plongint; result_len:Plongint; result_is_int:longint; args:PPQArgBlock; nargs:longint):PPGresult;cdecl; external;
-  function  fe_getauthsvc(PQerrormsg:Pchar):MsgType;cdecl; external;
-  procedure fe_setauthsvc(name:Pchar; PQerrormsg:Pchar);cdecl; external;
-  function  fe_getauthname(PQerrormsg:Pchar):Pchar;cdecl; external;
-  function  pqGets(s:Pchar; maxlen:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
-  function  pqGetnchar(s:Pchar; maxlen:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
-  function  pqPutnchar(s:Pchar; maxlen:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
-  function  pqPuts(s:Pchar; stream:PFILE; debug:PFILE):longint;cdecl; external;
-  function  pqGetc(stream:PFILE; debug:PFILE):longint;cdecl; external;
-  function  pqGetInt(result:Plongint; bytes:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
-  function  pqPutInt(n:longint; bytes:longint; stream:PFILE; debug:PFILE):longint;cdecl; external;
-  procedure pqFlush(stream:PFILE; debug:PFILE);cdecl; external;
-  function  PQoidStatus(res : PPGresult) : pchar;cdecl;external;
-  function  PQcmdTuples(res : PPGresult) : pchar;cdecl;external;
-  function  lo_open(conn:PPGconn; lobjId:Oid; mode:longint):longint; cdecl; external;
-  function  lo_close(conn:PPGconn; fd:longint):longint; cdecl; external;
-  function  lo_read(conn:PPGconn; fd:longint; buf:Pchar; len:longint):longint; cdecl; external;
-  function  lo_write(conn:PPGconn; fd:longint; buf:Pchar; len:longint):longint; cdecl; external;
-  function  lo_lseek(conn:PPGconn; fd:longint; offset:longint; whence:longint):longint; cdecl; external;
-  function  lo_creat(conn:PPGconn; mode:longint):Oid;cdecl;external;
-  function  lo_tell(conn:PPGconn; fd:longint):longint; cdecl; external;
-  function  lo_unlink(conn:PPGconn; lobjId:Oid):longint; cdecl; external;
-  function  lo_import(conn:PPGconn; filename:Pchar):Oid;cdecl;external;
-  function  lo_export(conn:PPGconn; lobjId:Oid; filename:Pchar):longint; cdecl; external;
-
-{$ifdef PGSQL6_2_1}
-  Function  PQsetdb(pghost,pgport,pgoptions,pgtty,dbName : pchar):PPGConn; cdecl;external;
-{$else}
-  function PQsetdb(pghost,pgport,pgoptions,pgtty,dbName : pchar):PPGConn;
-{$endif}
-
-implementation
-
-
-
-{ Define helper functions }
-
-{
-  In version 6.2.xxx, PGsetdb is a function in libpq.
-  in version 6.3.xxx, PGsetdb is a macro, pointing to setdblogin !!
-}
-
-{$ifndef PGSQL6_2_1}
-function PQsetdb(pghost,pgport,pgoptions,pgtty,dbName : pchar):PPGConn;
-begin
- PQsetdb:=PQsetdbLogin(pghost,pgport,pgoptions,pgtty,dbName,nil,nil);
-end;
-{$endif}
-
-end.

+ 0 - 322
packages/base/postgres/postgres3.pp

@@ -1,322 +0,0 @@
-{ This unit contains the definitions for structures and externs for
-  functions used by frontend postgres applications. It is based on
-  Postgresql's libpq-fe.h.
-
-  It is for postgreSQL version 7.4 and higher with support for the v3.0
-  connection-protocol
-}
-unit postgres3;
-
-interface
-
-uses dllist;
-
-{$PACKRECORDS C}
-
-const
-   External_library='pq';
-
-{$i postgres3types.inc}
-
-
-  { ----------------
-   * Exported functions of libpq
-   * ----------------
-    }
-  { === in fe-connect.c ===  }
-  { make a new client connection to the backend  }
-  { Asynchronous (non-blocking)  }
-(* Const before type ignored *)
-
-  function PQconnectStart(conninfo:Pchar):PPGconn;cdecl;external External_library name 'PQconnectStart';
-
-  function PQconnectPoll(conn:PPGconn):PostgresPollingStatusType;cdecl;external External_library name 'PQconnectPoll';
-
-  { Synchronous (blocking)  }
-(* Const before type ignored *)
-  function PQconnectdb(conninfo:Pchar):PPGconn;cdecl;external External_library name 'PQconnectdb';
-
-  function PQsetdbLogin(pghost:Pchar; pgport:Pchar; pgoptions:Pchar; pgtty:Pchar; dbName:Pchar;
-             login:Pchar; pwd:Pchar):PPGconn;cdecl;external External_library name 'PQsetdbLogin';
-
-  { was #define dname(params) para_def_expr }
-  { argument types are unknown }
-  { return type might be wrong }
-  function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
-
-  { close the current connection and free the PGconn data structure  }
-  procedure PQfinish(conn:PPGconn);cdecl;external External_library name 'PQfinish';
-
-  { get info about connection options known to PQconnectdb  }
-  function PQconndefaults:PPQconninfoOption;cdecl;external External_library name 'PQconndefaults';
-
-  { free the data structure returned by PQconndefaults()  }
-  procedure PQconninfoFree(connOptions:PPQconninfoOption);cdecl;external External_library name 'PQconninfoFree';
-
-  {
-   * close the current connection and restablish a new one with the same
-   * parameters
-    }
-  { Asynchronous (non-blocking)  }
-  function PQresetStart(conn:PPGconn):longint;cdecl;external External_library name 'PQresetStart';
-
-  function PQresetPoll(conn:PPGconn):PostgresPollingStatusType;cdecl;external External_library name 'PQresetPoll';
-
-  { Synchronous (blocking)  }
-  procedure PQreset(conn:PPGconn);cdecl;external External_library name 'PQreset';
-
-  { issue a cancel request  }
-  function PQrequestCancel(conn:PPGconn):longint;cdecl;external External_library name 'PQrequestCancel';
-
-  { Accessor functions for PGconn objects  }
-  function PQdb(conn:PPGconn):Pchar;cdecl;external External_library name 'PQdb';
-
-  function PQuser(conn:PPGconn):Pchar;cdecl;external External_library name 'PQuser';
-
-  function PQpass(conn:PPGconn):Pchar;cdecl;external External_library name 'PQpass';
-
-  function PQhost(conn:PPGconn):Pchar;cdecl;external External_library name 'PQhost';
-
-  function PQport(conn:PPGconn):Pchar;cdecl;external External_library name 'PQport';
-
-  function PQtty(conn:PPGconn):Pchar;cdecl;external External_library name 'PQtty';
-
-  function PQoptions(conn:PPGconn):Pchar;cdecl;external External_library name 'PQoptions';
-
-  function PQstatus(conn:PPGconn):TConnStatusType;cdecl;external External_library name 'PQstatus';
-
-  function PQtransactionStatus(conn:PPGconn):PGTransactionStatusType;cdecl;external External_library name 'PQtransactionStatus';
-
-  function PQparameterStatus(conn:PPGconn; paramName:Pchar):Pchar;cdecl;external External_library name 'PQparameterStatus';
-
-  function PQprotocolVersion(conn:PPGconn):longint;cdecl;external External_library name 'PQprotocolVersion';
-
-  function PQerrorMessage(conn:PPGconn):Pchar;cdecl;external External_library name 'PQerrorMessage';
-
-  function PQsocket(conn:PPGconn):longint;cdecl;external External_library name 'PQsocket';
-
-  function PQbackendPID(conn:PPGconn):longint;cdecl;external External_library name 'PQbackendPID';
-
-  function PQclientEncoding(conn:PPGconn):longint;cdecl;external External_library name 'PQclientEncoding';
-
-  function PQsetClientEncoding(conn:PPGconn; encoding:Pchar):longint;cdecl;external External_library name 'PQsetClientEncoding';
-
-{$ifdef USE_SSL}
-  { Get the SSL structure associated with a connection  }
-  function PQgetssl(conn:PPGconn):PSSL;cdecl;external External_library name 'PQgetssl';
-{$endif}
-
-  { Set verbosity for PQerrorMessage and PQresultErrorMessage  }
-  function PQsetErrorVerbosity(conn:PPGconn; verbosity:PGVerbosity):PGVerbosity;cdecl;external External_library name 'PQsetErrorVerbosity';
-  { Enable/disable tracing  }
-  procedure PQtrace(conn:PPGconn; debug_port:PFILE);cdecl;external External_library name 'PQtrace';
-  procedure PQuntrace(conn:PPGconn);cdecl;external External_library name 'PQuntrace';
-  { Override default notice handling routines  }
-  function PQsetNoticeReceiver(conn:PPGconn; proc:PQnoticeReceiver; arg:pointer):PQnoticeReceiver;cdecl;external External_library name 'PQsetNoticeReceiver';
-  function PQsetNoticeProcessor(conn:PPGconn; proc:PQnoticeProcessor; arg:pointer):PQnoticeProcessor;cdecl;external External_library name 'PQsetNoticeProcessor';
-
-  { === in fe-exec.c ===  }
-  { Simple synchronous query  }
-  function PQexec(conn:PPGconn; query:Pchar):PPGresult;cdecl;external External_library name 'PQexec';
-  function PQexecParams(conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;
-             paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;external External_library name 'PQexecParams';
-
-  function PQexecPrepared(conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;
-             paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;external External_library name 'PQexecPrepared';
-
-  { Interface for multiple-result or asynchronous queries  }
-  function PQsendQuery(conn:PPGconn; query:Pchar):longint;cdecl;external External_library name 'PQsendQuery';
-
-  function PQsendQueryParams(conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;
-             paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):longint;cdecl;external External_library name 'PQsendQueryParams';
-
-  function PQsendQueryPrepared(conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;
-             paramFormats:Plongint; resultFormat:longint):longint;cdecl;external External_library name 'PQsendQueryPrepared';
-
-  function PQgetResult(conn:PPGconn):PPGresult;cdecl;external External_library name 'PQgetResult';
-
-  { Routines for managing an asynchronous query  }
-  function PQisBusy(conn:PPGconn):longint;cdecl;external External_library name 'PQisBusy';
-
-  function PQconsumeInput(conn:PPGconn):longint;cdecl;external External_library name 'PQconsumeInput';
-
-  { LISTEN/NOTIFY support  }
-  function PQnotifies(conn:PPGconn):PPGnotify;cdecl;external External_library name 'PQnotifies';
-
-  { Routines for copy in/out  }
-  function PQputCopyData(conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;external External_library name 'PQputCopyData';
-
-  function PQputCopyEnd(conn:PPGconn; errormsg:Pchar):longint;cdecl;external External_library name 'PQputCopyEnd';
-
-  function PQgetCopyData(conn:PPGconn; buffer:PPchar; async:longint):longint;cdecl;external External_library name 'PQgetCopyData';
-
-  { Deprecated routines for copy in/out  }
-  function PQgetline(conn:PPGconn; _string:Pchar; length:longint):longint;cdecl;external External_library name 'PQgetline';
-
-  function PQputline(conn:PPGconn; _string:Pchar):longint;cdecl;external External_library name 'PQputline';
-
-  function PQgetlineAsync(conn:PPGconn; buffer:Pchar; bufsize:longint):longint;cdecl;external External_library name 'PQgetlineAsync';
-
-  function PQputnbytes(conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;external External_library name 'PQputnbytes';
-
-  function PQendcopy(conn:PPGconn):longint;cdecl;external External_library name 'PQendcopy';
-
-  { Set blocking/nonblocking connection to the backend  }
-  function PQsetnonblocking(conn:PPGconn; arg:longint):longint;cdecl;external External_library name 'PQsetnonblocking';
-
-  function PQisnonblocking(conn:PPGconn):longint;cdecl;external External_library name 'PQisnonblocking';
-
-  { Force the write buffer to be written (or at least try)  }
-  function PQflush(conn:PPGconn):longint;cdecl;external External_library name 'PQflush';
-
-  {
-   * "Fast path" interface --- not really recommended for application
-   * use
-    }
-  function PQfn(conn:PPGconn; fnid:longint; result_buf:Plongint; result_len:Plongint; result_is_int:longint;
-             args:PPQArgBlock; nargs:longint):PPGresult;cdecl;external External_library name 'PQfn';
-
-  { Accessor functions for PGresult objects  }
-  function PQresultStatus(res:PPGresult):TExecStatusType;cdecl;external External_library name 'PQresultStatus';
-
-  function PQresStatus(status:TExecStatusType):Pchar;cdecl;external External_library name 'PQresStatus';
-  function PQresultErrorMessage(res:PPGresult):Pchar;cdecl;external External_library name 'PQresultErrorMessage';
-
-  function PQresultErrorField(res:PPGresult; fieldcode:longint):Pchar;cdecl;external External_library name 'PQresultErrorField';
-
-  function PQntuples(res:PPGresult):longint;cdecl;external External_library name 'PQntuples';
-
-  function PQnfields(res:PPGresult):longint;cdecl;external External_library name 'PQnfields';
-
-  function PQbinaryTuples(res:PPGresult):longint;cdecl;external External_library name 'PQbinaryTuples';
-
-  function PQfname(res:PPGresult; field_num:longint):Pchar;cdecl;external External_library name 'PQfname';
-
-  function PQfnumber(res:PPGresult; field_name:Pchar):longint;cdecl;external External_library name 'PQfnumber';
-
-  function PQftable(res:PPGresult; field_num:longint):Oid;cdecl;external External_library name 'PQftable';
-
-  function PQftablecol(res:PPGresult; field_num:longint):longint;cdecl;external External_library name 'PQftablecol';
-
-  function PQfformat(res:PPGresult; field_num:longint):longint;cdecl;external External_library name 'PQfformat';
-
-  function PQftype(res:PPGresult; field_num:longint):Oid;cdecl;external External_library name 'PQftype';
-
-  function PQfsize(res:PPGresult; field_num:longint):longint;cdecl;external External_library name 'PQfsize';
-
-  function PQfmod(res:PPGresult; field_num:longint):longint;cdecl;external External_library name 'PQfmod';
-
-  function PQcmdStatus(res:PPGresult):Pchar;cdecl;external External_library name 'PQcmdStatus';
-
-  function PQoidStatus(res:PPGresult):Pchar;cdecl;external External_library name 'PQoidStatus';
-
-  { old and ugly  }
-  function PQoidValue(res:PPGresult):Oid;cdecl;external External_library name 'PQoidValue';
-
-  { new and improved  }
-  function PQcmdTuples(res:PPGresult):Pchar;cdecl;external External_library name 'PQcmdTuples';
-  function PQgetvalue(res:PPGresult; tup_num:longint; field_num:longint):Pchar;cdecl;external External_library name 'PQgetvalue';
-
-  function PQgetlength(res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;external External_library name 'PQgetlength';
-
-  function PQgetisnull(res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;external External_library name 'PQgetisnull';
-
-  { Delete a PGresult  }
-  procedure PQclear(res:PPGresult);cdecl;external External_library name 'PQclear';
-
-  { For freeing other alloc'd results, such as PGnotify structs  }
-  procedure PQfreemem(ptr:pointer);cdecl;external External_library name 'PQfreemem';
-
-  { Exists for backward compatibility.  bjm 2003-03-24  }
-  { was #define dname(params) para_def_expr }
-  { argument types are unknown }
-  { return type might be wrong }
-//  function PQfreeNotify(ptr : longint) : longint;
-
-  {
-   * Make an empty PGresult with given status (some apps find this
-   * useful). If conn is not NULL and status indicates an error, the
-   * conn's errorMessage is copied.
-    }
-  function PQmakeEmptyPGresult(conn:PPGconn; status:TExecStatusType):PPGresult;cdecl;external External_library name 'PQmakeEmptyPGresult';
-
-  { Quoting strings before inclusion in queries.  }
-  function PQescapeString(till:Pchar; from:Pchar; length:size_t):size_t;cdecl;external External_library name 'PQescapeString';
-  function PQescapeBytea(bintext:Pbyte; binlen:size_t; bytealen:Psize_t):Pbyte;cdecl;external External_library name 'PQescapeBytea';
-  function PQunescapeBytea(strtext:Pbyte; retbuflen:Psize_t):Pbyte;cdecl;external External_library name 'PQunescapeBytea';
-
-  { === in fe-print.c ===  }
-  { output stream  }
-  procedure PQprint(fout:PFILE; res:PPGresult; ps:PPQprintOpt);cdecl;external External_library name 'PQprint';
-
-  { option structure  }
-  {
-   * really old printing routines
-    }
-  { where to send the output  }
-  { pad the fields with spaces  }
-  { field separator  }
-  { display headers?  }
-  procedure PQdisplayTuples(res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:Pchar; printHeader:longint;
-              quiet:longint);cdecl;external External_library name 'PQdisplayTuples';
-
-(* Const before type ignored *)
-  { output stream  }
-  { print attribute names  }
-  { delimiter bars  }
-  procedure PQprintTuples(res:PPGresult; fout:PFILE; printAttName:longint; terseOutput:longint; width:longint);cdecl;external External_library name 'PQprintTuples';
-
-  { width of column, if 0, use variable
-                                                                 * width  }
-  { === in fe-lobj.c ===  }
-  { Large-object access routines  }
-  function lo_open(conn:PPGconn; lobjId:Oid; mode:longint):longint;cdecl;external External_library name 'lo_open';
-
-  function lo_close(conn:PPGconn; fd:longint):longint;cdecl;external External_library name 'lo_close';
-
-  function lo_read(conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;external External_library name 'lo_read';
-
-  function lo_write(conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;external External_library name 'lo_write';
-
-  function lo_lseek(conn:PPGconn; fd:longint; offset:longint; whence:longint):longint;cdecl;external External_library name 'lo_lseek';
-
-  function lo_creat(conn:PPGconn; mode:longint):Oid;cdecl;external External_library name 'lo_creat';
-
-  function lo_tell(conn:PPGconn; fd:longint):longint;cdecl;external External_library name 'lo_tell';
-
-  function lo_unlink(conn:PPGconn; lobjId:Oid):longint;cdecl;external External_library name 'lo_unlink';
-
-  function lo_import(conn:PPGconn; filename:Pchar):Oid;cdecl;external External_library name 'lo_import';
-
-  function lo_export(conn:PPGconn; lobjId:Oid; filename:Pchar):longint;cdecl;external External_library name 'lo_export';
-
-  { === in fe-misc.c ===  }
-  { Determine length of multibyte encoded char at *s  }
-  function PQmblen(s:Pbyte; encoding:longint):longint;cdecl;external External_library name 'PQmblen';
-
-  { Get encoding id from environment variable PGCLIENTENCODING  }
-  function PQenv2encoding:longint;cdecl;external External_library name 'PQenv2encoding';
-
-implementation
-
-  { was #define dname(params) para_def_expr }
-  { argument types are unknown }
-  { return type might be wrong }
-
-// This function is also defined in postgres3dyn!
-
-  function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
-    begin
-       PQsetdb:=PQsetdbLogin(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME,'','');
-    end;
-
-  { was #define dname(params) para_def_expr }
-  { argument types are unknown }
-  { return type might be wrong }
-{  function PQfreeNotify(ptr : longint) : longint;
-    begin
-       PQfreeNotify:=PQfreemem(ptr);
-    end;}
-
-
-end.

+ 0 - 358
packages/base/postgres/postgres3dyn.pp

@@ -1,358 +0,0 @@
-{
-  Contains the Postgres protocol 3 functions calls
-
-  Call InitialisePostgres3 before using any of the calls, and call ReleasePostgres3
-  when finished.
-}
-
-unit postgres3dyn;
-
-{$mode objfpc}{$H+}
-
-interface
-
-uses
-  dynlibs, SysUtils, dllistdyn;
-
-{$IFDEF Unix}
-  const
-    pqlib = 'libpq.so';
-{$ENDIF}
-{$IFDEF Win32}
-  const
-    pqlib = 'libpq.dll';
-{$ENDIF}
-
-
-{$PACKRECORDS C}
-
-{$i postgres3types.inc}
-
-var
-{ ----------------
-* Exported functions of libpq
-* ----------------
-}
-{ ===   in fe-connect.c ===  }
-{ make a new client connection to the backend  }
-{ Asynchronous (non-blocking)  }
-(* Const before type ignored *)
-  PQconnectStart : function (conninfo:Pchar):PPGconn;cdecl;
-  PQconnectPoll : function (conn:PPGconn):PostgresPollingStatusType;cdecl;
-{ Synchronous (blocking)  }
-(* Const before type ignored *)
-  PQconnectdb : function (conninfo:Pchar):PPGconn;cdecl;
-  PQsetdbLogin : function (pghost:Pchar; pgport:Pchar; pgoptions:Pchar; pgtty:Pchar; dbName:Pchar;login:Pchar; pwd:Pchar):PPGconn;cdecl;
-{ was #define dname(params) para_def_expr }
-{ argument types are unknown }
-{ return type might be wrong }
-{ close the current connection and free the PGconn data structure  }
-  PQfinish : procedure (conn:PPGconn);cdecl;
-{ get info about connection options known to PQconnectdb  }
-  PQconndefaults : function : PPQconninfoOption;cdecl;
-{ free the data structure returned by PQconndefaults()  }
-  PQconninfoFree : procedure (connOptions:PPQconninfoOption);cdecl;
-{
-* close the current connection and restablish a new one with the same
-* parameters
-}
-{ Asynchronous (non-blocking)  }
-  PQresetStart : function (conn:PPGconn):longint;cdecl;
-  PQresetPoll : function (conn:PPGconn):PostgresPollingStatusType;cdecl;
-{ Synchronous (blocking)  }
-  PQreset : procedure (conn:PPGconn);cdecl;
-{ issue a cancel request  }
-  PQrequestCancel : function (conn:PPGconn):longint;cdecl;
-{ Accessor functions for PGconn objects  }
-  PQdb : function (conn:PPGconn):Pchar;cdecl;
-  PQuser : function (conn:PPGconn):Pchar;cdecl;
-  PQpass : function (conn:PPGconn):Pchar;cdecl;
-  PQhost : function (conn:PPGconn):Pchar;cdecl;
-  PQport : function (conn:PPGconn):Pchar;cdecl;
-  PQtty : function (conn:PPGconn):Pchar;cdecl;
-  PQoptions : function (conn:PPGconn):Pchar;cdecl;
-  PQstatus : function (conn:PPGconn):TConnStatusType;cdecl;
-  PQtransactionStatus : function (conn:PPGconn):PGTransactionStatusType;cdecl;
-  PQparameterStatus : function (conn:PPGconn; paramName:Pchar):Pchar;cdecl;
-  PQprotocolVersion : function (conn:PPGconn):longint;cdecl;
-  PQerrorMessage : function (conn:PPGconn):Pchar;cdecl;
-  PQsocket : function (conn:PPGconn):longint;cdecl;
-  PQbackendPID : function (conn:PPGconn):longint;cdecl;
-  PQclientEncoding : function (conn:PPGconn):longint;cdecl;
-  PQsetClientEncoding : function (conn:PPGconn; encoding:Pchar):longint;cdecl;
-{$ifdef USE_SSL}
-{ Get the SSL structure associated with a connection  }
-  PQgetssl : function (conn:PPGconn):PSSL;cdecl;
-{$endif}
-{ Set verbosity for PQerrorMessage and PQresultErrorMessage  }
-  PQsetErrorVerbosity : function (conn:PPGconn; verbosity:PGVerbosity):PGVerbosity;cdecl;
-{ Enable/disable tracing  }
-  PQtrace : procedure (conn:PPGconn; debug_port:PFILE);cdecl;
-  PQuntrace : procedure (conn:PPGconn);cdecl;
-{ Override default notice handling routines  }
-  PQsetNoticeReceiver : function (conn:PPGconn; proc:PQnoticeReceiver; arg:pointer):PQnoticeReceiver;cdecl;
-  PQsetNoticeProcessor : function (conn:PPGconn; proc:PQnoticeProcessor; arg:pointer):PQnoticeProcessor;cdecl;
-{ === in fe-exec.c ===  }
-{ Simple synchronous query  }
-  PQexec : function (conn:PPGconn; query:Pchar):PPGresult;cdecl;
-  PQexecParams : function (conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;
-  PQexecPrepared : function (conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;paramFormats:Plongint; resultFormat:longint):PPGresult;cdecl;
-  PQPrepare : function (conn:PPGconn; stmtName:Pchar; query:Pchar; nParams:longint; paramTypes:POid):PPGresult;cdecl;
-{ Interface for multiple-result or asynchronous queries  }
-  PQsendQuery : function (conn:PPGconn; query:Pchar):longint;cdecl;
-  PQsendQueryParams : function (conn:PPGconn; command:Pchar; nParams:longint; paramTypes:POid; paramValues:PPchar;paramLengths:Plongint; paramFormats:Plongint; resultFormat:longint):longint;cdecl;
-  PQsendQueryPrepared : function (conn:PPGconn; stmtName:Pchar; nParams:longint; paramValues:PPchar; paramLengths:Plongint;paramFormats:Plongint; resultFormat:longint):longint;cdecl;
-  PQgetResult : function (conn:PPGconn):PPGresult;cdecl;
-{ Routines for managing an asynchronous query  }
-  PQisBusy : function (conn:PPGconn):longint;cdecl;
-  PQconsumeInput : function (conn:PPGconn):longint;cdecl;
-{ LISTEN/NOTIFY support  }
-  PQnotifies : function (conn:PPGconn):PPGnotify;cdecl;
-{ Routines for copy in/out  }
-  PQputCopyData : function (conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;
-  PQputCopyEnd : function (conn:PPGconn; errormsg:Pchar):longint;cdecl;
-  PQgetCopyData : function (conn:PPGconn; buffer:PPchar; async:longint):longint;cdecl;
-{ Deprecated routines for copy in/out  }
-  PQgetline : function (conn:PPGconn; _string:Pchar; length:longint):longint;cdecl;
-  PQputline : function (conn:PPGconn; _string:Pchar):longint;cdecl;
-  PQgetlineAsync : function (conn:PPGconn; buffer:Pchar; bufsize:longint):longint;cdecl;
-  PQputnbytes : function (conn:PPGconn; buffer:Pchar; nbytes:longint):longint;cdecl;
-  PQendcopy : function (conn:PPGconn):longint;cdecl;
-{ Set blocking/nonblocking connection to the backend  }
-  PQsetnonblocking : function (conn:PPGconn; arg:longint):longint;cdecl;
-  PQisnonblocking : function (conn:PPGconn):longint;cdecl;
-{ Force the write buffer to be written (or at least try)  }
-  PQflush : function (conn:PPGconn):longint;cdecl;
-{
-* "Fast path" interface --- not really recommended for application
-* use
-}
-  PQfn : function (conn:PPGconn; fnid:longint; result_buf:Plongint; result_len:Plongint; result_is_int:longint;args:PPQArgBlock; nargs:longint):PPGresult;cdecl;
-{ Accessor functions for PGresult objects  }
-  PQresultStatus : function (res:PPGresult):TExecStatusType;cdecl;
-  PQresStatus : function (status:TExecStatusType):Pchar;cdecl;
-  PQresultErrorMessage : function (res:PPGresult):Pchar;cdecl;
-  PQresultErrorField : function (res:PPGresult; fieldcode:longint):Pchar;cdecl;
-  PQntuples : function (res:PPGresult):longint;cdecl;
-  PQnfields : function (res:PPGresult):longint;cdecl;
-  PQbinaryTuples : function (res:PPGresult):longint;cdecl;
-  PQfname : function (res:PPGresult; field_num:longint):Pchar;cdecl;
-  PQfnumber : function (res:PPGresult; field_name:Pchar):longint;cdecl;
-  PQftable : function (res:PPGresult; field_num:longint):Oid;cdecl;
-  PQftablecol : function (res:PPGresult; field_num:longint):longint;cdecl;
-  PQfformat : function (res:PPGresult; field_num:longint):longint;cdecl;
-  PQftype : function (res:PPGresult; field_num:longint):Oid;cdecl;
-  PQfsize : function (res:PPGresult; field_num:longint):longint;cdecl;
-  PQfmod : function (res:PPGresult; field_num:longint):longint;cdecl;
-  PQcmdStatus : function (res:PPGresult):Pchar;cdecl;
-  PQoidStatus : function (res:PPGresult):Pchar;cdecl;
-{ old and ugly  }
-  PQoidValue : function (res:PPGresult):Oid;cdecl;
-{ new and improved  }
-  PQcmdTuples : function (res:PPGresult):Pchar;cdecl;
-  PQgetvalue : function (res:PPGresult; tup_num:longint; field_num:longint):Pchar;cdecl;
-  PQgetlength : function (res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
-  PQgetisnull : function (res:PPGresult; tup_num:longint; field_num:longint):longint;cdecl;
-{ Delete a PGresult  }
-  PQclear : procedure (res:PPGresult);cdecl;
-{ For freeing other alloc'd results, such as PGnotify structs  }
-  PQfreemem : procedure (ptr:pointer);cdecl;
-{ Exists for backward compatibility.  bjm 2003-03-24  }
-{ was #define dname(params) para_def_expr }
-{ argument types are unknown }
-{ return type might be wrong }
-//  function PQfreeNotify(ptr : longint) : longint;
-{
-* Make an empty PGresult with given status (some apps find this
-* useful). If conn is not NULL and status indicates an error, the
-* conn's errorMessage is copied.
-}
-  PQmakeEmptyPGresult : function (conn:PPGconn; status:TExecStatusType):PPGresult;cdecl;
-{ Quoting strings before inclusion in queries.  }
-  PQescapeString : function (till:Pchar; from:Pchar; length:size_t):size_t;cdecl;
-  PQescapeBytea : function (bintext:Pbyte; binlen:size_t; bytealen:Psize_t):Pbyte;cdecl;
-  PQunescapeBytea : function (strtext:Pbyte; retbuflen:Psize_t):Pbyte;cdecl;
-{ === in fe-print.c ===  }
-{ output stream  }
-  PQprint : procedure (fout:PFILE; res:PPGresult; ps:PPQprintOpt);cdecl;
-{ option structure  }
-{
-* really old printing routines
-}
-{ where to send the output  }
-{ pad the fields with spaces  }
-{ field separator  }
-{ display headers?  }
-  PQdisplayTuples : procedure (res:PPGresult; fp:PFILE; fillAlign:longint; fieldSep:Pchar; printHeader:longint;quiet:longint);cdecl;
-(* Const before type ignored *)
-{ output stream  }
-{ print attribute names  }
-{ delimiter bars  }
-  PQprintTuples : procedure (res:PPGresult; fout:PFILE; printAttName:longint; terseOutput:longint; width:longint);cdecl;
-{ width of column, if 0, use variable
-* width  }
-{ === in fe-lobj.c ===  }
-{ Large-object access routines  }
-  lo_open : function (conn:PPGconn; lobjId:Oid; mode:longint):longint;cdecl;
-  lo_close : function (conn:PPGconn; fd:longint):longint;cdecl;
-  lo_read : function (conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;
-  lo_write : function (conn:PPGconn; fd:longint; buf:Pchar; len:size_t):longint;cdecl;
-  lo_lseek : function (conn:PPGconn; fd:longint; offset:longint; whence:longint):longint;cdecl;
-  lo_creat : function (conn:PPGconn; mode:longint):Oid;cdecl;
-  lo_tell : function (conn:PPGconn; fd:longint):longint;cdecl;
-  lo_unlink : function (conn:PPGconn; lobjId:Oid):longint;cdecl;
-  lo_import : function (conn:PPGconn; filename:Pchar):Oid;cdecl;
-  lo_export : function (conn:PPGconn; lobjId:Oid; filename:Pchar):longint;cdecl;
-{ === in fe-misc.c ===  }
-{ Determine length of multibyte encoded char at *s  }
-  PQmblen : function (s:Pbyte; encoding:longint):longint;cdecl;
-{ Get encoding id from environment variable PGCLIENTENCODING  }
-  PQenv2encoding: function :longint;cdecl;
-
-Procedure InitialisePostgres3;
-Procedure ReleasePostgres3;
-
-var Postgres3LibraryHandle : TLibHandle;
-
-implementation
-
-var RefCount : integer;
-
-Procedure InitialisePostgres3;
-
-begin
-  inc(RefCount);
-  if RefCount = 1 then
-    begin
-    Postgres3LibraryHandle := loadlibrary(pqlib);
-    if Postgres3LibraryHandle = nilhandle then
-      begin
-      RefCount := 0;
-      Raise EInOutError.Create('Can not load PosgreSQL client. Is it installed? ('+pqlib+')');
-      end;
-
-    pointer(PQconnectStart) := GetProcedureAddress(Postgres3LibraryHandle,'PQconnectStart');
-    pointer(PQconnectPoll) := GetProcedureAddress(Postgres3LibraryHandle,'PQconnectPoll');
-    pointer(PQconnectdb) := GetProcedureAddress(Postgres3LibraryHandle,'PQconnectdb');
-    pointer(PQsetdbLogin) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetdbLogin');
-    pointer(PQfinish) := GetProcedureAddress(Postgres3LibraryHandle,'PQfinish');
-    pointer(PQconndefaults) := GetProcedureAddress(Postgres3LibraryHandle,'PQconndefaults');
-    pointer(PQconninfoFree) := GetProcedureAddress(Postgres3LibraryHandle,'PQconninfoFree');
-    pointer(PQresetStart) := GetProcedureAddress(Postgres3LibraryHandle,'PQresetStart');
-    pointer(PQresetPoll) := GetProcedureAddress(Postgres3LibraryHandle,'PQresetPoll');
-    pointer(PQreset) := GetProcedureAddress(Postgres3LibraryHandle,'PQreset');
-    pointer(PQrequestCancel) := GetProcedureAddress(Postgres3LibraryHandle,'PQrequestCancel');
-    pointer(PQdb) := GetProcedureAddress(Postgres3LibraryHandle,'PQdb');
-    pointer(PQuser) := GetProcedureAddress(Postgres3LibraryHandle,'PQuser');
-    pointer(PQpass) := GetProcedureAddress(Postgres3LibraryHandle,'PQpass');
-    pointer(PQhost) := GetProcedureAddress(Postgres3LibraryHandle,'PQhost');
-    pointer(PQport) := GetProcedureAddress(Postgres3LibraryHandle,'PQport');
-    pointer(PQtty) := GetProcedureAddress(Postgres3LibraryHandle,'PQtty');
-    pointer(PQoptions) := GetProcedureAddress(Postgres3LibraryHandle,'PQoptions');
-    pointer(PQstatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQstatus');
-    pointer(PQtransactionStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQtransactionStatus');
-    pointer(PQparameterStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQparameterStatus');
-    pointer(PQprotocolVersion) := GetProcedureAddress(Postgres3LibraryHandle,'PQprotocolVersion');
-    pointer(PQerrorMessage) := GetProcedureAddress(Postgres3LibraryHandle,'PQerrorMessage');
-    pointer(PQsocket) := GetProcedureAddress(Postgres3LibraryHandle,'PQsocket');
-    pointer(PQbackendPID) := GetProcedureAddress(Postgres3LibraryHandle,'PQbackendPID');
-    pointer(PQclientEncoding) := GetProcedureAddress(Postgres3LibraryHandle,'PQclientEncoding');
-    pointer(PQsetClientEncoding) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetClientEncoding');
-{$ifdef USE_SSL}
-    pointer(PQgetssl) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetssl');
-{$endif}
-    pointer(PQsetErrorVerbosity) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetErrorVerbosity');
-    pointer(PQtrace) := GetProcedureAddress(Postgres3LibraryHandle,'PQtrace');
-    pointer(PQuntrace) := GetProcedureAddress(Postgres3LibraryHandle,'PQuntrace');
-    pointer(PQsetNoticeReceiver) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetNoticeReceiver');
-    pointer(PQsetNoticeProcessor) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetNoticeProcessor');
-    pointer(PQexec) := GetProcedureAddress(Postgres3LibraryHandle,'PQexec');
-    pointer(PQexecParams) := GetProcedureAddress(Postgres3LibraryHandle,'PQexecParams');
-    pointer(PQexecPrepared) := GetProcedureAddress(Postgres3LibraryHandle,'PQexecPrepared');
-    pointer(PQPrepare) := GetProcedureAddress(Postgres3LibraryHandle,'PQPrepare');
-    pointer(PQsendQuery) := GetProcedureAddress(Postgres3LibraryHandle,'PQsendQuery');
-    pointer(PQsendQueryParams) := GetProcedureAddress(Postgres3LibraryHandle,'PQsendQueryParams');
-    pointer(PQsendQueryPrepared) := GetProcedureAddress(Postgres3LibraryHandle,'PQsendQueryPrepared');
-    pointer(PQgetResult) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetResult');
-    pointer(PQisBusy) := GetProcedureAddress(Postgres3LibraryHandle,'PQisBusy');
-    pointer(PQconsumeInput) := GetProcedureAddress(Postgres3LibraryHandle,'PQconsumeInput');
-    pointer(PQnotifies) := GetProcedureAddress(Postgres3LibraryHandle,'PQnotifies');
-    pointer(PQputCopyData) := GetProcedureAddress(Postgres3LibraryHandle,'PQputCopyData');
-    pointer(PQputCopyEnd) := GetProcedureAddress(Postgres3LibraryHandle,'PQputCopyEnd');
-    pointer(PQgetCopyData) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetCopyData');
-    pointer(PQgetline) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetline');
-    pointer(PQputline) := GetProcedureAddress(Postgres3LibraryHandle,'PQputline');
-    pointer(PQgetlineAsync) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetlineAsync');
-    pointer(PQputnbytes) := GetProcedureAddress(Postgres3LibraryHandle,'PQputnbytes');
-    pointer(PQendcopy) := GetProcedureAddress(Postgres3LibraryHandle,'PQendcopy');
-    pointer(PQsetnonblocking) := GetProcedureAddress(Postgres3LibraryHandle,'PQsetnonblocking');
-    pointer(PQisnonblocking) := GetProcedureAddress(Postgres3LibraryHandle,'PQisnonblocking');
-    pointer(PQflush) := GetProcedureAddress(Postgres3LibraryHandle,'PQflush');
-    pointer(PQfn) := GetProcedureAddress(Postgres3LibraryHandle,'PQfn');
-    pointer(PQresultStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQresultStatus');
-    pointer(PQresStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQresStatus');
-    pointer(PQresultErrorMessage) := GetProcedureAddress(Postgres3LibraryHandle,'PQresultErrorMessage');
-    pointer(PQresultErrorField) := GetProcedureAddress(Postgres3LibraryHandle,'PQresultErrorField');
-    pointer(PQntuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQntuples');
-    pointer(PQnfields) := GetProcedureAddress(Postgres3LibraryHandle,'PQnfields');
-    pointer(PQbinaryTuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQbinaryTuples');
-    pointer(PQfname) := GetProcedureAddress(Postgres3LibraryHandle,'PQfname');
-    pointer(PQfnumber) := GetProcedureAddress(Postgres3LibraryHandle,'PQfnumber');
-    pointer(PQftable) := GetProcedureAddress(Postgres3LibraryHandle,'PQftable');
-    pointer(PQftablecol) := GetProcedureAddress(Postgres3LibraryHandle,'PQftablecol');
-    pointer(PQfformat) := GetProcedureAddress(Postgres3LibraryHandle,'PQfformat');
-    pointer(PQftype) := GetProcedureAddress(Postgres3LibraryHandle,'PQftype');
-    pointer(PQfsize) := GetProcedureAddress(Postgres3LibraryHandle,'PQfsize');
-    pointer(PQfmod) := GetProcedureAddress(Postgres3LibraryHandle,'PQfmod');
-    pointer(PQcmdStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQcmdStatus');
-    pointer(PQoidStatus) := GetProcedureAddress(Postgres3LibraryHandle,'PQoidStatus');
-    pointer(PQoidValue) := GetProcedureAddress(Postgres3LibraryHandle,'PQoidValue');
-    pointer(PQcmdTuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQcmdTuples');
-    pointer(PQgetvalue) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetvalue');
-    pointer(PQgetlength) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetlength');
-    pointer(PQgetisnull) := GetProcedureAddress(Postgres3LibraryHandle,'PQgetisnull');
-    pointer(PQclear) := GetProcedureAddress(Postgres3LibraryHandle,'PQclear');
-    pointer(PQfreemem) := GetProcedureAddress(Postgres3LibraryHandle,'PQfreemem');
-    pointer(PQmakeEmptyPGresult) := GetProcedureAddress(Postgres3LibraryHandle,'PQmakeEmptyPGresult');
-    pointer(PQescapeString) := GetProcedureAddress(Postgres3LibraryHandle,'PQescapeString');
-    pointer(PQescapeBytea) := GetProcedureAddress(Postgres3LibraryHandle,'PQescapeBytea');
-    pointer(PQunescapeBytea) := GetProcedureAddress(Postgres3LibraryHandle,'PQunescapeBytea');
-    pointer(PQprint) := GetProcedureAddress(Postgres3LibraryHandle,'PQprint');
-    pointer(PQdisplayTuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQdisplayTuples');
-    pointer(PQprintTuples) := GetProcedureAddress(Postgres3LibraryHandle,'PQprintTuples');
-    pointer(lo_open) := GetProcedureAddress(Postgres3LibraryHandle,'lo_open');
-    pointer(lo_close) := GetProcedureAddress(Postgres3LibraryHandle,'lo_close');
-    pointer(lo_read) := GetProcedureAddress(Postgres3LibraryHandle,'lo_read');
-    pointer(lo_write) := GetProcedureAddress(Postgres3LibraryHandle,'lo_write');
-    pointer(lo_lseek) := GetProcedureAddress(Postgres3LibraryHandle,'lo_lseek');
-    pointer(lo_creat) := GetProcedureAddress(Postgres3LibraryHandle,'lo_creat');
-    pointer(lo_tell) := GetProcedureAddress(Postgres3LibraryHandle,'lo_tell');
-    pointer(lo_unlink) := GetProcedureAddress(Postgres3LibraryHandle,'lo_unlink');
-    pointer(lo_import) := GetProcedureAddress(Postgres3LibraryHandle,'lo_import');
-    pointer(lo_export) := GetProcedureAddress(Postgres3LibraryHandle,'lo_export');
-    pointer(PQmblen) := GetProcedureAddress(Postgres3LibraryHandle,'PQmblen');
-    pointer(PQenv2encoding) := GetProcedureAddress(Postgres3LibraryHandle,'PQenv2encoding');
-
-    InitialiseDllist;
-    end;
-end;
-
-Procedure ReleasePostgres3;
-
-begin
-  if RefCount > 0 then dec(RefCount);
-  if RefCount = 0 then
-    begin
-    if not UnloadLibrary(Postgres3LibraryHandle) then inc(RefCount);
-    ReleaseDllist;
-    end;
-end;
-
-// This function is also defined in postgres3!
-function PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME : pchar) : ppgconn;
-begin
-   PQsetdb:=PQsetdbLogin(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME,'','');
-end;
-
-
-end.

+ 0 - 178
packages/base/postgres/postgres3types.inc

@@ -1,178 +0,0 @@
-{
-  Contains the types needed for use with Postgres protocol v3
-}
-
-Type
-  size_t    = sizeint;
-  psize_t   = ^size_t;
-  TFILE     = Longint;
-  PFIle     = ^TFILE;
-  POid      = ^Oid;
-  Oid       = dword;
-
-const
-   ERROR_MSG_LENGTH = 4096;
-   CMDSTATUS_LEN = 40;
-
-Type
-  TSockAddr = Array [1..112] of byte;
-  TPGresAttDesc = record
-       name : Pchar;
-       adtid : Oid;
-       adtsize : integer;
-    end;
-  PPGresAttDesc= ^TPGresAttDesc;
-  PPPGresAttDesc= ^PPGresAttDesc;
-  TPGresAttValue = record
-       len : longint;
-       value : Pchar;
-    end;
-  PPGresAttValue= ^TPGresAttValue;
-  PPPGresAttValue= ^PPGresAttValue;
-
-  PExecStatusType = ^TExecStatusType;
-  TExecStatusType = (PGRES_EMPTY_QUERY := 0,PGRES_COMMAND_OK,
-       PGRES_TUPLES_OK,PGRES_COPY_OUT,PGRES_COPY_IN,
-       PGRES_BAD_RESPONSE,PGRES_NONFATAL_ERROR,
-       PGRES_FATAL_ERROR);
-
-
-  TPGlobjfuncs = record
-        fn_lo_open   : Oid;
-        fn_lo_close  : Oid;
-        fn_lo_creat  : Oid;
-        fn_lo_unlink : Oid;
-        fn_lo_lseek  : Oid;
-        fn_lo_tell   : Oid;
-        fn_lo_read   : Oid;
-        fn_lo_write  : Oid;
-    end;
-  PPGlobjfuncs= ^TPGlobjfuncs;
-
-  PConnStatusType = ^TConnStatusType;
-  TConnStatusType = (CONNECTION_OK,CONNECTION_BAD,CONNECTION_STARTED,
-       CONNECTION_MADE,CONNECTION_AWAITING_RESPONSE,
-       CONNECTION_AUTH_OK,CONNECTION_SETENV,
-       CONNECTION_SSL_STARTUP,CONNECTION_NEEDED);
-
-   TPGconn = record
-        pghost : Pchar;
-        pgtty : Pchar;
-        pgport : Pchar;
-        pgoptions : Pchar;
-        dbName : Pchar;
-        status : TConnStatusType;
-        errorMessage : array[0..(ERROR_MSG_LENGTH)-1] of char;
-        Pfin : PFILE;
-        Pfout : PFILE;
-        Pfdebug : PFILE;
-        sock : longint;
-        laddr : TSockAddr;
-        raddr : TSockAddr;
-        salt : array[0..(2)-1] of char;
-        asyncNotifyWaiting : longint;
-        notifyList : PDllist;
-        pguser : Pchar;
-        pgpass : Pchar;
-        lobjfuncs : PPGlobjfuncs;
-    end;
-  PPGconn= ^TPGconn;
-
-  TPGresult = record
-        ntups : longint;
-        numAttributes : longint;
-        attDescs : PPGresAttDesc;
-        tuples : PPPGresAttValue;
-        tupArrSize : longint;
-        resultStatus : TExecStatusType;
-        cmdStatus : array[0..(CMDSTATUS_LEN)-1] of char;
-        binary : longint;
-        conn : PPGconn;
-    end;
-  PPGresult= ^TPGresult;
-
-
-
-
-
-  PPostgresPollingStatusType = ^PostgresPollingStatusType;
-  PostgresPollingStatusType = (PGRES_POLLING_FAILED := 0,PGRES_POLLING_READING,
-       PGRES_POLLING_WRITING,PGRES_POLLING_OK,
-       PGRES_POLLING_ACTIVE);
-
-
-  PPGTransactionStatusType = ^PGTransactionStatusType;
-  PGTransactionStatusType = (PQTRANS_IDLE,PQTRANS_ACTIVE,PQTRANS_INTRANS,
-       PQTRANS_INERROR,PQTRANS_UNKNOWN);
-
-  PPGVerbosity = ^PGVerbosity;
-  PGVerbosity = (PQERRORS_TERSE,PQERRORS_DEFAULT,PQERRORS_VERBOSE);
-
-  PpgNotify = ^pgNotify;
-  pgNotify = record
-          relname : Pchar;
-          be_pid : longint;
-          extra : Pchar;
-    end;
-
-{ Function types for notice-handling callbacks  }
-  PQnoticeReceiver = procedure (arg:pointer; res:PPGresult);cdecl;
-  PQnoticeProcessor = procedure (arg:pointer; message:Pchar);cdecl;
-{ Print options for PQprint()  }
-  Ppqbool = ^pqbool;
-  pqbool = char;
-
-  P_PQprintOpt = ^_PQprintOpt;
-  _PQprintOpt = record
-          header : pqbool;
-          align : pqbool;
-          standard : pqbool;
-          html3 : pqbool;
-          expanded : pqbool;
-          pager : pqbool;
-          fieldSep : Pchar;
-          tableOpt : Pchar;
-          caption : Pchar;
-          fieldName : ^Pchar;
-    end;
-  PQprintOpt = _PQprintOpt;
-  PPQprintOpt = ^PQprintOpt;
-
-  { ----------------
-   * Structure for the conninfo parameter definitions returned by PQconndefaults
-   *
-   * All fields except "val" point at static strings which must not be altered.
-   * "val" is either NULL or a malloc'd current-value string.  PQconninfoFree()
-   * will release both the val strings and the PQconninfoOption array itself.
-   * ----------------
-    }
-
-     P_PQconninfoOption = ^_PQconninfoOption;
-     _PQconninfoOption = record
-          keyword : Pchar;
-          envvar : Pchar;
-          compiled : Pchar;
-          val : Pchar;
-          _label : Pchar;
-          dispchar : Pchar;
-          dispsize : longint;
-       end;
-     PQconninfoOption = _PQconninfoOption;
-     PPQconninfoOption = ^PQconninfoOption;
-  { ----------------
-   * PQArgBlock -- structure for PQfn() arguments
-   * ----------------
-    }
-  { can't use void (dec compiler barfs)   }
-
-     PPQArgBlock = ^PQArgBlock;
-     PQArgBlock = record
-          len : longint;
-          isint : longint;
-          u : record
-              case longint of
-                 0 : ( ptr : Plongint );
-                 1 : ( integer : longint );
-              end;
-       end;
-

+ 0 - 16
packages/base/postgres/rmdb

@@ -1,16 +0,0 @@
-#!/bin/sh
-#
-# Small script to remove the demo database again.
-# This script accepts 1 (optional) argument : 
-# a database you can connect to. Default is 'testdb'
-# 
-echo -n "Removing table email from db ${1-testdb}..." 
-psql ${1-testdb} << EOF >/dev/null 2>&1
-drop table email;
-EOF
-if [ ! $? = 0 ]; then
-  echo "Failed."
-else
-  echo "Done."
-fi
-# Ready

+ 0 - 105
packages/base/postgres/testpg1.pp

@@ -1,105 +0,0 @@
-Program testpg;
-
-{ Demo program to test pascal connection with postgres database }
-{ Translated from the testlibpq example program of PostGreSQL   }
-
-Uses postgres,strings;
-
-
-Procedure exit_nicely(Conn : PPGconn);
-
-begin
-  PQfinish(conn);
-  halt(1);
-end;
-
-
-Var
-  pghost,pgport,pgoptions,pgtty,dbname : Pchar;
-  nFields,i,j : longint;
-  conn : PPGConn;
-  res : PPGresult;
-
-begin
-  pghost := NiL;        { host name of the backend server }
-  pgport := NiL;        { port of the backend server }
-  pgoptions := NiL;     { special options to start up the backend server }
-  pgtty := NiL;         { debugging tty for the backend server }
-  dbName := 'template1';
-
-  { make a connection to the database }
-  conn := PQsetdb(pghost, pgport, pgoptions, pgtty, dbName);
-
-  { check to see that the backend connection was successfully made }
-  if (PQstatus(conn) = CONNECTION_BAD) then
-    begin
-    Writeln (stderr, 'Connection to database ',dbname,' failed.');
-    Writeln (stderr, PQerrorMessage(conn));
-    exit_nicely(conn);
-    end;
-
-
-  { start a transaction block }
-  res := PQexec(conn, 'BEGIN');
-  if (PQresultStatus(res) <> PGRES_COMMAND_OK) then
-    begin
-    Writeln (stderr, 'BEGIN command failed');
-    PQclear(res);
-    exit_nicely(conn);
-    end;
-
-  {
-   * should PQclear PGresult whenever it is no longer needed to avoid
-   * memory leaks
-   }
-  PQclear(res);
-
-  {
-   * fetch instances from the pg_database, the system catalog of
-   * databases
-   }
-  res := PQexec(conn, 'DECLARE myportal CURSOR FOR select * from pg_database');
-  if (PQresultStatus(res) <> PGRES_COMMAND_OK) then
-    begin
-    Writeln (stderr, 'DECLARE CURSOR command failed');
-    PQclear(res);
-    exit_nicely(conn);
-    end;
-  PQclear(res);
-
-  res := PQexec(conn, 'FETCH ALL in myportal');
-  if (PQresultStatus(res) <> PGRES_TUPLES_OK) then
-    begin
-    Writeln (stderr, 'FETCH ALL command didn''t return tuples properly');
-    PQclear(res);
-    exit_nicely(conn);
-    end;
-
-  { first, print out the attribute names }
-  nFields := PQnfields(res);
-  for i := 0 to nFields-1 do
-    Write (PQfname(res, i),space (15-strlen(PQfname(res, i))) );
-  writeln;
-  writeln;
-
-  { next, print out the instances }
-  for i := 0 to PQntuples(res)-1 do
-    begin
-    for j := 0 to nFields-1 do
-      write(PQgetvalue(res, i, j),space (15-strlen(PQgetvalue(res, i,j))));
-    writeln;
-    end;
-
-  PQclear(res);
-
-  { close the portal }
-  res := PQexec(conn, 'CLOSE myportal');
-  PQclear(res);
-
-  { end the transaction }
-  res := PQexec(conn, 'END');
-  PQclear(res);
-
-  { close the connection to the database and cleanup }
-  PQfinish(conn);
-end.

+ 0 - 78
packages/base/postgres/testpg2.pp

@@ -1,78 +0,0 @@
-Program testpg;
-
-{ Demo program to test pascal connection with postgres database }
-{ Translated from the testlibpq example program of PostGreSQL   }
-
-Uses postgres,strings;
-
-
-Procedure exit_nicely(Conn : PPGconn);
-
-begin
-  PQfinish(conn);
-  halt(1);
-end;
-
-
-Var
-  pghost,pgport,pgoptions,pgtty,dbname : Pchar;
-  nFields,i : longint;
-  conn : PPGConn;
-  res : PPGresult;
-  dummy : string;
-
-begin
-  pghost := NiL;        { host name of the backend server }
-  pgport := NiL;        { port of the backend server }
-  pgoptions := NiL;     { special options to start up the backend server }
-  pgtty := NiL;         { debugging tty for the backend server }
-  if paramcount=1 then
-    begin
-    dummy:=paramstr(1)+#0;
-    dbname:=@dummy[1];
-    end
-  else
-    dbName := 'testdb';
-
-  { make a connection to the database }
-  conn := PQsetdb(pghost, pgport, pgoptions, pgtty, dbName);
-
-  { check to see that the backend connection was successfully made }
-  if (PQstatus(conn) = CONNECTION_BAD) then
-    begin
-    Writeln (stderr, 'Connection to database ',dbname,' failed.');
-    Writeln (stderr, PQerrorMessage(conn));
-    exit_nicely(conn);
-    end;
-
-  res := PQexec(conn, 'select * from email');
-  if (PQresultStatus(res) <> PGRES_TUPLES_OK) then
-    begin
-    Writeln (stderr, 'select command failed.');
-    PQclear(res);
-    exit_nicely(conn);
-    end;
-
-
-  { first, print out the attribute names }
-  nFields := PQnfields(res);
-  Write ('|',PQfname(res, 0),space (4-strlen(PQfname(res, 0))) );
-  Write ('|',PQfname(res, 1),space (20-strlen(PQfname(res, 1))) );
-  Write ('|',PQfname(res, 2),space (40-strlen(PQfname(res, 2))) );
-  writeln ('|');
-  writeln ('+----+--------------------+----------------------------------------+');
-
-  { next, print out the instances }
-  for i := 0 to PQntuples(res)-1 do
-    begin
-    write('|',PQgetvalue(res, i, 0),space (4-strlen(PQgetvalue(res, i,0))));
-    write('|',PQgetvalue(res, i, 1),space (20-strlen(PQgetvalue(res, i,1))));
-    write('|',PQgetvalue(res, i, 2),space (40-strlen(PQgetvalue(res, i,2))));
-    writeln ('|');
-    end;
-
-  PQclear(res);
-
-  { close the connection to the database and cleanup }
-  PQfinish(conn);
-end.

+ 0 - 1931
packages/base/pthreads/Makefile

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

+ 0 - 22
packages/base/pthreads/Makefile.fpc

@@ -1,22 +0,0 @@
-#
-#   Makefile.fpc for pthreads implementation
-#
-
-[package]
-name=pthreads
-version=2.0.0
-
-[target]
-units=pthreads
-
-[require]
-
-[install]
-fpcpackage=y
-
-[default]
-fpcdir=../../..
-
-[rules]
-.NOTPARALLEL:
-

+ 0 - 9
packages/base/pthreads/fpmake.inc

@@ -1,9 +0,0 @@
-    StartPackage('pthreads');
-    {$IF defined(ALLPACKAGES)}
-    Directory:='base/pthreads';
-    {$ELSEIF defined(BASEPACKAGES)}
-    Directory:='pthreads';
-    {$ENDIF}
-    OS:=[linux,freebsd,darwin,beos],;
-    T:=Targets.AddUnit('pthreads');
-    EndPackage;

+ 0 - 17
packages/base/pthreads/fpmake.pp

@@ -1,17 +0,0 @@
-{$mode objfpc}{$H+}
-program fpmake;
-
-uses fpmkunit;
-
-Var
-  T : TTarget;
-
-begin
-  With Installer do 
-    begin
-    { Base packages }
-    {$i fpmake.inc}
-    Run;
-    end;
-end.
-

+ 0 - 357
packages/base/pthreads/pthrbeos.inc

@@ -1,357 +0,0 @@
-{
-   This file is part of the Free Pascal run time library.
-   Copyright (c) 1999-2000 by Michael Van Canneyt,
-   BSD parts (c) 2000 by Marco van de Voort
-   members of the Free Pascal development team.
-
-   New linux unit. Linux only calls only. Will be renamed to linux.pp
-   when 1.0.x support is killed off.
-
-   See the file COPYING.FPC, included in this distribution,
-   for details about the copyright.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY;without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-**********************************************************************}
-
-{
-  Automatically converted by H2Pas 0.99.15 from pthrwrk2.h
-}
-
-{$linklib pthread}      // The compiler changes this to c_r if needed.
-{$linklib c}            // (parameter -Xf)
-
-{$PACKRECORDS C}
-
-
-  {
-     Copyright (c) 1993, 1994 by Chris Provenzano, [email protected]
-     Copyright (c) 1995-1998 by John Birrell <[email protected]>
-     All rights reserved.
-
-     Redistribution and use in source and binary forms, with or without
-     modification, are permitted provided that the following conditions
-     are met:
-     1. Redistributions of source code must retain the above copyright
-        notice, this list of conditions and the following disclaimer.
-     2. Redistributions in binary form must reproduce the above copyright
-        notice, this list of conditions and the following disclaimer in the
-        documentation and/or other materials provided with the distribution.
-     3. All advertising materials mentioning features or use of this software
-        must display the following acknowledgement:
-      This product includes software developed by Chris Provenzano.
-     4. The name of Chris Provenzano may not be used to endorse or promote
-          products derived from this software without specific prior written
-          permission.
-
-     THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
-     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-     ARE DISCLAIMED.  IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
-     DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-     LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-     OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-     SUCH DAMAGE.
-
-     $FreeBSD: src/include/pthread.h,v 1.20.2.4 2003/05/27 18:18:01 jdp Exp $
-    }
-
-    {
-     Run-time invariant values:
-    }
-
-
-CONST ULONG_MAX= high(culong);
-
-type
-
-     psize_t   = ^size_t;
-     psigset_t = ^sigset_t;
-
-const
-    PTHREAD_MUTEX_NORMAL     = _PTHREAD_MUTEX_NORMAL;
-    PTHREAD_MUTEX_ERRORCHECK = _PTHREAD_MUTEX_ERRORCHECK;
-    PTHREAD_MUTEX_RECURSIVE  = _PTHREAD_MUTEX_RECURSIVE;
-
-     PTHREAD_MUTEX_DEFAULT    = _PTHREAD_MUTEX_NORMAL;
-     MUTEX_TYPE_FAST          = _PTHREAD_MUTEX_NORMAL;
-     MUTEX_TYPE_COUNTING_FAST = _PTHREAD_MUTEX_RECURSIVE;
-
-
-     PTHREAD_DESTRUCTOR_ITERATIONS = 4;
-     PTHREAD_KEYS_MAX              = _PTHREAD_KEYS_MAX;
-     PTHREAD_STACK_MIN             = _PTHREAD_STACK_MIN;
-     PTHREAD_THREADS_MAX           = ULONG_MAX;
-    {
-     Flags for threads and thread attributes.
-    }
-     PTHREAD_DETACHED              = $1;
-     PTHREAD_SCOPE_SYSTEM          = $2;
-     PTHREAD_INHERIT_SCHED         = $4;
-     PTHREAD_NOFLOAT               = $8;
-     PTHREAD_CREATE_DETACHED       = PTHREAD_DETACHED;
-     PTHREAD_CREATE_JOINABLE       = 0;
-     PTHREAD_SCOPE_PROCESS         = 0;
-     PTHREAD_EXPLICIT_SCHED        = 0;
-
-    {
-     Flags for read/write lock attributes
-    }
-     PTHREAD_PROCESS_PRIVATE       = 0;
-     PTHREAD_PROCESS_SHARED        = 1;
-    {
-     Flags for cancelling threads
-    }
-     PTHREAD_CANCEL_ENABLE         = 0;
-     PTHREAD_CANCEL_DISABLE        = 1;
-     PTHREAD_CANCEL_DEFERRED       = 0;
-     PTHREAD_CANCEL_ASYNCHRONOUS   = 2;
-     PTHREAD_CANCELED              = pointer(1);
-
-  {
-     Forward structure definitions.
-
-     These are mostly opaque to the user.
-    }
-
-  type
-{ from semaphore.h }
-
-     psem_t = ^sem_t;
-     TSemaphore         = sem_t;
-     PSemaphore   = ^TSemaphore;
-
-    {
-     Primitive system data type definitions required by P1003.1c.
-
-     Note that P1003.1c specifies that there are no defined comparison
-     or assignment operators for the types pthread_attr_t, pthread_cond_t,
-     pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t.
-    }
-
-     TThreadID = pthread_t;
-     PThreadID = ^TThreadID;
-     TThreadAttr = pthread_attr_t;
-     PThreadAttr = ^TThreadAttr;
-     TPthreadMutex = pthread_mutex_t;
-     PTpthreadmutex= ^TPthreadMutex;
-     TMutexAttribute = pthread_mutexattr_t;
-     PMutexAttribute = ^TMutexAttribute;
-     TPthreadCondattr = pthread_condattr_t;
-     PPthreadCondattr = ^TPthreadCondattr;
-
-{added, adjust these if hdr conv went wrong}
-     {from sched.h}
-
-     sched_param =  record
-                      sched_priority : cint;
-                    end;
-
-     {for pthread.h}
-     ppthread_attr_t            = ^pthread_attr_t;
-     ppthread_cond_t            = ^pthread_cond_t;
-     ppthread_condattr_t        = ^pthread_condattr_t;
-     ppthread_mutex_t           = ^pthread_mutex_t;
-     ppthread_t                 = ^pthread_t;
-     ppthread_key_t             = ^pthread_key_t;
-     ppthread_mutexattr_t       = ^pthread_mutexattr_t;
-     ppthread_rwlock_t          = ^pthread_rwlock_t;
-     ppthread_rwlockattr_t      = ^pthread_rwlockattr_t;
-     ppthread_once_t            = ^pthread_once_t;
-     psched_param               = ^sched_param;
-     TSchedParam = sched_param;
-     PSchedParam = ^TSchedParam;
-
-    {
-     Additional type definitions:
-
-     Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for
-     use in header symbols.
-    }
-
-     pthread_addr_t             = packed record end;
-     pthread_startroutine_t     = procedure; cdecl;
-
-    {
-     Once definitions.
-    }
-     _pthread_once = record
-          state : cint;
-          mutex : pthread_mutex_t;
-       end;
-
-     pthread_once_t             = _pthread_once;
-
-    {
-     Flags for once initialization.
-    }
-
-  const
-     PTHREAD_NEEDS_INIT         = 0;
-     PTHREAD_DONE_INIT          = 1;
-  {
-     Static once initialization values.
-  }
-
-  { ????
-#define PTHREAD_ONCE_INIT   ( PTHREAD_NEEDS_INIT, NULL )
-  }
-
-
-      {
-        Static initialization values.
-      }
-       PTHREAD_MUTEX_INITIALIZER        = NIL;
-       PTHREAD_COND_INITIALIZER         = NIL;
-       PTHREAD_RWLOCK_INITIALIZER       = NIL;
-    {
-       Default attribute arguments (draft 4, deprecated).
-    }
-
-{$ifndef PTHREAD_KERNEL}
-    const
-       pthread_condattr_default         = NIL;
-       pthread_mutexattr_default        = NIL;
-       pthread_attr_default             = NiL;
-{$endif}
-
-    const
-       PTHREAD_PRIO_NONE                = 0;
-       PTHREAD_PRIO_INHERIT             = 1;
-       PTHREAD_PRIO_PROTECT             = 2;
-
-    {
-       Thread function prototype definitions:
-      }
-
-function pthread_attr_destroy (p : ppthread_attr_t ):cint; cdecl; external;
-
-function pthread_attr_getstack (p : ppthread_attr_t; stackaddr : ppointer;
-                        stacksize : psize_t):cint; cdecl; external;
-
-function pthread_attr_getstacksize(_para1:Ppthread_attr_t; _para2:Psize_t):cint;cdecl; external;
-function pthread_attr_getstackaddr(_para1:Ppthread_attr_t; _para2:Ppointer):cint;cdecl;external;
-function pthread_attr_getdetachstate(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl; external;
-function pthread_attr_init(_para1:Ppthread_attr_t):cint;cdecl;external;
-function pthread_attr_setstack(_para1:Ppthread_attr_t; _para2:pointer; _para3:size_t):cint;cdecl;external;
-function pthread_attr_setstacksize(_para1:Ppthread_attr_t; _para2:size_t):cint;cdecl;external;
-function pthread_attr_setstackaddr(_para1:Ppthread_attr_t; _para2:pointer):cint;cdecl;external;
-function pthread_attr_setdetachstate(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-procedure pthread_cleanup_pop(_para1:cint);cdecl;external;
-
-type cleanuproutine= function (a:pointer):pointer;cdecl;
-
-procedure pthread_cleanup_push(_para1:cleanuproutine; routine_arg:pointer);cdecl;external;
-function pthread_condattr_destroy(_para1:Ppthread_condattr_t):cint;cdecl;external;
-function pthread_condattr_init(_para1:Ppthread_condattr_t):cint;cdecl;external;
-
-{$ifdef POSIX_THREAD_PROCESS_SHARED}
-function pthread_condattr_getpshared(_para1:Ppthread_condattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_condattr_setpshared(_para1:Ppthread_condattr_t; _para2:cint):cint;cdecl;external;
-{$endif}
-
-function pthread_cond_broadcast(_para1:Ppthread_cond_t):cint;cdecl;external;
-function pthread_cond_destroy(_para1:Ppthread_cond_t):cint;cdecl;external;
-function pthread_cond_init(_para1:Ppthread_cond_t; _para2:Ppthread_condattr_t):cint;cdecl;external;
-function pthread_cond_signal(_para1:Ppthread_cond_t):cint;cdecl;external;
-function pthread_cond_timedwait(_para1:Ppthread_cond_t; _para2:Ppthread_mutex_t; _para3:Ptimespec):cint;cdecl;external;
-function pthread_cond_wait(_para1:Ppthread_cond_t; _para2:Ppthread_mutex_t):cint;cdecl;external;
-type pthreadcreateroutine = function (p:pointer):pointer; cdecl;
-function pthread_create(_para1:Ppthread_t; _para2:Ppthread_attr_t; _para3:Pthreadcreateroutine; _para4:pointer):cint;cdecl;external;
-function pthread_detach(_para1:pthread_t):cint;cdecl;external;
-function pthread_equal(_para1:pthread_t; _para2:pthread_t):cint;cdecl;external;
-procedure pthread_exit  ( p: pointer); cdecl;external;  { __dead2}
-function pthread_getspecific(_para1:pthread_key_t):pointer;cdecl;external;
-function pthread_join(_para1:pthread_t; _para2:Ppointer):cint;cdecl;external;
-type pthreadkeycreateroutine = function (p:pointer):pointer; cdecl;
-function pthread_key_create(_para1:Ppthread_key_t; _para2:pthreadkeycreateroutine):cint;cdecl;external;
-function pthread_key_delete(_para1:pthread_key_t):cint;cdecl;external;
-function pthread_kill(_para1:pthread_t; _para2:cint):cint;cdecl;external;
-function pthread_mutexattr_init(_para1:Ppthread_mutexattr_t):cint;cdecl;external;
-function pthread_mutexattr_destroy(_para1:Ppthread_mutexattr_t):cint;cdecl;external;
-function pthread_mutexattr_gettype(_para1:Ppthread_mutexattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_mutexattr_settype(_para1:Ppthread_mutexattr_t; _para2:cint):cint;cdecl;external;
-
-function pthread_mutex_destroy(_para1:Ppthread_mutex_t):cint;cdecl;external;
-function pthread_mutex_init(_para1:Ppthread_mutex_t; _para2:Ppthread_mutexattr_t):cint;cdecl;external;
-function pthread_mutex_lock(_para1:Ppthread_mutex_t):cint;cdecl;external;
-function pthread_mutex_trylock(_para1:Ppthread_mutex_t):cint;cdecl;external;
-function pthread_mutex_unlock(_para1:Ppthread_mutex_t):cint;cdecl;external;
-type pthreadonceroutine = procedure (p:pointer); cdecl;
-function pthread_once(_para1:Ppthread_once_t; _para2:pthreadonceroutine ):cint;cdecl;external;
-function pthread_rwlock_destroy(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_init(_para1:Ppthread_rwlock_t; _para2:Ppthread_rwlockattr_t):cint;cdecl;external;
-function pthread_rwlock_rdlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_tryrdlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_trywrlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_unlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_wrlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlockattr_init(_para1:Ppthread_rwlockattr_t):cint;cdecl;external;
-function pthread_rwlockattr_getpshared(_para1:Ppthread_rwlockattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_rwlockattr_setpshared(_para1:Ppthread_rwlockattr_t; _para2:cint):cint;cdecl;external;
-function pthread_rwlockattr_destroy(_para1:Ppthread_rwlockattr_t):cint;cdecl;external;
-function pthread_self:pthread_t;cdecl;external;
-function pthread_setspecific(_para1:pthread_key_t; _para2:pointer):cint;cdecl;external;
-function pthread_sigmask(_para1:cint; _para2:Psigset_t; _para3:Psigset_t):cint;cdecl;external;
-function pthread_cancel(_para1:pthread_t):cint;cdecl;external;
-function pthread_setcancelstate(_para1:cint; _para2:Pcint):cint;cdecl;external;
-function pthread_setcanceltype(_para1:cint; _para2:Pcint):cint;cdecl;external;
-procedure pthread_testcancel;cdecl;external;
-function pthread_getprio(_para1:pthread_t):cint;cdecl;external;
-function pthread_setprio(_para1:pthread_t; _para2:cint):cint;cdecl;external;
-procedure pthread_yield;cdecl;external;
-
-{$ifdef POSIX_THREAD_PROCESS_SHARED}
-function pthread_mutexattr_getpshared(_para1:Ppthread_mutexattr_t; pshared:Pcint):cint;cdecl;external;
-function pthread_mutexattr_setpshared(_para1:Ppthread_mutexattr_t; pshared:cint):cint;cdecl;external;
-{$endif}
-
-function pthread_mutexattr_getprioceiling(_para1:Ppthread_mutexattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_mutexattr_setprioceiling(_para1:Ppthread_mutexattr_t; _para2:cint):cint;cdecl;external;
-function pthread_mutex_getprioceiling(_para1:Ppthread_mutex_t; _para2:Pcint):cint;cdecl;external;
-function pthread_mutex_setprioceiling(_para1:Ppthread_mutex_t; _para2:cint; _para3:Pcint):cint;cdecl;external;
-function pthread_mutexattr_getprotocol(_para1:Ppthread_mutexattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_mutexattr_setprotocol(_para1:Ppthread_mutexattr_t; _para2:cint):cint;cdecl;external;
-function pthread_attr_getinheritsched(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_attr_getschedparam(_para1:Ppthread_attr_t; _para2:Psched_param):cint;cdecl;external;
-function pthread_attr_getschedpolicy(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_attr_getscope(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_attr_setinheritsched(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-function pthread_attr_setschedparam(_para1:Ppthread_attr_t; _para2:Psched_param):cint;cdecl;external;
-function pthread_attr_setschedpolicy(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-function pthread_attr_setscope(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-function pthread_getschedparam(pthread:pthread_t; _para2:Pcint; _para3:Psched_param):cint;cdecl;external;
-function pthread_setschedparam(_para1:pthread_t; _para2:cint; _para3:Psched_param):cint;cdecl;external;
-function pthread_getconcurrency:cint;cdecl;external;
-function pthread_setconcurrency(_para1:cint):cint;cdecl;external;
-function pthread_attr_setfloatstate(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-function pthread_attr_getfloatstate(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl;external;
-
-{ semaphore.h }
-
-
-  function sem_init(__sem:Psem_t; __pshared:cint;__value:dword):cint;cdecl; external;
-  function sem_destroy(__sem:Psem_t):cint;cdecl;external ;
-  function sem_close(__sem:Psem_t):cint;cdecl;external ;
-  function sem_unlink(__name:Pchar):cint;cdecl;external ;
-  function sem_wait(__sem:Psem_t):cint;cdecl;external ;
-  function sem_trywait(__sem:Psem_t):cint;cdecl;external ;
-  function sem_post(__sem:Psem_t):cint;cdecl;external ;
-  function sem_getvalue(__sem:Psem_t; __sval:Pcint):cint;cdecl;external;
-
-
-  function sem_init(var __sem: sem_t; __pshared:cint; __value:dword):cint cdecl;external;
-  function sem_destroy(var __sem: sem_t):cint;cdecl;external;
-  function sem_close(var __sem: sem_t):cint;cdecl;external;
-  function sem_wait(var __sem: sem_t):cint;cdecl;external;
-  function sem_trywait(var __sem: sem_t):cint;cdecl;external;
-  function sem_post(var __sem: sem_t):cint;cdecl;external;
-  function sem_getvalue(var __sem: sem_t; var __sval:cint):cint;cdecl;external;
-
-
-

+ 0 - 356
packages/base/pthreads/pthrbsd.inc

@@ -1,356 +0,0 @@
-{
-   This file is part of the Free Pascal run time library.
-   Copyright (c) 1999-2000 by Michael Van Canneyt,
-   BSD parts (c) 2000 by Marco van de Voort
-   members of the Free Pascal development team.
-
-   New linux unit. Linux only calls only. Will be renamed to linux.pp
-   when 1.0.x support is killed off.
-
-   See the file COPYING.FPC, included in this distribution,
-   for details about the copyright.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY;without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-**********************************************************************}
-
-{
-  Automatically converted by H2Pas 0.99.15 from pthrwrk2.h
-}
-
-{$linklib pthread}      // The compiler changes this to c_r if needed.
-{$linklib c}            // (parameter -Xf)
-
-{$PACKRECORDS C}
-
-
-  {
-     Copyright (c) 1993, 1994 by Chris Provenzano, [email protected]
-     Copyright (c) 1995-1998 by John Birrell <[email protected]>
-     All rights reserved.
-
-     Redistribution and use in source and binary forms, with or without
-     modification, are permitted provided that the following conditions
-     are met:
-     1. Redistributions of source code must retain the above copyright
-        notice, this list of conditions and the following disclaimer.
-     2. Redistributions in binary form must reproduce the above copyright
-        notice, this list of conditions and the following disclaimer in the
-        documentation and/or other materials provided with the distribution.
-     3. All advertising materials mentioning features or use of this software
-        must display the following acknowledgement:
-      This product includes software developed by Chris Provenzano.
-     4. The name of Chris Provenzano may not be used to endorse or promote
-          products derived from this software without specific prior written
-          permission.
-
-     THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
-     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-     ARE DISCLAIMED.  IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
-     DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-     LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-     OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-     SUCH DAMAGE.
-
-     $FreeBSD: src/include/pthread.h,v 1.20.2.4 2003/05/27 18:18:01 jdp Exp $
-    }
-
-    {
-     Run-time invariant values:
-    }
-
-
-CONST ULONG_MAX= high(culong);
-
-type
-
-     psize_t   = ^size_t;
-     psigset_t = ^sigset;
-
-const
-    PTHREAD_MUTEX_NORMAL     = _PTHREAD_MUTEX_NORMAL;
-    PTHREAD_MUTEX_ERRORCHECK = _PTHREAD_MUTEX_ERRORCHECK;
-    PTHREAD_MUTEX_RECURSIVE  = _PTHREAD_MUTEX_RECURSIVE;
-
-     PTHREAD_MUTEX_DEFAULT    = _PTHREAD_MUTEX_NORMAL;
-     MUTEX_TYPE_FAST          = _PTHREAD_MUTEX_NORMAL;
-     MUTEX_TYPE_COUNTING_FAST = _PTHREAD_MUTEX_RECURSIVE;
-
-
-     PTHREAD_DESTRUCTOR_ITERATIONS = 4;
-     PTHREAD_KEYS_MAX              = _PTHREAD_KEYS_MAX;
-     PTHREAD_STACK_MIN             = _PTHREAD_STACK_MIN;
-     PTHREAD_THREADS_MAX           = ULONG_MAX;
-    {
-     Flags for threads and thread attributes.
-    }
-     PTHREAD_DETACHED              = $1;
-     PTHREAD_SCOPE_SYSTEM          = $2;
-     PTHREAD_INHERIT_SCHED         = $4;
-     PTHREAD_NOFLOAT               = $8;
-     PTHREAD_CREATE_DETACHED       = PTHREAD_DETACHED;
-     PTHREAD_CREATE_JOINABLE       = 0;
-     PTHREAD_SCOPE_PROCESS         = 0;
-     PTHREAD_EXPLICIT_SCHED        = 0;
-
-    {
-     Flags for read/write lock attributes
-    }
-     PTHREAD_PROCESS_PRIVATE       = 0;
-     PTHREAD_PROCESS_SHARED        = 1;
-    {
-     Flags for cancelling threads
-    }
-     PTHREAD_CANCEL_ENABLE         = 0;
-     PTHREAD_CANCEL_DISABLE        = 1;
-     PTHREAD_CANCEL_DEFERRED       = 0;
-     PTHREAD_CANCEL_ASYNCHRONOUS   = 2;
-     PTHREAD_CANCELED              = pointer(1);
-
-  {
-     Forward structure definitions.
-
-     These are mostly opaque to the user.
-    }
-
-  type
-{ from semaphore.h }
-
-     psem_t = ^sem_t;
-     TSemaphore         = sem_t;
-     PSemaphore   = ^TSemaphore;
-
-    {
-     Primitive system data type definitions required by P1003.1c.
-
-     Note that P1003.1c specifies that there are no defined comparison
-     or assignment operators for the types pthread_attr_t, pthread_cond_t,
-     pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t.
-    }
-
-     TThreadID = pthread_t;
-     PThreadID = ^TThreadID;
-     TThreadAttr = pthread_attr_t;
-     PThreadAttr = ^TThreadAttr;
-     TPthreadMutex = pthread_mutex_t;
-     PTpthreadmutex= ^TPthreadMutex;
-     TMutexAttribute = pthread_mutexattr_t;
-     PMutexAttribute = ^TMutexAttribute;
-     TPthreadCondattr = pthread_condattr_t;
-     PPthreadCondattr = ^TPthreadCondattr;
-
-{added, adjust these if hdr conv went wrong}
-     {from sched.h}
-
-     sched_param =  record
-                      sched_priority : cint;
-                    end;
-
-     {for pthread.h}
-     ppthread_attr_t            = ^pthread_attr_t;
-     ppthread_cond_t            = ^pthread_cond_t;
-     ppthread_condattr_t        = ^pthread_condattr_t;
-     ppthread_mutex_t           = ^pthread_mutex_t;
-     ppthread_t                 = ^pthread_t;
-     ppthread_key_t             = ^pthread_key_t;
-     ppthread_mutexattr_t       = ^pthread_mutexattr_t;
-     ppthread_rwlock_t          = ^pthread_rwlock_t;
-     ppthread_rwlockattr_t      = ^pthread_rwlockattr_t;
-     ppthread_once_t            = ^pthread_once_t;
-     psched_param               = ^sched_param;
-     TSchedParam = sched_param;
-     PSchedParam = ^TSchedParam;
-
-    {
-     Additional type definitions:
-
-     Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for
-     use in header symbols.
-    }
-
-     pthread_addr_t             = packed record end;
-     pthread_startroutine_t     = procedure; cdecl;
-
-    {
-     Once definitions.
-    }
-     _pthread_once = record
-          state : cint;
-          mutex : pthread_mutex_t;
-       end;
-
-     pthread_once_t             = _pthread_once;
-
-    {
-     Flags for once initialization.
-    }
-
-  const
-     PTHREAD_NEEDS_INIT         = 0;
-     PTHREAD_DONE_INIT          = 1;
-  {
-     Static once initialization values.
-  }
-
-  { ????
-#define PTHREAD_ONCE_INIT   ( PTHREAD_NEEDS_INIT, NULL )
-  }
-
-
-      {
-        Static initialization values.
-      }
-       PTHREAD_MUTEX_INITIALIZER        = NIL;
-       PTHREAD_COND_INITIALIZER         = NIL;
-       PTHREAD_RWLOCK_INITIALIZER       = NIL;
-    {
-       Default attribute arguments (draft 4, deprecated).
-    }
-
-{$ifndef PTHREAD_KERNEL}
-    const
-       pthread_condattr_default         = NIL;
-       pthread_mutexattr_default        = NIL;
-       pthread_attr_default             = NiL;
-{$endif}
-
-    const
-       PTHREAD_PRIO_NONE                = 0;
-       PTHREAD_PRIO_INHERIT             = 1;
-       PTHREAD_PRIO_PROTECT             = 2;
-
-    {
-       Thread function prototype definitions:
-      }
-
-function pthread_attr_destroy (p : ppthread_attr_t ):cint; cdecl; external;
-
-function pthread_attr_getstack (p : ppthread_attr_t; stackaddr : ppointer;
-                        stacksize : psize_t):cint; cdecl; external;
-
-function pthread_attr_getstacksize(_para1:Ppthread_attr_t; _para2:Psize_t):cint;cdecl; external;
-function pthread_attr_getstackaddr(_para1:Ppthread_attr_t; _para2:Ppointer):cint;cdecl;external;
-function pthread_attr_getdetachstate(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl; external;
-function pthread_attr_init(_para1:Ppthread_attr_t):cint;cdecl;external;
-function pthread_attr_setstack(_para1:Ppthread_attr_t; _para2:pointer; _para3:size_t):cint;cdecl;external;
-function pthread_attr_setstacksize(_para1:Ppthread_attr_t; _para2:size_t):cint;cdecl;external;
-function pthread_attr_setstackaddr(_para1:Ppthread_attr_t; _para2:pointer):cint;cdecl;external;
-function pthread_attr_setdetachstate(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-procedure pthread_cleanup_pop(_para1:cint);cdecl;external;
-
-type cleanuproutine= function (a:pointer):pointer;cdecl;
-
-procedure pthread_cleanup_push(_para1:cleanuproutine; routine_arg:pointer);cdecl;external;
-function pthread_condattr_destroy(_para1:Ppthread_condattr_t):cint;cdecl;external;
-function pthread_condattr_init(_para1:Ppthread_condattr_t):cint;cdecl;external;
-
-{$ifdef POSIX_THREAD_PROCESS_SHARED}
-function pthread_condattr_getpshared(_para1:Ppthread_condattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_condattr_setpshared(_para1:Ppthread_condattr_t; _para2:cint):cint;cdecl;external;
-{$endif}
-
-function pthread_cond_broadcast(_para1:Ppthread_cond_t):cint;cdecl;external;
-function pthread_cond_destroy(_para1:Ppthread_cond_t):cint;cdecl;external;
-function pthread_cond_init(_para1:Ppthread_cond_t; _para2:Ppthread_condattr_t):cint;cdecl;external;
-function pthread_cond_signal(_para1:Ppthread_cond_t):cint;cdecl;external;
-function pthread_cond_timedwait(_para1:Ppthread_cond_t; _para2:Ppthread_mutex_t; _para3:Ptimespec):cint;cdecl;external;
-function pthread_cond_wait(_para1:Ppthread_cond_t; _para2:Ppthread_mutex_t):cint;cdecl;external;
-type pthreadcreateroutine = function (p:pointer):pointer; cdecl;
-function pthread_create(_para1:Ppthread_t; _para2:Ppthread_attr_t; _para3:Pthreadcreateroutine; _para4:pointer):cint;cdecl;external;
-function pthread_detach(_para1:pthread_t):cint;cdecl;external;
-function pthread_equal(_para1:pthread_t; _para2:pthread_t):cint;cdecl;external;
-procedure pthread_exit  ( p: pointer); cdecl;external;  { __dead2}
-function pthread_getspecific(_para1:pthread_key_t):pointer;cdecl;external;
-function pthread_join(_para1:pthread_t; _para2:Ppointer):cint;cdecl;external;
-type pthreadkeycreateroutine = function (p:pointer):pointer; cdecl;
-function pthread_key_create(_para1:Ppthread_key_t; _para2:pthreadkeycreateroutine):cint;cdecl;external;
-function pthread_key_delete(_para1:pthread_key_t):cint;cdecl;external;
-function pthread_kill(_para1:pthread_t; _para2:cint):cint;cdecl;external;
-function pthread_mutexattr_init(_para1:Ppthread_mutexattr_t):cint;cdecl;external;
-function pthread_mutexattr_destroy(_para1:Ppthread_mutexattr_t):cint;cdecl;external;
-function pthread_mutexattr_gettype(_para1:Ppthread_mutexattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_mutexattr_settype(_para1:Ppthread_mutexattr_t; _para2:cint):cint;cdecl;external;
-
-function pthread_mutex_destroy(_para1:Ppthread_mutex_t):cint;cdecl;external;
-function pthread_mutex_init(_para1:Ppthread_mutex_t; _para2:Ppthread_mutexattr_t):cint;cdecl;external;
-function pthread_mutex_lock(_para1:Ppthread_mutex_t):cint;cdecl;external;
-function pthread_mutex_trylock(_para1:Ppthread_mutex_t):cint;cdecl;external;
-function pthread_mutex_unlock(_para1:Ppthread_mutex_t):cint;cdecl;external;
-type pthreadonceroutine = procedure (p:pointer); cdecl;
-function pthread_once(_para1:Ppthread_once_t; _para2:pthreadonceroutine ):cint;cdecl;external;
-function pthread_rwlock_destroy(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_init(_para1:Ppthread_rwlock_t; _para2:Ppthread_rwlockattr_t):cint;cdecl;external;
-function pthread_rwlock_rdlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_tryrdlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_trywrlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_unlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlock_wrlock(_para1:Ppthread_rwlock_t):cint;cdecl;external;
-function pthread_rwlockattr_init(_para1:Ppthread_rwlockattr_t):cint;cdecl;external;
-function pthread_rwlockattr_getpshared(_para1:Ppthread_rwlockattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_rwlockattr_setpshared(_para1:Ppthread_rwlockattr_t; _para2:cint):cint;cdecl;external;
-function pthread_rwlockattr_destroy(_para1:Ppthread_rwlockattr_t):cint;cdecl;external;
-function pthread_self:pthread_t;cdecl;external;
-function pthread_setspecific(_para1:pthread_key_t; _para2:pointer):cint;cdecl;external;
-function pthread_sigmask(_para1:cint; _para2:Psigset_t; _para3:Psigset_t):cint;cdecl;external;
-function pthread_cancel(_para1:pthread_t):cint;cdecl;external;
-function pthread_setcancelstate(_para1:cint; _para2:Pcint):cint;cdecl;external;
-function pthread_setcanceltype(_para1:cint; _para2:Pcint):cint;cdecl;external;
-procedure pthread_testcancel;cdecl;external;
-function pthread_getprio(_para1:pthread_t):cint;cdecl;external;
-function pthread_setprio(_para1:pthread_t; _para2:cint):cint;cdecl;external;
-procedure pthread_yield;cdecl;external;
-
-{$ifdef POSIX_THREAD_PROCESS_SHARED}
-function pthread_mutexattr_getpshared(_para1:Ppthread_mutexattr_t; pshared:Pcint):cint;cdecl;external;
-function pthread_mutexattr_setpshared(_para1:Ppthread_mutexattr_t; pshared:cint):cint;cdecl;external;
-{$endif}
-
-function pthread_mutexattr_getprioceiling(_para1:Ppthread_mutexattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_mutexattr_setprioceiling(_para1:Ppthread_mutexattr_t; _para2:cint):cint;cdecl;external;
-function pthread_mutex_getprioceiling(_para1:Ppthread_mutex_t; _para2:Pcint):cint;cdecl;external;
-function pthread_mutex_setprioceiling(_para1:Ppthread_mutex_t; _para2:cint; _para3:Pcint):cint;cdecl;external;
-function pthread_mutexattr_getprotocol(_para1:Ppthread_mutexattr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_mutexattr_setprotocol(_para1:Ppthread_mutexattr_t; _para2:cint):cint;cdecl;external;
-function pthread_attr_getinheritsched(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_attr_getschedparam(_para1:Ppthread_attr_t; _para2:Psched_param):cint;cdecl;external;
-function pthread_attr_getschedpolicy(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_attr_getscope(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl;external;
-function pthread_attr_setinheritsched(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-function pthread_attr_setschedparam(_para1:Ppthread_attr_t; _para2:Psched_param):cint;cdecl;external;
-function pthread_attr_setschedpolicy(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-function pthread_attr_setscope(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-function pthread_getschedparam(pthread:pthread_t; _para2:Pcint; _para3:Psched_param):cint;cdecl;external;
-function pthread_setschedparam(_para1:pthread_t; _para2:cint; _para3:Psched_param):cint;cdecl;external;
-function pthread_getconcurrency:cint;cdecl;external;
-function pthread_setconcurrency(_para1:cint):cint;cdecl;external;
-function pthread_attr_setfloatstate(_para1:Ppthread_attr_t; _para2:cint):cint;cdecl;external;
-function pthread_attr_getfloatstate(_para1:Ppthread_attr_t; _para2:Pcint):cint;cdecl;external;
-
-{ semaphore.h }
-
-
-  function sem_init(__sem:Psem_t; __pshared:cint;__value:dword):cint;cdecl; external;
-  function sem_destroy(__sem:Psem_t):cint;cdecl;external ;
-  function sem_close(__sem:Psem_t):cint;cdecl;external ;
-  function sem_unlink(__name:Pchar):cint;cdecl;external ;
-  function sem_wait(__sem:Psem_t):cint;cdecl;external ;
-  function sem_trywait(__sem:Psem_t):cint;cdecl;external ;
-  function sem_post(__sem:Psem_t):cint;cdecl;external ;
-  function sem_getvalue(__sem:Psem_t; __sval:Pcint):cint;cdecl;external;
-
-
-  function sem_init(var __sem: sem_t; __pshared:cint; __value:dword):cint cdecl;external;
-  function sem_destroy(var __sem: sem_t):cint;cdecl;external;
-  function sem_close(var __sem: sem_t):cint;cdecl;external;
-  function sem_wait(var __sem: sem_t):cint;cdecl;external;
-  function sem_trywait(var __sem: sem_t):cint;cdecl;external;
-  function sem_post(var __sem: sem_t):cint;cdecl;external;
-  function sem_getvalue(var __sem: sem_t; var __sval:cint):cint;cdecl;external;
-
-

+ 0 - 48
packages/base/pthreads/pthreads.pp

@@ -1,48 +0,0 @@
-{
-   This file is part of the Free Pascal run time library.
-   Copyright (c) 1999-2000 by Michael Van Canneyt,
-   BSD parts (c) 2000 by Marco van de Voort
-   members of the Free Pascal development team.
-
-   See the file COPYING.FPC, included in this distribution,
-   for details about the copyright.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY;without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-**********************************************************************}
-
-unit pthreads;
-
-interface
-
-{$mode objfpc}
-{$PACKRECORDS C}
-
-{$ifdef BSD}
-uses initc,BaseUnix, unixtype;
-{$i pthrbsd.inc}
-{$else}
- {$ifdef linux}
- uses initc,unixtype;
- {$i pthrlinux.inc}
- {$else}
-
-  {$ifdef sunos}
-  uses initc,unixtype;
-  {$i pthrsnos.inc}
-  {$else}
-   {$ifdef beos}
-   uses initc, baseunix, unixtype;
-   {$i pthrbeos.inc}
-   {$else}
-    {$error operating system not detected}
-   {$endif}
-  {$endif}
- {$endif}
-{$endif}
-
-implementation
-
-end.

+ 0 - 404
packages/base/pthreads/pthrlinux.inc

@@ -1,404 +0,0 @@
-{
-   This file is part of the Free Pascal run time library.
-   Copyright (c) 1999-2000 by Michael Van Canneyt,
-   members of the Free Pascal development team.
-
-   See the file COPYING.FPC, included in this distribution,
-   for details about the copyright.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY;without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-**********************************************************************}
-
-  (*
-  #define PTHREAD_MUTEX_INITIALIZER {0, 0, 0, PTHREAD_MUTEX_TIMED_NP, __LOCK_INITIALIZER}
-  #define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER, 0}
-   *)
-
-  { Values for attributes.   }
-
-Const
-  LibThreads = 'pthread';
-
-  PTHREAD_MUTEX_TIMED_NP      = _PTHREAD_MUTEX_TIMED_NP;
-  PTHREAD_MUTEX_RECURSIVE_NP  = _PTHREAD_MUTEX_RECURSIVE_NP;
-  PTHREAD_MUTEX_ERRORCHECK_NP = _PTHREAD_MUTEX_ERRORCHECK_NP;
-  PTHREAD_MUTEX_ADAPTIVE_NP   = _PTHREAD_MUTEX_ADAPTIVE_NP;
-
-  PTHREAD_MUTEX_NORMAL     = PTHREAD_MUTEX_TIMED_NP;
-  PTHREAD_MUTEX_RECURSIVE  = PTHREAD_MUTEX_RECURSIVE_NP;
-  PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP;
-  PTHREAD_MUTEX_DEFAULT    = PTHREAD_MUTEX_NORMAL;
-  PTHREAD_MUTEX_FAST_NP    = PTHREAD_MUTEX_ADAPTIVE_NP;
-
-  PTHREAD_CREATE_JOINABLE = 0;
-  PTHREAD_CREATE_DETACHED = 1;
-
-  PTHREAD_INHERIT_SCHED   = 0;
-  PTHREAD_EXPLICIT_SCHED  = 1;
-
-  PTHREAD_SCOPE_SYSTEM    = 0;
-  PTHREAD_SCOPE_PROCESS   = 1;
-
-  NONRECURSIVE  = 0;
-  RECURSIVE     = 1;
-
-  PTHREAD_PROCESS_PRIVATE = 0;
-  PTHREAD_PROCESS_SHARED  = 1;
-
-  PTHREAD_ONCE_INIT = 0;
-
-  PTHREAD_CANCEL_ENABLE  = 0;
-  PTHREAD_CANCEL_DISABLE = 1;
-
-  PTHREAD_CANCEL_DEFERRED     = 0;
-  PTHREAD_CANCEL_ASYNCHRONOUS = 1;
-
-  PTHREAD_CANCELED = Pointer(-1);
-  PTHREAD_BARRIER_SERIAL_THREAD = -1;
-
-  PTHREAD_RWLOCK_PREFER_READER_NP = 0;
-  PTHREAD_RWLOCK_PREFER_WRITER_NP = 1;
-  PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP = 2;
-  PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP;
-
-
-  _SIGSET_NWORDS  = 1024 div (8 * SizeOf(LongWord));
-
-type
-   __sigset_t = record
-     __val: packed array[0.._SIGSET_NWORDS-1] of LongWord;
-   end;
-   P__sigset_t = ^__sigset_t;
-   TSigset = __sigset_t;
-   PSigset = ^TSigset;
-
-type
-  // inserted.
-  PSize_t = ^Size_t;
-
-  // From scheduler.
-{ already in unix type
-  timespec =  record
-    tv_sec: cint;
-    tv_nsec: cint;
-  end;
-  TTimeSpec = timespec;
-  PTimeSpec = ^TTimeSpec; }
-
-  // procedural types used in parameters to pthread functions
-
-  TStartRoutine = function (_para1:pointer): cint; cdecl;
-  TKeyValueDestructor = procedure(ValueInKey: Pointer); cdecl;
-  TInitOnceProc = Procedure;cdecl;
-  TForkHandler = procedure; cdecl;
-
-  PPTHREAD_T = ^PTHREAD_T;
-
-  _PTHREAD_DESCR = Pointer;
-  TPTHREAD_DESCR = _PTHREAD_DESCR;
-  PPTHREAD_DESCR = ^TPTHREAD_DESCR;
-  P_PTHREAD_DESCR = ^_PTHREAD_DESCR;
-
-  sched_param = record
-    sched_priority: cint;
-  end;
-  Psched_param = ^sched_param;
-  TSchedParam = sched_param;
-  PSchedParam = ^TSchedParam;
-
-  ppthread_attr_t = ^pthread_attr_t;
-  TThreadAttr = pthread_attr_t;
-  PThreadAttr = ^TThreadAttr;
-
-  p_pthread_fastlock = ^_pthread_fastlock;
-  TPthreadFastlock = _pthread_fastlock;
-  PPthreadFastlock = ^TPthreadFastlock;
-
-  PPTHREAD_MUTEX_T = ^PTHREAD_MUTEX_T;
-  TPthreadMutex = PTHREAD_MUTEX_T;
-  PPthreadMutex = ^TPthreadMutex;
-
-  TMutexAttribute = pthread_mutexattr_t;
-  PMutexAttribute = ^TMutexAttribute;
-  PPTHREAD_MUTEXATTR_T = ^pthread_mutexattr_t;
-
-  TPThreadCleanupRoutine = procedure (_para1:pointer);cdecl;
-
-  PPthreadCleanupBuffer = ^_pthread_cleanup_buffer;
-  p_pthread_cleanup_buffer = ^_pthread_cleanup_buffer;
-  _pthread_cleanup_buffer = {packed} record
-    __routine: TPThreadCleanupRoutine;    { Function to call.  }
-    __arg: Pointer;                       { Its argument.  }
-    __canceltype: cint;                { Saved cancellation type. }
-    __prev: p_pthread_Cleanup_Buffer;        { Chaining of cleanup functions.  }
-  end;
-  TPthreadCleanupBuffer = _pthread_cleanup_buffer;
-
-{ Alread in ptypes, bug 7454
-  pthread_cond_t = record
-    __c_lock: _pthread_fastlock;
-    __c_waiting: _pthread_descr;
-  end;
-}
-  PPthread_cond_t = ^pthread_cond_t;
-  TCondVar = pthread_cond_t;
-  PCondVar = ^TCondVar;
-
-  pthread_condattr_t = record
-    __dummy: cint;
-  end;
-  Ppthread_condattr_t = ^pthread_condattr_t;
-  TPthreadCondattr = pthread_condattr_t;
-  PPthreadCondattr = ^TPthreadCondattr;
-
-  ppthread_key_t = ^pthread_key_t;
-  TPThreadKey = pthread_key_t;
-  PPThreadKey = ^TPThreadKey;
-
-  pthread_once_t = cint;
-  Ppthread_once_t = ^pthread_once_t;
-  TPThreadOnce = pthread_once_t;
-  PPThreadOnce = ^pthread_once_t;
-
-  TSemLock = _pthread_fastlock;
-  PSemLock = ^TSemLock;
-
-  psem_t = ^sem_t;
-  TSemaphore = sem_t;
-  PSemaphore = ^TSemaphore;
-
-  ppthread_rwlock_t = ^pthread_rwlock_t;
-  TPthreadRWlock = pthread_rwlock_t;
-  PPthreadRWlock = ^TPthreadRWlock;
-
-  ppthread_rwlockattr_t = ^pthread_rwlockattr_t;
-  TPthreadRWlockAttribute = pthread_rwlockattr_t;
-  PPthreadRWlockAttribute = ^TPthreadRWlockAttribute;
-
-  pthread_spinlock_t = cint;
-  ppthread_spinlock_t = ^pthread_spinlock_t;
-  TPthreadSpinlock = pthread_spinlock_t;
-  PTPthreadSpinlock = ^TPthreadSpinlock;
-
-  pthread_barrier_t = record
-    __ba_lock: _pthread_fastlock;
-    __ba_required: cint;
-    __ba_present: cint;
-    __ba_waiting: _pthread_descr;
-  end;
-  ppthread_barrier_t = ^pthread_barrier_t;
-  TPthreadBarrier = pthread_barrier_t;
-  PPthreadBarrier = ^TPthreadBarrier;
-
-  pthread_barrierattr_t = record
-    __pshared: cint;
-  end;
-  ppthread_barrierattr_t = ^pthread_barrierattr_t;
-  TPthreadBarrierAttribute = pthread_barrierattr_t;
-  PPthreadBarrierAttribute = ^TPthreadBarrierAttribute;
-
-{ ---------------------------------------------------------------------
-    Raw function prototypes
-  ---------------------------------------------------------------------}
-
-
-  function pthread_create(__thread:Ppthread_t; __attr:Ppthread_attr_t; __start_routine:TStartRoutine; __arg:pointer):cint;cdecl; external libthreads;
-  function pthread_self:pthread_t;cdecl; external libthreads;
-  function pthread_equal(__thread1:pthread_t; __thread2:pthread_t):cint;cdecl; external libthreads;
-  procedure pthread_exit(__retval:pointer);cdecl; external libthreads;
-  function pthread_join(__th:pthread_t; __thread_return:Ppointer):cint;cdecl; external libthreads;
-  function pthread_detach(__th:pthread_t):cint;cdecl; external libthreads;
-  function pthread_attr_init(__attr:Ppthread_attr_t):cint;cdecl; external libthreads;
-  function pthread_attr_destroy(__attr:Ppthread_attr_t):cint;cdecl; external libthreads;
-  function pthread_attr_setdetachstate(__attr:Ppthread_attr_t; __detachstate:cint):cint;cdecl; external libthreads;
-  function pthread_attr_getdetachstate(__attr:Ppthread_attr_t; __detachstate:pcint):cint;cdecl; external libthreads;
-  function pthread_attr_setschedparam(__attr:Ppthread_attr_t; __param:Psched_param):cint;cdecl; external libthreads;
-  function pthread_attr_getschedparam(__attr:Ppthread_attr_t; __param:Psched_param):cint;cdecl; external libthreads;
-  function pthread_attr_setschedpolicy(__attr:Ppthread_attr_t; __policy:cint):cint;cdecl; external libthreads;
-  function pthread_attr_getschedpolicy(__attr:Ppthread_attr_t; __policy:pcint):cint;cdecl; external libthreads;
-  function pthread_attr_setinheritsched(__attr:Ppthread_attr_t; __inherit:cint):cint;cdecl; external libthreads;
-  function pthread_attr_getinheritsched(__attr:Ppthread_attr_t; __inherit:pcint):cint;cdecl; external libthreads;
-  function pthread_attr_setscope(__attr:Ppthread_attr_t; __scope:cint):cint;cdecl; external libthreads;
-  function pthread_attr_getscope(__attr:Ppthread_attr_t; __scope:pcint):cint;cdecl; external libthreads;
-  function pthread_attr_setstackaddr(__attr:Ppthread_attr_t; __stackaddr:pointer):cint;cdecl; external libthreads;
-  function pthread_attr_getstackaddr(__attr:Ppthread_attr_t; __stackaddr:Ppointer):cint;cdecl; external libthreads;
-  function pthread_attr_setstacksize(__attr:Ppthread_attr_t; __stacksize:size_t):cint;cdecl; external libthreads;
-  function pthread_attr_getstacksize(__attr:Ppthread_attr_t; __stacksize:Psize_t):cint;cdecl; external libthreads;
-  function pthread_attr_getguardsize(__attr:Ppthread_attr_t; Guardsize: Psize_t): cint; cdecl;external libthreads;
-  function pthread_attr_setguardsize(__attr:Ppthread_attr_t; Guardsize: Psize_t): cint; cdecl;external libthreads;
-  function pthread_setschedparam(__target_thread:pthread_t; __policy:cint; __param:Psched_param):cint;cdecl; external libthreads;
-  function pthread_getschedparam(__target_thread:pthread_t; __policy:pcint; __param:Psched_param):cint;cdecl; external libthreads;
-  function pthread_getconcurrency: cint; cdecl;external libthreads;
-  function pthread_setconcurrency(Level: cint): cint; cdecl;external libthreads;
-  function pthread_yield(): cint; cdecl;external libthreads;
-  function pthread_mutex_init(__mutex:Ppthread_mutex_t; __mutex_attr:Ppthread_mutexattr_t):cint;cdecl; external libthreads;
-  function pthread_mutex_destroy(__mutex:Ppthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_mutex_trylock(__mutex:Ppthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_mutex_lock(__mutex:Ppthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_mutex_unlock(__mutex:Ppthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_mutexattr_init(__attr:Ppthread_mutexattr_t):cint;cdecl; external libthreads;
-  function pthread_mutexattr_destroy(__attr:Ppthread_mutexattr_t):cint;cdecl; external libthreads;
-  function pthread_mutexattr_getpshared(__attr:Ppthread_mutexattr_t; __pshared:pcint):cint;cdecl; external libthreads;
-  function pthread_mutexattr_setpshared(__attr:Ppthread_mutexattr_t; __pshared:cint):cint;cdecl; external libthreads;
-  function pthread_mutexattr_settype(__attr: Ppthread_mutexattr_t; Kind: cint): cint; cdecl;external libthreads;
-  function pthread_mutexattr_gettype(__attr: Ppthread_mutexattr_t; var Kind: cint): cint; cdecl;external libthreads;
-  function pthread_cond_init(__cond:Ppthread_cond_t; __cond_attr:Ppthread_condattr_t):cint;cdecl; external libthreads;
-  function pthread_cond_destroy(__cond:Ppthread_cond_t):cint;cdecl; external libthreads;
-  function pthread_cond_signal(__cond:Ppthread_cond_t):cint;cdecl; external libthreads;
-  function pthread_cond_broadcast(__cond:Ppthread_cond_t):cint;cdecl; external libthreads;
-  function pthread_cond_wait(__cond:Ppthread_cond_t; __mutex:Ppthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_cond_timedwait(__cond:Ppthread_cond_t; __mutex:Ppthread_mutex_t; __abstime:Ptimespec):cint;cdecl; external libthreads;
-  function pthread_condattr_init(__attr:Ppthread_condattr_t):cint;cdecl; external libthreads;
-  function pthread_condattr_destroy(__attr:Ppthread_condattr_t):cint;cdecl; external libthreads;
-  function pthread_condattr_getpshared(__attr:Ppthread_condattr_t; __pshared:pcint):cint;cdecl; external libthreads;
-  function pthread_condattr_setpshared(__attr:Ppthread_condattr_t; __pshared:cint):cint;cdecl; external libthreads;
-  function pthread_rwlock_init(__rwlock:Ppthread_rwlock_t; __attr:Ppthread_rwlockattr_t):cint;cdecl; external libthreads;
-  function pthread_rwlock_destroy(__rwlock:Ppthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlock_rdlock(__rwlock:Ppthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlock_tryrdlock(__rwlock:Ppthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlock_timedrdlock(__rwlock:Ppthread_rwlock_t; __abstime:Ptimespec):cint;cdecl;external libthreads;
-  function pthread_rwlock_wrlock(__rwlock:Ppthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlock_trywrlock(__rwlock:Ppthread_rwlock_t):cint;cdecl; external libthreads;
-  function pthread_rwlock_timedwrlock(__rwlock:Ppthread_rwlock_t; __abstime:Ptimespec):cint;cdecl;external libthreads;
-  function pthread_rwlock_unlock(__rwlock:Ppthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_init(__attr:Ppthread_rwlockattr_t):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_destroy(__attr:Ppthread_rwlockattr_t):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_getpshared(__attr:Ppthread_rwlockattr_t; __pshared:pcint):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_setpshared(__attr:Ppthread_rwlockattr_t; __pshared:cint):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_getkind_np(__attr:Ppthread_rwlockattr_t; __pref:pcint):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_setkind_np(__attr:Ppthread_rwlockattr_t; __pref:cint):cint;cdecl;external libthreads;
-  function pthread_spin_init(__lock:Ppthread_spinlock_t; __pshared:cint):cint;cdecl;external libthreads;
-  function pthread_spin_destroy(__lock:Ppthread_spinlock_t):cint;cdecl;external libthreads;
-  function pthread_spin_lock(__lock:Ppthread_spinlock_t):cint;cdecl;external libthreads;
-  function pthread_spin_trylock(__lock:Ppthread_spinlock_t):cint;cdecl;external libthreads;
-  function pthread_spin_unlock(__lock:Ppthread_spinlock_t):cint;cdecl;external libthreads;
-  function pthread_barrier_init(__barrier:Ppthread_barrier_t; __attr:Ppthread_barrierattr_t; __count:dword):cint;cdecl;external libthreads;
-  function pthread_barrier_destroy(__barrier:Ppthread_barrier_t):cint;cdecl;external libthreads;
-  function pthread_barrierattr_init(__attr:Ppthread_barrierattr_t):cint;cdecl;external libthreads;
-  function pthread_barrierattr_destroy(__attr:Ppthread_barrierattr_t):cint;cdecl;external libthreads;
-  function pthread_barrierattr_getpshared(__attr:Ppthread_barrierattr_t; __pshared:pcint):cint;cdecl;external libthreads;
-  function pthread_barrierattr_setpshared(__attr:Ppthread_barrierattr_t; __pshared:cint):cint;cdecl;external libthreads;
-  function pthread_barrier_wait(__barrier:Ppthread_barrier_t):cint;cdecl;external libthreads;
-  function pthread_key_create(__key:Ppthread_key_t; __destr_function :TKeyValueDestructor):cint;cdecl; external libthreads;
-  function pthread_key_delete(__key:pthread_key_t):cint;cdecl; external libthreads;
-  function pthread_setspecific(__key:pthread_key_t; __pointer:pointer):cint;cdecl; external libthreads;
-  function pthread_getspecific(__key:pthread_key_t):pointer;cdecl; external libthreads;
-  function pthread_once(__once_control:Ppthread_once_t; __init_routine:Tprocedure ):cint;cdecl; external libthreads;
-  function pthread_setcancelstate(__state:cint; __oldstate:pcint):cint;cdecl; external libthreads;
-  function pthread_setcanceltype(__type:cint; __oldtype:pcint):cint;cdecl; external libthreads;
-  function pthread_cancel(__thread:pthread_t):cint;cdecl; external libthreads;
-  procedure pthread_testcancel;cdecl; external libthreads;
-  procedure _pthread_cleanup_push(__buffer:P_pthread_cleanup_buffer; __routine:TPthreadCleanupRoutine; __arg:pointer);cdecl; external libthreads;
-  procedure _pthread_cleanup_pop(__buffer:P_pthread_cleanup_buffer; __execute:cint);cdecl; external libthreads;
-  function pthread_atfork(__prepare:TforkHandler ; __parent:TForkHandler ; __child: TForkHandler ):cint;cdecl; external libthreads;
-  procedure pthread_kill_other_threads_np;cdecl; external libthreads;
-  procedure __pthread_initialize; cdecl; external libthreads;
-  function pthread_sigmask(__how:cint; __newmask:P__sigset_t; __oldmask:P__sigset_t):cint;cdecl; external libthreads;
-  function pthread_kill(__thread:pthread_t; __signo:cint):cint;cdecl; external libthreads;
-
-  function sem_init(__sem:Psem_t; __pshared:cint; __value:dword):cint;cdecl;external libthreads;
-  function sem_destroy(__sem:Psem_t):cint;cdecl;external libthreads;
-  function sem_close(__sem:Psem_t):cint;cdecl;external libthreads;
-  function sem_unlink(__name:Pchar):cint;cdecl;external libthreads;
-  function sem_wait(__sem:Psem_t):cint;cdecl;external libthreads;
-  function sem_trywait(__sem:Psem_t):cint;cdecl;external libthreads;
-  function sem_post(__sem:Psem_t):cint;cdecl;external libthreads;
-  function sem_getvalue(__sem:Psem_t; __sval:pcint):cint;cdecl;external libthreads;
-  function sem_timedwait(__sem: Psem_t; __abstime: Ptimespec):cint;cdecl; external libthreads;
-
-{ ---------------------------------------------------------------------
-     Overloaded versions with var args instead of pointers
-  ---------------------------------------------------------------------}
-
-  function pthread_create(var __thread:pthread_t; var __attr: pthread_attr_t; __start_routine:TStartRoutine; __arg:pointer):cint;cdecl; external libthreads;
-  function pthread_join(__th:pthread_t; var __thread_return:pointer):cint;cdecl; external libthreads;
-  function pthread_attr_init(var __attr: pthread_attr_t):cint;cdecl; external libthreads;
-  function pthread_attr_destroy(var __attr: pthread_attr_t):cint;cdecl; external libthreads;
-  function pthread_attr_setdetachstate(var __attr: pthread_attr_t; __detachstate:cint):cint;cdecl; external libthreads;
-  function pthread_attr_getdetachstate(var __attr: pthread_attr_t; var __detachstate:cint):cint;cdecl; external libthreads;
-  function pthread_attr_setschedparam(var __attr: pthread_attr_t; const __param: sched_param):cint;cdecl; external libthreads;
-  function pthread_attr_getschedparam(var __attr: pthread_attr_t; var __param: sched_param):cint;cdecl; external libthreads;
-  function pthread_attr_setschedpolicy(var __attr: pthread_attr_t; __policy:cint):cint;cdecl; external libthreads;
-  function pthread_attr_getschedpolicy(var __attr: pthread_attr_t; var __policy:cint):cint;cdecl; external libthreads;
-  function pthread_attr_setinheritsched(var __attr: pthread_attr_t; __inherit:cint):cint;cdecl; external libthreads;
-  function pthread_attr_getinheritsched(var __attr: pthread_attr_t; var __inherit: cint):cint;cdecl; external libthreads;
-  function pthread_attr_setscope(var __attr: pthread_attr_t; __scope:cint):cint;cdecl; external libthreads;
-  function pthread_attr_getscope(var __attr: pthread_attr_t; var __scope: cint):cint;cdecl; external libthreads;
-  function pthread_attr_setstackaddr(var __attr: pthread_attr_t; __stackaddr:pointer):cint;cdecl; external libthreads;
-  function pthread_attr_getstackaddr(var __attr: pthread_attr_t; var __stackaddr:pointer):cint;cdecl; external libthreads;
-  function pthread_attr_setstacksize(var __attr: pthread_attr_t; __stacksize:size_t):cint;cdecl; external libthreads;
-  function pthread_attr_getstacksize(var __attr: pthread_attr_t; var __stacksize: size_t):cint;cdecl; external libthreads;
-  function pthread_attr_getguardsize(var __attr: pthread_attr_t; var Guardsize: Cardinal): cint; cdecl;external libthreads;
-  function pthread_attr_setguardsize(var __attr: pthread_attr_t; Guardsize: Cardinal): cint; cdecl;external libthreads;
-  function pthread_setschedparam(__target_thread:pthread_t; __policy:cint; const __param: sched_param):cint;cdecl; external libthreads;
-  function pthread_getschedparam(__target_thread:pthread_t; var __policy: cint; var __param: sched_param):cint;cdecl; external libthreads;
-  function pthread_mutex_init(var __mutex: pthread_mutex_t; var __mutex_attr: pthread_mutexattr_t):cint;cdecl; external libthreads;
-  function pthread_mutex_destroy(var __mutex: pthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_mutex_trylock(var __mutex: pthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_mutex_lock(var __mutex: pthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_mutex_unlock(var __mutex: pthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_mutexattr_init(var __attr: pthread_mutexattr_t):cint;cdecl; external libthreads;
-  function pthread_mutexattr_destroy(var __attr: pthread_mutexattr_t):cint;cdecl; external libthreads;
-  function pthread_mutexattr_getpshared(var __attr: pthread_mutexattr_t; var __pshared: cint):cint;cdecl; external libthreads;
-  function pthread_mutexattr_setpshared(var __attr: pthread_mutexattr_t; __pshared:cint):cint;cdecl; external libthreads;
-  function pthread_mutexattr_settype(var __attr: pthread_mutexattr_t; Kind: cint): cint; cdecl;external libthreads;
-  function pthread_mutexattr_gettype(var __attr: pthread_mutexattr_t; var Kind: cint): cint; cdecl;external libthreads;
-  function pthread_cond_init(var __cond: pthread_cond_t;var __cond_attr: pthread_condattr_t):cint;cdecl; external libthreads;
-  function pthread_cond_destroy(var __cond: pthread_cond_t):cint;cdecl; external libthreads;
-  function pthread_cond_signal(var __cond: pthread_cond_t):cint;cdecl; external libthreads;
-  function pthread_cond_broadcast(var __cond: pthread_cond_t):cint;cdecl; external libthreads;
-  function pthread_cond_wait(var __cond: pthread_cond_t; var __mutex: pthread_mutex_t):cint;cdecl; external libthreads;
-  function pthread_cond_timedwait(var __cond: pthread_cond_t; var __mutex: pthread_mutex_t; var __abstime: timespec):cint;cdecl; external libthreads;
-  function pthread_condattr_init(var __attr: pthread_condattr_t):cint;cdecl; external libthreads;
-  function pthread_condattr_destroy(var __attr: pthread_condattr_t):cint;cdecl; external libthreads;
-  function pthread_condattr_getpshared(var __attr: pthread_condattr_t; var __pshared:cint):cint;cdecl; external libthreads;
-  function pthread_condattr_setpshared(var __attr: pthread_condattr_t; __pshared:cint):cint;cdecl; external libthreads;
-  function pthread_rwlock_init(var __rwlock: pthread_rwlock_t; var __attr: pthread_rwlockattr_t):cint;cdecl; external libthreads;
-  function pthread_rwlock_destroy(var __rwlock: pthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlock_rdlock(var __rwlock: pthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlock_tryrdlock(var __rwlock: pthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlock_timedrdlock(var __rwlock: pthread_rwlock_t; __abstime:Ptimespec):cint;cdecl;external libthreads;
-  function pthread_rwlock_wrlock(var __rwlock: pthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlock_trywrlock(var __rwlock: pthread_rwlock_t):cint;cdecl; external libthreads;
-  function pthread_rwlock_timedwrlock(var __rwlock: pthread_rwlock_t; __abstime:Ptimespec):cint;cdecl;external libthreads;
-  function pthread_rwlock_unlock(var __rwlock: pthread_rwlock_t):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_init(var __attr: pthread_rwlockattr_t):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_destroy(var __attr: pthread_rwlockattr_t):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_getpshared(var __attr: pthread_rwlockattr_t; var __pshared: cint):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_setpshared(var __attr: pthread_rwlockattr_t; __pshared:cint):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_getkind_np(var __attr: pthread_rwlockattr_t; var __pref: cint):cint;cdecl;external libthreads;
-  function pthread_rwlockattr_setkind_np(var __attr: pthread_rwlockattr_t; __pref:cint):cint;cdecl;external libthreads;
-  function pthread_spin_init(var __lock: pthread_spinlock_t; __pshared:cint):cint;cdecl;external libthreads;
-  function pthread_spin_destroy(var __lock: pthread_spinlock_t):cint;cdecl;external libthreads;
-  function pthread_spin_lock(var __lock: pthread_spinlock_t):cint;cdecl;external libthreads;
-  function pthread_spin_trylock(var __lock: pthread_spinlock_t):cint;cdecl;external libthreads;
-  function pthread_spin_unlock(var __lock: pthread_spinlock_t):cint;cdecl;external libthreads;
-  function pthread_barrier_init(var __barrier: pthread_barrier_t;var __attr: pthread_barrierattr_t; __count:dword):cint;cdecl;external libthreads;
-  function pthread_barrier_destroy(var __barrier: pthread_barrier_t):cint;cdecl;external libthreads;
-  function pthread_barrierattr_init(var __attr: pthread_barrierattr_t):cint;cdecl;external libthreads;
-  function pthread_barrierattr_destroy(var __attr: pthread_barrierattr_t):cint;cdecl;external libthreads;
-  function pthread_barrierattr_getpshared(var __attr: pthread_barrierattr_t; var __pshared:cint):cint;cdecl;external libthreads;
-  function pthread_barrierattr_setpshared(var __attr: pthread_barrierattr_t; __pshared:cint):cint;cdecl;external libthreads;
-  function pthread_barrier_wait(var __barrier: pthread_barrier_t):cint;cdecl;external libthreads;
-  function pthread_key_create(var __key: pthread_key_t; __destr_function :TKeyValueDestructor):cint;cdecl; external libthreads;
-  function pthread_once(var __once_control: pthread_once_t; __init_routine:Tprocedure ):cint;cdecl; external libthreads;
-  function pthread_setcancelstate(__state:cint; var __oldstate:cint):cint;cdecl; external libthreads;
-  function pthread_setcanceltype(__type:cint;var __oldtype:cint):cint;cdecl; external libthreads;
-
-  procedure _pthread_cleanup_push(var __buffer: _pthread_cleanup_buffer; __routine:TPthreadCleanupRoutine; __arg:pointer);cdecl; external libthreads;
-  procedure _pthread_cleanup_pop(var __buffer:_pthread_cleanup_buffer; __execute:cint);cdecl; external libthreads;
-  function pthread_sigmask(__how:cint; var __newmask:__sigset_t; var __oldmask:__sigset_t):cint;cdecl; external libthreads;
-
-  function sem_init(var __sem: sem_t; __pshared:cint; __value:dword):cint;cdecl;external libthreads;
-  function sem_destroy(var __sem: sem_t):cint;cdecl;external libthreads;
-  function sem_close(var __sem: sem_t):cint;cdecl;external libthreads;
-  function sem_wait(var __sem: sem_t):cint;cdecl;external libthreads;
-  function sem_timedwait(var __sem: sem_t; var __abstime: timespec):cint;cdecl; external libthreads;
-  function sem_trywait(var __sem: sem_t):cint;cdecl;external libthreads;
-  function sem_post(var __sem: sem_t):cint;cdecl;external libthreads;
-  function sem_getvalue(var __sem: sem_t; var __sval:cint):cint;cdecl;external libthreads;
-
-

+ 0 - 359
packages/base/pthreads/pthrsnos.inc

@@ -1,359 +0,0 @@
-{
-  Automatically converted by H2Pas 1.0.0 from pthread.h
-  The following command line parameters were used:
-    pthread.h
-    -D
-    -c
-    -s
-}
-
-type
-  { from sem.h }
-  sem_t       = cint;
-  psem_t          = ^sem_t;
-  TSemaphore  = sem_t;
-  PSemaphore  = ^TSemaphore;
-  
-const
-  External_library='c'; {Setup as you need}
-
-Type
-    ppthread_t           = ^pthread_t;
-    ppthread_key_t       = ^pthread_key_t;
-    ppthread_mutex_t     = ^pthread_mutex_t;
-    ppthread_attr_t      = ^pthread_attr_t;
-    __destr_func_t       = procedure (p :pointer);cdecl;
-    __startroutine_t     = function (p :pointer):pointer;cdecl;
-    ppthread_mutexattr_t = ^pthread_mutexattr_t;
-    ppthread_cond_t      = ^pthread_cond_t;
-    ppthread_condattr_t  = ^pthread_condattr_t;
-
-    {already in unixtype
-    pthread_t = culong
-    } 	    
-  
-    sched_param = record
-      __sched_priority: cint;
-    end;
-  
-    pthread_attr_t = record
-      __pthread_attrp : pointer;
-    end;
-
-{ already in unixtype  
-    pthread_mutex_t = record
-      __pthread_mutex_flags : record
-           __pthread_mutex_flag1 : word;
-           __pthread_mutex_flag2 : byte;
-           __pthread_mutex_ceiling : byte;
-           __pthread_mutex_type : word;
-           __pthread_mutex_magic : word;
-        end;
-
-      __pthread_mutex_lock : record
-          case longint of
-             0 : ( __pthread_mutex_lock64 : record
-                  __pthread_mutex_pad : array[0..7] of byte;
-               end );
-             1 : ( __pthread_mutex_lock32 : record
-                  __pthread_ownerpid : dword;
-                  __pthread_lockword : dword;
-               end );
-             2 : ( __pthread_mutex_owner64 : qword );
-          end;
-      __pthread_mutex_data : qword;
-    end;
-}  
-    pthread_spinlock_t = pthread_mutex_t;
-  
-{ already in unix type
-    pthread_mutexattr_t = record
-      __pthread_mutexattrp : pointer;
-    end;
-}
-  
-{ already in unix type
-    pthread_cond_t = record
-      __pthread_cond_flags : record
-        __pthread_cond_flag : array[0..3] of byte;
-        __pthread_cond_type : uint16_t;
-        __pthread_cond_magic : uint16_t;
-      end;
-      __pthread_cond_data : upad64_t;
-    end;
-
-  
-    pthread_condattr_t = record
-      __pthread_condattrp : pointer;
-    end;
-  
-    pthread_key_t = cuint;
-  
-    pthread_rwlock_t = record
-      __pthread_rwlock_readers : int32_t;
-      __pthread_rwlock_type : uint16_t;
-      __pthread_rwlock_magic : uint16_t;
-      __pthread_rwlock_mutex : pthread_mutex_t;
-      __pthread_rwlock_readercv : pthread_cond_t;
-      __pthread_rwlock_writercv : pthread_cond_t;
-    end;
-}  
-    pthread_rwlockattr_t = record
-      __pthread_rwlockattrp : pointer;
-    end;
-  
-    _once = record
-       __pthread_once_pad : array[0..3] of upad64_t;
-    end;
-    pthread_once_t = _once;
-  
-    pthread_barrier_t = record
-       __pthread_barrier_count : uint32_t;
-       __pthread_barrier_current : uint32_t;
-       __pthread_barrier_cycle : upad64_t;
-       __pthread_barrier_reserved : upad64_t;
-       __pthread_barrier_lock : pthread_mutex_t;
-       __pthread_barrier_cond : pthread_cond_t;
-    end;
-  
-    pthread_barrierattr_t = record
-       __pthread_barrierattrp : pointer;
-    end;
-    
-  P_cleanup_t  = ^_cleanup_t;
-  Pclockid_t  = ^clockid_t;
-  Plongint  = ^longint;
-  Ppthread_barrier_t  = ^pthread_barrier_t;
-  Ppthread_barrierattr_t  = ^pthread_barrierattr_t;
-  
-    
-  Ppthread_once_t  = ^pthread_once_t;
-  Ppthread_rwlock_t  = ^pthread_rwlock_t;
-  Ppthread_rwlockattr_t  = ^pthread_rwlockattr_t;
-  Ppthread_spinlock_t  = ^pthread_spinlock_t;
-  Psched_param  = ^sched_param;
-  Psize_t  = ^size_t;
-  Ptimespec  = ^timespec;
-
-   _cleanup = record
-        pthread_cleanup_pad : array[0..3] of uintptr_t;
-     end;
-   _cleanup_t = _cleanup;
-
-const
-   PTHREAD_CREATE_DETACHED = $40;   
-   PTHREAD_CREATE_JOINABLE = 0;   
-
-
-   PTHREAD_SCOPE_SYSTEM = $01;   
-   PTHREAD_SCOPE_PROCESS = 0;   
-
-
-   PTHREAD_INHERIT_SCHED = 1;   
-   PTHREAD_EXPLICIT_SCHED = 0;   
-
-
-   PTHREAD_PROCESS_SHARED = 1;   
-
-   PTHREAD_PROCESS_PRIVATE = 0;   
-   _DEFAULT_TYPE = PTHREAD_PROCESS_PRIVATE;   
-
-const
-   DEFAULT_TYPE = _DEFAULT_TYPE;   
-
-
-const
-  PTHREAD_MUTEX_NORMAL = $0;   
-  PTHREAD_MUTEX_ERRORCHECK = $2;   
-  PTHREAD_MUTEX_RECURSIVE = $4;   
-  PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL;   
-  
-  PTHREAD_PRIO_NONE = $0;   
-  PTHREAD_PRIO_INHERIT = $10;   
-  PTHREAD_PRIO_PROTECT = $20;   
-  
-  PTHREAD_MUTEX_STALL_NP = $0;   
-  PTHREAD_MUTEX_ROBUST_NP = $40;   
-  
-  
-  PTHREAD_CANCEL_ENABLE = $00;   
-  PTHREAD_CANCEL_DISABLE = $01;   
-  PTHREAD_CANCEL_DEFERRED = $00;   
-  PTHREAD_CANCEL_ASYNCHRONOUS = $02;   
-  PTHREAD_CANCELED = pointer(-(19));
-
-  PTHREAD_ONCE_NOTDONE = 0;   
-  PTHREAD_ONCE_DONE = 1;   
-  
-  PTHREAD_BARRIER_SERIAL_THREAD = -(2);   
-
-type
-   _Voidfp = procedure (_para1:pointer);cdecl;
-  _fp = procedure;cdecl;
-  P_Voidfp = ^_Voidfp;
-
-
-procedure __pthread_cleanup_push(_para1:_Voidfp; _para2:pointer; _para3:caddr_t; _para4:P_cleanup_t);cdecl;external External_library name '__pthread_cleanup_push';
-procedure __pthread_cleanup_pop(_para1:longint; _para2:P_cleanup_t);cdecl;external External_library name '__pthread_cleanup_pop';
-function _getfp:caddr_t;cdecl;external External_library name '_getfp';
-
-function pthread_atfork(_para1:_fp ; _para2:_fp ; _para3:_fp ):longint;cdecl;external External_library name 'pthread_atfork';
-function pthread_attr_init(_para1:Ppthread_attr_t):longint;cdecl;external External_library name 'pthread_attr_init';
-function pthread_attr_destroy(_para1:Ppthread_attr_t):longint;cdecl;external External_library name 'pthread_attr_destroy';
-function pthread_attr_setstack(_para1:Ppthread_attr_t; _para2:pointer; _para3:size_t):longint;cdecl;external External_library name 'pthread_attr_setstack';
-(* Const before type ignored *)
-function pthread_attr_getstack(_RESTRICT_KYWD1:Ppthread_attr_t; _RESTRICT_KYWD2:Ppointer; _RESTRICT_KYWD3:Psize_t):longint;cdecl;external External_library name 'pthread_attr_getstack';
-function pthread_attr_setstacksize(_para1:Ppthread_attr_t; _para2:size_t):longint;cdecl;external External_library name 'pthread_attr_setstacksize';
-(* Const before type ignored *)
-function pthread_attr_getstacksize(_RESTRICT_KYWD1:Ppthread_attr_t; _RESTRICT_KYWD2:Psize_t):longint;cdecl;external External_library name 'pthread_attr_getstacksize';
-function pthread_attr_setstackaddr(_para1:Ppthread_attr_t; _para2:pointer):longint;cdecl;external External_library name 'pthread_attr_setstackaddr';
-(* Const before type ignored *)
-function pthread_attr_getstackaddr(_RESTRICT_KYWD1:Ppthread_attr_t; _RESTRICT_KYWD2:Ppointer):longint;cdecl;external External_library name 'pthread_attr_getstackaddr';
-function pthread_attr_setdetachstate(_para1:Ppthread_attr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_attr_setdetachstate';
-(* Const before type ignored *)
-function pthread_attr_getdetachstate(_para1:Ppthread_attr_t; _para2:Plongint):longint;cdecl;external External_library name 'pthread_attr_getdetachstate';
-function pthread_attr_setscope(_para1:Ppthread_attr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_attr_setscope';
-(* Const before type ignored *)
-function pthread_attr_getscope(_RESTRICT_KYWD1:Ppthread_attr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_attr_getscope';
-function pthread_attr_setinheritsched(_para1:Ppthread_attr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_attr_setinheritsched';
-(* Const before type ignored *)
-function pthread_attr_getinheritsched(_RESTRICT_KYWD1:Ppthread_attr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_attr_getinheritsched';
-function pthread_attr_setschedpolicy(_para1:Ppthread_attr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_attr_setschedpolicy';
-(* Const before type ignored *)
-function pthread_attr_getschedpolicy(_RESTRICT_KYWD1:Ppthread_attr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_attr_getschedpolicy';
-(* Const before type ignored *)
-function pthread_attr_setschedparam(_RESTRICT_KYWD1:Ppthread_attr_t; _RESTRICT_KYWD2:Psched_param):longint;cdecl;external External_library name 'pthread_attr_setschedparam';
-(* Const before type ignored *)
-function pthread_attr_getschedparam(_RESTRICT_KYWD1:Ppthread_attr_t; _RESTRICT_KYWD2:Psched_param):longint;cdecl;external External_library name 'pthread_attr_getschedparam';
-(* Const before type ignored *)
-function pthread_create(_RESTRICT_KYWD1:Ppthread_t; _RESTRICT_KYWD2:Ppthread_attr_t; _para3:P_Voidfp ; _RESTRICT_KYWD3:pointer):longint;cdecl;external External_library name 'pthread_create';
-function pthread_once(_para1:Ppthread_once_t; _para2:_fp ):longint;cdecl;external External_library name 'pthread_once';
-function pthread_join(_para1:pthread_t; _para2:Ppointer):longint;cdecl;external External_library name 'pthread_join';
-function pthread_detach(_para1:pthread_t):longint;cdecl;external External_library name 'pthread_detach';
-procedure pthread_exit(_para1:pointer);cdecl;external External_library name 'pthread_exit';
-function pthread_cancel(_para1:pthread_t):longint;cdecl;external External_library name 'pthread_cancel';
-(* Const before type ignored *)
-function pthread_setschedparam(_para1:pthread_t; _para2:longint; _para3:Psched_param):longint;cdecl;external External_library name 'pthread_setschedparam';
-function pthread_getschedparam(_para1:pthread_t; _RESTRICT_KYWD1:Plongint; _RESTRICT_KYWD2:Psched_param):longint;cdecl;external External_library name 'pthread_getschedparam';
-function pthread_setschedprio(_para1:pthread_t; _para2:longint):longint;cdecl;external External_library name 'pthread_setschedprio';
-function pthread_setcancelstate(_para1:longint; _para2:Plongint):longint;cdecl;external External_library name 'pthread_setcancelstate';
-function pthread_setcanceltype(_para1:longint; _para2:Plongint):longint;cdecl;external External_library name 'pthread_setcanceltype';
-procedure pthread_testcancel;cdecl;external External_library name 'pthread_testcancel';
-function pthread_equal(_para1:pthread_t; _para2:pthread_t):longint;cdecl;external External_library name 'pthread_equal';
-function pthread_key_create(_para1:Ppthread_key_t; _para2:_Voidfp):longint;cdecl;external External_library name 'pthread_key_create';
-function pthread_key_delete(_para1:pthread_key_t):longint;cdecl;external External_library name 'pthread_key_delete';
-(* Const before type ignored *)
-function pthread_setspecific(_para1:pthread_key_t; _para2:pointer):longint;cdecl;external External_library name 'pthread_setspecific';
-function pthread_getspecific(_para1:pthread_key_t):pointer;cdecl;external External_library name 'pthread_getspecific';
-function pthread_self:pthread_t;cdecl;external External_library name 'pthread_self';
-
-function pthread_mutexattr_init(_para1:Ppthread_mutexattr_t):longint;cdecl;external External_library name 'pthread_mutexattr_init';
-function pthread_mutexattr_destroy(_para1:Ppthread_mutexattr_t):longint;cdecl;external External_library name 'pthread_mutexattr_destroy';
-function pthread_mutexattr_setpshared(_para1:Ppthread_mutexattr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_mutexattr_setpshared';
-(* Const before type ignored *)
-function pthread_mutexattr_getpshared(_RESTRICT_KYWD1:Ppthread_mutexattr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_mutexattr_getpshared';
-function pthread_mutexattr_setprotocol(_para1:Ppthread_mutexattr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_mutexattr_setprotocol';
-(* Const before type ignored *)
-function pthread_mutexattr_getprotocol(_RESTRICT_KYWD1:Ppthread_mutexattr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_mutexattr_getprotocol';
-function pthread_mutexattr_setprioceiling(_para1:Ppthread_mutexattr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_mutexattr_setprioceiling';
-(* Const before type ignored *)
-function pthread_mutexattr_getprioceiling(_RESTRICT_KYWD1:Ppthread_mutexattr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_mutexattr_getprioceiling';
-function pthread_mutexattr_setrobust_np(_para1:Ppthread_mutexattr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_mutexattr_setrobust_np';
-(* Const before type ignored *)
-function pthread_mutexattr_getrobust_np(_RESTRICT_KYWD1:Ppthread_mutexattr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_mutexattr_getrobust_np';
-(* Const before type ignored *)
-function pthread_mutex_init(_RESTRICT_KYWD1:Ppthread_mutex_t; _RESTRICT_KYWD2:Ppthread_mutexattr_t):longint;cdecl;external External_library name 'pthread_mutex_init';
-function pthread_mutex_consistent_np(_para1:Ppthread_mutex_t):longint;cdecl;external External_library name 'pthread_mutex_consistent_np';
-function pthread_mutex_destroy(_para1:Ppthread_mutex_t):longint;cdecl;external External_library name 'pthread_mutex_destroy';
-function pthread_mutex_lock(_para1:Ppthread_mutex_t):longint;cdecl;external External_library name 'pthread_mutex_lock';
-(* Const before type ignored *)
-function pthread_mutex_timedlock(_RESTRICT_KYWD1:Ppthread_mutex_t; _RESTRICT_KYWD2:Ptimespec):longint;cdecl;external External_library name 'pthread_mutex_timedlock';
-(* Const before type ignored *)
-function pthread_mutex_reltimedlock_np(_RESTRICT_KYWD1:Ppthread_mutex_t; _RESTRICT_KYWD2:Ptimespec):longint;cdecl;external External_library name 'pthread_mutex_reltimedlock_np';
-function pthread_mutex_unlock(_para1:Ppthread_mutex_t):longint;cdecl;external External_library name 'pthread_mutex_unlock';
-function pthread_mutex_trylock(_para1:Ppthread_mutex_t):longint;cdecl;external External_library name 'pthread_mutex_trylock';
-function pthread_mutex_setprioceiling(_RESTRICT_KYWD1:Ppthread_mutex_t; _para2:longint; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_mutex_setprioceiling';
-(* Const before type ignored *)
-function pthread_mutex_getprioceiling(_RESTRICT_KYWD1:Ppthread_mutex_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_mutex_getprioceiling';
-function pthread_condattr_init(_para1:Ppthread_condattr_t):longint;cdecl;external External_library name 'pthread_condattr_init';
-function pthread_condattr_destroy(_para1:Ppthread_condattr_t):longint;cdecl;external External_library name 'pthread_condattr_destroy';
-function pthread_condattr_setclock(_para1:Ppthread_condattr_t; _para2:clockid_t):longint;cdecl;external External_library name 'pthread_condattr_setclock';
-(* Const before type ignored *)
-function pthread_condattr_getclock(_RESTRICT_KYWD1:Ppthread_condattr_t; _RESTRICT_KYWD2:Pclockid_t):longint;cdecl;external External_library name 'pthread_condattr_getclock';
-function pthread_condattr_setpshared(_para1:Ppthread_condattr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_condattr_setpshared';
-(* Const before type ignored *)
-function pthread_condattr_getpshared(_RESTRICT_KYWD1:Ppthread_condattr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_condattr_getpshared';
-(* Const before type ignored *)
-function pthread_cond_init(_RESTRICT_KYWD1:Ppthread_cond_t; _RESTRICT_KYWD2:Ppthread_condattr_t):longint;cdecl;external External_library name 'pthread_cond_init';
-function pthread_cond_destroy(_para1:Ppthread_cond_t):longint;cdecl;external External_library name 'pthread_cond_destroy';
-function pthread_cond_broadcast(_para1:Ppthread_cond_t):longint;cdecl;external External_library name 'pthread_cond_broadcast';
-function pthread_cond_signal(_para1:Ppthread_cond_t):longint;cdecl;external External_library name 'pthread_cond_signal';
-function pthread_cond_wait(_RESTRICT_KYWD1:Ppthread_cond_t; _RESTRICT_KYWD2:Ppthread_mutex_t):longint;cdecl;external External_library name 'pthread_cond_wait';
-(* Const before type ignored *)
-function pthread_cond_timedwait(_RESTRICT_KYWD1:Ppthread_cond_t; _RESTRICT_KYWD2:Ppthread_mutex_t; _RESTRICT_KYWD3:Ptimespec):longint;cdecl;external External_library name 'pthread_cond_timedwait';
-(* Const before type ignored *)
-function pthread_cond_reltimedwait_np(_RESTRICT_KYWD1:Ppthread_cond_t; _RESTRICT_KYWD2:Ppthread_mutex_t; _RESTRICT_KYWD3:Ptimespec):longint;cdecl;external External_library name 'pthread_cond_reltimedwait_np';
-(* Const before type ignored *)
-function pthread_attr_getguardsize(_RESTRICT_KYWD1:Ppthread_attr_t; _RESTRICT_KYWD2:Psize_t):longint;cdecl;external External_library name 'pthread_attr_getguardsize';
-function pthread_attr_setguardsize(_para1:Ppthread_attr_t; _para2:size_t):longint;cdecl;external External_library name 'pthread_attr_setguardsize';
-function pthread_getconcurrency:longint;cdecl;external External_library name 'pthread_getconcurrency';
-function pthread_setconcurrency(_para1:longint):longint;cdecl;external External_library name 'pthread_setconcurrency';
-function pthread_mutexattr_settype(_para1:Ppthread_mutexattr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_mutexattr_settype';
-(* Const before type ignored *)
-function pthread_mutexattr_gettype(_RESTRICT_KYWD1:Ppthread_mutexattr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_mutexattr_gettype';
-(* Const before type ignored *)
-function pthread_rwlock_init(_RESTRICT_KYWD1:Ppthread_rwlock_t; _RESTRICT_KYWD2:Ppthread_rwlockattr_t):longint;cdecl;external External_library name 'pthread_rwlock_init';
-function pthread_rwlock_destroy(_para1:Ppthread_rwlock_t):longint;cdecl;external External_library name 'pthread_rwlock_destroy';
-function pthread_rwlock_rdlock(_para1:Ppthread_rwlock_t):longint;cdecl;external External_library name 'pthread_rwlock_rdlock';
-(* Const before type ignored *)
-function pthread_rwlock_timedrdlock(_RESTRICT_KYWD1:Ppthread_rwlock_t; _RESTRICT_KYWD2:Ptimespec):longint;cdecl;external External_library name 'pthread_rwlock_timedrdlock';
-(* Const before type ignored *)
-function pthread_rwlock_reltimedrdlock_np(_RESTRICT_KYWD1:Ppthread_rwlock_t; _RESTRICT_KYWD2:Ptimespec):longint;cdecl;external External_library name 'pthread_rwlock_reltimedrdlock_np';
-function pthread_rwlock_tryrdlock(_para1:Ppthread_rwlock_t):longint;cdecl;external External_library name 'pthread_rwlock_tryrdlock';
-function pthread_rwlock_wrlock(_para1:Ppthread_rwlock_t):longint;cdecl;external External_library name 'pthread_rwlock_wrlock';
-(* Const before type ignored *)
-function pthread_rwlock_timedwrlock(_RESTRICT_KYWD1:Ppthread_rwlock_t; _RESTRICT_KYWD2:Ptimespec):longint;cdecl;external External_library name 'pthread_rwlock_timedwrlock';
-(* Const before type ignored *)
-function pthread_rwlock_reltimedwrlock_np(_RESTRICT_KYWD1:Ppthread_rwlock_t; _RESTRICT_KYWD2:Ptimespec):longint;cdecl;external External_library name 'pthread_rwlock_reltimedwrlock_np';
-function pthread_rwlock_trywrlock(_para1:Ppthread_rwlock_t):longint;cdecl;external External_library name 'pthread_rwlock_trywrlock';
-function pthread_rwlock_unlock(_para1:Ppthread_rwlock_t):longint;cdecl;external External_library name 'pthread_rwlock_unlock';
-function pthread_rwlockattr_init(_para1:Ppthread_rwlockattr_t):longint;cdecl;external External_library name 'pthread_rwlockattr_init';
-function pthread_rwlockattr_destroy(_para1:Ppthread_rwlockattr_t):longint;cdecl;external External_library name 'pthread_rwlockattr_destroy';
-(* Const before type ignored *)
-function pthread_rwlockattr_getpshared(_RESTRICT_KYWD1:Ppthread_rwlockattr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_rwlockattr_getpshared';
-function pthread_rwlockattr_setpshared(_para1:Ppthread_rwlockattr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_rwlockattr_setpshared';
-function pthread_spin_init(_para1:Ppthread_spinlock_t; _para2:longint):longint;cdecl;external External_library name 'pthread_spin_init';
-function pthread_spin_destroy(_para1:Ppthread_spinlock_t):longint;cdecl;external External_library name 'pthread_spin_destroy';
-function pthread_spin_lock(_para1:Ppthread_spinlock_t):longint;cdecl;external External_library name 'pthread_spin_lock';
-function pthread_spin_trylock(_para1:Ppthread_spinlock_t):longint;cdecl;external External_library name 'pthread_spin_trylock';
-function pthread_spin_unlock(_para1:Ppthread_spinlock_t):longint;cdecl;external External_library name 'pthread_spin_unlock';
-function pthread_barrierattr_init(_para1:Ppthread_barrierattr_t):longint;cdecl;external External_library name 'pthread_barrierattr_init';
-function pthread_barrierattr_destroy(_para1:Ppthread_barrierattr_t):longint;cdecl;external External_library name 'pthread_barrierattr_destroy';
-function pthread_barrierattr_setpshared(_para1:Ppthread_barrierattr_t; _para2:longint):longint;cdecl;external External_library name 'pthread_barrierattr_setpshared';
-(* Const before type ignored *)
-function pthread_barrierattr_getpshared(_RESTRICT_KYWD1:Ppthread_barrierattr_t; _RESTRICT_KYWD2:Plongint):longint;cdecl;external External_library name 'pthread_barrierattr_getpshared';
-(* Const before type ignored *)
-function pthread_barrier_init(_RESTRICT_KYWD1:Ppthread_barrier_t; _RESTRICT_KYWD2:Ppthread_barrierattr_t; _para3:uint_t):longint;cdecl;external External_library name 'pthread_barrier_init';
-function pthread_barrier_destroy(_para1:Ppthread_barrier_t):longint;cdecl;external External_library name 'pthread_barrier_destroy';
-function pthread_barrier_wait(_para1:Ppthread_barrier_t):longint;cdecl;external External_library name 'pthread_barrier_wait';
-
-function sem_init(__sem:Psem_t; __pshared:cint;__value:cuint):cint;cdecl; external 'c' name 'sem_init';
-function sem_destroy(__sem:Psem_t):cint;cdecl;external 'c' name 'sem_destroy';
-function sem_close(__sem:Psem_t):cint;cdecl;external 'c'  name 'sem_close';
-function sem_unlink(__name:Pchar):cint;cdecl;external 'c' name 'sem_unlink';
-function sem_wait(__sem:Psem_t):cint;cdecl;external 'c'  name 'sem_wait';
-function sem_trywait(__sem:Psem_t):cint;cdecl;external 'c'  name 'sem_trywait';
-function sem_post(__sem:Psem_t):cint;cdecl;external 'c'  name 'sem_post';
-function sem_getvalue(__sem:Psem_t; __sval:Pcint):cint;cdecl;external 'c'  name 'sem_getvalue';
-
-type
-  { redefinitions }
-  TThreadAttr = pthread_attr_t;
-  PThreadAttr = ^TThreadAttr;
-
-  TMutexAttribute = pthread_mutexattr_t;
-  PMutexAttribute = ^TMutexAttribute;
-
-  TPthreadMutex = pthread_mutex_t;
-  PPthreadMutex = ^TPthreadMutex;
-  

+ 0 - 1933
packages/base/sqlite/Makefile

@@ -1,1933 +0,0 @@
-#
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
-#
-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 i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
-BSDs = freebsd netbsd openbsd darwin
-UNIXs = linux $(BSDs) solaris qnx
-LIMIT83fs = go32v2 os2 emx watcom
-OSNeedsComspecToRunBatch = go32v2 watcom
-FORCE:
-.PHONY: FORCE
-override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
-ifneq ($(findstring darwin,$(OSTYPE)),)
-inUnix=1 #darwin
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-ifeq ($(findstring ;,$(PATH)),)
-inUnix=1
-SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
-else
-SEARCHPATH:=$(subst ;, ,$(PATH))
-endif
-endif
-SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
-PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
-ifeq ($(PWD),)
-PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
-ifeq ($(PWD),)
-$(error You need the GNU utils package to use this Makefile)
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=
-endif
-else
-PWD:=$(firstword $(PWD))
-SRCEXEEXT=.exe
-endif
-ifndef inUnix
-ifeq ($(OS),Windows_NT)
-inWinNT=1
-else
-ifdef OS2_SHELL
-inOS2=1
-endif
-endif
-else
-ifneq ($(findstring cygdrive,$(PATH)),)
-inCygWin=1
-endif
-endif
-ifdef inUnix
-SRCBATCHEXT=.sh
-else
-ifdef inOS2
-SRCBATCHEXT=.cmd
-else
-SRCBATCHEXT=.bat
-endif
-endif
-ifdef COMSPEC
-ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
-RUNBATCH=$(COMSPEC) /C
-endif
-endif
-ifdef inUnix
-PATHSEP=/
-else
-PATHSEP:=$(subst /,\,/)
-ifdef inCygWin
-PATHSEP=/
-endif
-endif
-ifdef PWD
-BASEDIR:=$(subst \,/,$(shell $(PWD)))
-ifdef inCygWin
-ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
-BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
-BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
-BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
-endif
-endif
-else
-BASEDIR=.
-endif
-ifdef inOS2
-ifndef ECHO
-ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
-ifeq ($(ECHO),)
-ECHO=echo
-else
-ECHO:=$(firstword $(ECHO))
-endif
-else
-ECHO:=$(firstword $(ECHO))
-endif
-endif
-export ECHO
-endif
-override DEFAULT_FPCDIR=../../..
-ifndef FPC
-ifdef PP
-FPC=$(PP)
-endif
-endif
-ifndef FPC
-FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
-ifneq ($(FPCPROG),)
-FPCPROG:=$(firstword $(FPCPROG))
-ifneq ($(CPU_TARGET),)
-FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
-else
-FPC:=$(shell $(FPCPROG) -PB)
-endif
-ifneq ($(findstring Error,$(FPC)),)
-override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
-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 $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
-override PACKAGE_NAME=sqlite
-override PACKAGE_VERSION=2.0.0
-ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-endif
-override INSTALL_FPCPACKAGE=y
-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
-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
-ifeq ($(OS_TARGET),gba)
-EXEEXT=.gba
-SHAREDLIBEXT=.so
-SHORTSUFFIX=gba
-endif
-ifeq ($(OS_TARGET),symbian)
-SHAREDLIBEXT=.dll
-SHORTSUFFIX=symbian
-endif
-else
-ifeq ($(OS_TARGET),go32v1)
-PPUEXT=.pp1
-OEXT=.o1
-ASMEXT=.s1
-SMARTEXT=.sl1
-STATICLIBEXT=.a1
-SHAREDLIBEXT=.so1
-STATICLIBPREFIX=
-SHORTSUFFIX=v1
-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=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.library
-SHORTSUFFIX=amg
-endif
-ifeq ($(OS_TARGET),atari)
-PPUEXT=.ppu
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=.ttp
-SHORTSUFFIX=ata
-endif
-ifeq ($(OS_TARGET),beos)
-BATCHEXT=.sh
-PPUEXT=.ppu
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=
-SHORTSUFFIX=be
-endif
-ifeq ($(OS_TARGET),solaris)
-BATCHEXT=.sh
-PPUEXT=.ppu
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=
-SHORTSUFFIX=sun
-endif
-ifeq ($(OS_TARGET),qnx)
-BATCHEXT=.sh
-PPUEXT=.ppu
-ASMEXT=.s
-OEXT=.o
-SMARTEXT=.sl
-STATICLIBEXT=.a
-EXEEXT=
-SHORTSUFFIX=qnx
-endif
-ifeq ($(OS_TARGET),netware)
-STATICLIBPREFIX=
-PPUEXT=.ppu
-OEXT=.o
-ASMEXT=.s
-SMARTEXT=.sl
-STATICLIBEXT=.a
-SHAREDLIBEXT=.nlm
-EXEEXT=.nlm
-SHORTSUFFIX=nw
-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),i386-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),i386-symbian)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-freebsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-netbsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-amiga)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-atari)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-openbsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-palmos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),m68k-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-netbsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-amiga)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-macos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-darwin)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-morphos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),sparc-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),sparc-netbsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),sparc-solaris)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),sparc-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-freebsd)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-darwin)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-win64)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),x86_64-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-palmos)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-wince)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-gba)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-nds)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),arm-symbian)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc64-linux)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc64-darwin)
-REQUIRE_PACKAGES_RTL=1
-endif
-ifeq ($(FULL_TARGET),powerpc64-embedded)
-REQUIRE_PACKAGES_RTL=1
-endif
-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)
-endif
-ifneq ($(BINUTILSPREFIX),)
-override FPCOPT+=-Xr$(RLINKPATH)
-endif
-endif
-ifdef UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
-endif
-ifdef LIBDIR
-override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
-endif
-ifdef OBJDIR
-override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
-endif
-ifdef INCDIR
-override FPCOPT+=$(addprefix -Fi,$(INCDIR))
-endif
-ifdef LINKSMART
-override FPCOPT+=-XX
-endif
-ifdef CREATESMART
-override FPCOPT+=-CX
-endif
-ifdef DEBUG
-override FPCOPT+=-gl
-override FPCOPTDEF+=DEBUG
-endif
-ifdef RELEASE
-ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
-ifeq ($(CPU_TARGET),i386)
-FPCCPUOPT:=-OG2p3
-endif
-ifeq ($(CPU_TARGET),powerpc)
-FPCCPUOPT:=-O1r
-endif
-else
-FPCCPUOPT:=-O2
-endif
-override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
-override FPCOPTDEF+=RELEASE
-endif
-ifdef STRIP
-override FPCOPT+=-Xs
-endif
-ifdef OPTIMIZE
-override FPCOPT+=-O2
-endif
-ifdef VERBOSE
-override FPCOPT+=-vwni
-endif
-ifdef COMPILER_OPTIONS
-override FPCOPT+=$(COMPILER_OPTIONS)
-endif
-ifdef COMPILER_UNITDIR
-override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
-endif
-ifdef COMPILER_LIBRARYDIR
-override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
-endif
-ifdef COMPILER_OBJECTDIR
-override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
-endif
-ifdef COMPILER_INCLUDEDIR
-override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
-endif
-ifdef CROSSBINDIR
-override FPCOPT+=-FD$(CROSSBINDIR)
-endif
-ifdef COMPILER_TARGETDIR
-override FPCOPT+=-FE$(COMPILER_TARGETDIR)
-ifeq ($(COMPILER_TARGETDIR),.)
-override TARGETDIRPREFIX=
-else
-override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
-endif
-endif
-ifdef COMPILER_UNITTARGETDIR
-override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
-ifeq ($(COMPILER_UNITTARGETDIR),.)
-override UNITTARGETDIRPREFIX=
-else
-override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
-endif
-else
-ifdef COMPILER_TARGETDIR
-override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
-override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
-endif
-endif
-ifdef CREATESHARED
-override FPCOPT+=-Cg
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-Aas
-endif
-endif
-ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
-ifeq ($(OS_TARGET),linux)
-ifeq ($(CPU_TARGET),x86_64)
-override FPCOPT+=-Cg
-endif
-endif
-endif
-ifdef LINKSHARED
-endif
-ifdef OPT
-override FPCOPT+=$(OPT)
-endif
-ifdef FPCOPTDEF
-override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
-endif
-ifdef CFGFILE
-override FPCOPT+=@$(CFGFILE)
-endif
-ifdef USEENV
-override FPCEXTCMD:=$(FPCOPT)
-override FPCOPT:=!FPCEXTCMD
-export FPCEXTCMD
-endif
-override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
-override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
-ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
-override ACROSSCOMPILE=1
-endif
-ifdef ACROSSCOMPILE
-override FPCOPT+=$(CROSSOPT)
-endif
-override COMPILER:=$(FPC) $(FPCOPT)
-ifeq (,$(findstring -s ,$(COMPILER)))
-EXECPPAS=
-else
-ifeq ($(FULL_SOURCE),$(FULL_TARGET))
-ifdef RUNBATCH
-EXECPPAS:=@$(RUNBATCH) $(PPAS)
-else
-EXECPPAS:=@$(PPAS)
-endif
-endif
-endif
-.PHONY: fpc_units
-ifneq ($(TARGET_UNITS),)
-override ALLTARGET+=fpc_units
-override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
-override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
-override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
-override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
-endif
-fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES)
-ifdef TARGET_RSTS
-override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
-override CLEANRSTFILES+=$(RSTFILES)
-endif
-.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
-$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
-	@$(ECHOREDIR) Compiled > $(FPCMADE)
-fpc_all: $(FPCMADE)
-fpc_smart:
-	$(MAKE) all LINKSMART=1 CREATESMART=1
-fpc_debug:
-	$(MAKE) all DEBUG=1
-fpc_release:
-	$(MAKE) all RELEASE=1
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
-$(COMPILER_UNITTARGETDIR):
-	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
-$(COMPILER_TARGETDIR):
-	$(MKDIRTREE) $(COMPILER_TARGETDIR)
-%$(PPUEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(PPUEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pp
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.pas
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.lpr
-	$(COMPILER) $<
-	$(EXECPPAS)
-%$(EXEEXT): %.dpr
-	$(COMPILER) $<
-	$(EXECPPAS)
-%.res: %.rc
-	windres -i $< -o $@
-vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
-vpath %.inc $(COMPILER_INCLUDEDIR)
-vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
-vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
-.PHONY: fpc_shared
-override INSTALLTARGET+=fpc_shared_install
-ifndef SHARED_LIBVERSION
-SHARED_LIBVERSION=$(FPC_VERSION)
-endif
-ifndef SHARED_LIBNAME
-SHARED_LIBNAME=$(PACKAGE_NAME)
-endif
-ifndef SHARED_FULLNAME
-SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
-endif
-ifndef SHARED_LIBUNITS
-SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
-override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
-endif
-fpc_shared:
-ifdef HASSHAREDLIB
-	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
-ifneq ($(SHARED_BUILD),n)
-	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
-endif
-else
-	@$(ECHO) Shared Libraries not supported
-endif
-fpc_shared_install:
-ifneq ($(SHARED_BUILD),n)
-ifneq ($(SHARED_LIBUNITS),)
-ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
-	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
-endif
-endif
-endif
-.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
-ifdef INSTALL_UNITS
-override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
-endif
-ifdef INSTALL_BUILDUNIT
-override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
-endif
-ifdef INSTALLPPUFILES
-override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
-ifneq ($(UNITTARGETDIRPREFIX),)
-override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
-override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
-endif
-override INSTALL_CREATEPACKAGEFPC=1
-endif
-ifdef INSTALLEXEFILES
-ifneq ($(TARGETDIRPREFIX),)
-override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
-endif
-endif
-fpc_install: all $(INSTALLTARGET)
-ifdef INSTALLEXEFILES
-	$(MKDIR) $(INSTALL_BINDIR)
-ifdef UPXPROG
-	-$(UPXPROG) $(INSTALLEXEFILES)
-endif
-	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
-endif
-ifdef INSTALL_CREATEPACKAGEFPC
-ifdef FPCMAKE
-ifdef PACKAGE_VERSION
-ifneq ($(wildcard Makefile.fpc),)
-	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
-endif
-endif
-endif
-endif
-ifdef INSTALLPPUFILES
-	$(MKDIR) $(INSTALL_UNITDIR)
-	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
-ifneq ($(INSTALLPPULINKFILES),)
-	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
-endif
-ifneq ($(wildcard $(LIB_FULLNAME)),)
-	$(MKDIR) $(INSTALL_LIBDIR)
-	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
-ifdef inUnix
-	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
-endif
-endif
-endif
-ifdef INSTALL_FILES
-	$(MKDIR) $(INSTALL_DATADIR)
-	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
-endif
-fpc_sourceinstall: distclean
-	$(MKDIR) $(INSTALL_SOURCEDIR)
-	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
-fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
-ifdef HASEXAMPLES
-	$(MKDIR) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef EXAMPLESOURCEFILES
-	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
-endif
-ifdef TARGET_EXAMPLEDIRS
-	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
-endif
-.PHONY: fpc_distinstall
-fpc_distinstall: install exampleinstall
-.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
-ifndef PACKDIR
-ifndef inUnix
-PACKDIR=$(BASEDIR)/../fpc-pack
-else
-PACKDIR=/tmp/fpc-pack
-endif
-endif
-ifndef ZIPNAME
-ifdef DIST_ZIPNAME
-ZIPNAME=$(DIST_ZIPNAME)
-else
-ZIPNAME=$(PACKAGE_NAME)
-endif
-endif
-ifndef FULLZIPNAME
-FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
-endif
-ifndef ZIPTARGET
-ifdef DIST_ZIPTARGET
-ZIPTARGET=DIST_ZIPTARGET
-else
-ZIPTARGET=install
-endif
-endif
-ifndef USEZIP
-ifdef inUnix
-USETAR=1
-endif
-endif
-ifndef inUnix
-USEZIPWRAPPER=1
-endif
-ifdef USEZIPWRAPPER
-ZIPPATHSEP=$(PATHSEP)
-ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
-else
-ZIPPATHSEP=/
-endif
-ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
-ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
-ifdef USETAR
-ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
-ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
-else
-ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
-ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
-endif
-fpc_zipinstall:
-	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
-	$(MKDIR) $(DIST_DESTDIR)
-	$(DEL) $(ZIPDESTFILE)
-ifdef USEZIPWRAPPER
-ifneq ($(ECHOREDIR),echo)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
-	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
-else
-	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
-	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
-	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
-endif
-ifdef inUnix
-	/bin/sh $(ZIPWRAPPER)
-else
-ifdef RUNBATCH
-	$(RUNBATCH) (ZIPWRAPPER)
-else
-	$(ZIPWRAPPER)
-endif
-endif
-	$(DEL) $(ZIPWRAPPER)
-else
-	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
-endif
-	$(DELTREE) $(PACKDIR)
-fpc_zipsourceinstall:
-	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
-fpc_zipexampleinstall:
-ifdef HASEXAMPLES
-	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
-endif
-fpc_zipdistinstall:
-	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
-.PHONY: fpc_clean fpc_cleanall fpc_distclean
-ifdef EXEFILES
-override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
-endif
-ifdef CLEAN_UNITS
-override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
-endif
-ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
-ifdef DEBUGSYMEXT
-override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
-endif
-override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
-override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
-endif
-fpc_clean: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-ifdef CLEAN_FILES
-	-$(DEL) $(CLEAN_FILES)
-endif
-ifdef LIB_NAME
-	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
-endif
-	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
-	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
-fpc_cleanall: $(CLEANTARGET)
-ifdef CLEANEXEFILES
-	-$(DEL) $(CLEANEXEFILES)
-endif
-ifdef COMPILER_UNITTARGETDIR
-ifdef CLEANPPUFILES
-	-$(DEL) $(CLEANPPUFILES)
-endif
-ifneq ($(CLEANPPULINKFILES),)
-	-$(DEL) $(CLEANPPULINKFILES)
-endif
-ifdef CLEANRSTFILES
-	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
-endif
-endif
-	-$(DELTREE) units
-	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
-ifneq ($(PPUEXT),.ppu)
-	-$(DEL) *.o *.ppu *.a
-endif
-	-$(DELTREE) *$(SMARTEXT)
-	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
-	-$(DEL) *_ppas$(BATCHEXT)
-ifdef AOUTEXT
-	-$(DEL) *$(AOUTEXT)
-endif
-ifdef DEBUGSYMEXT
-	-$(DEL) *$(DEBUGSYMEXT)
-endif
-fpc_distclean: cleanall
-.PHONY: fpc_baseinfo
-override INFORULES+=fpc_baseinfo
-fpc_baseinfo:
-	@$(ECHO)
-	@$(ECHO)  == Package info ==
-	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
-	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
-	@$(ECHO)
-	@$(ECHO)  == Configuration info ==
-	@$(ECHO)
-	@$(ECHO)  FPC.......... $(FPC)
-	@$(ECHO)  FPC Version.. $(FPC_VERSION)
-	@$(ECHO)  Source CPU... $(CPU_SOURCE)
-	@$(ECHO)  Target CPU... $(CPU_TARGET)
-	@$(ECHO)  Source OS.... $(OS_SOURCE)
-	@$(ECHO)  Target OS.... $(OS_TARGET)
-	@$(ECHO)  Full Source.. $(FULL_SOURCE)
-	@$(ECHO)  Full Target.. $(FULL_TARGET)
-	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
-	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
-	@$(ECHO)
-	@$(ECHO)  == Directory info ==
-	@$(ECHO)
-	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
-	@$(ECHO)
-	@$(ECHO)  Basedir......... $(BASEDIR)
-	@$(ECHO)  FPCDir.......... $(FPCDIR)
-	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
-	@$(ECHO)  UnitsDir........ $(UNITSDIR)
-	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
-	@$(ECHO)
-	@$(ECHO)  GCC library..... $(GCCLIBDIR)
-	@$(ECHO)  Other library... $(OTHERLIBDIR)
-	@$(ECHO)
-	@$(ECHO)  == Tools info ==
-	@$(ECHO)
-	@$(ECHO)  As........ $(AS)
-	@$(ECHO)  Ld........ $(LD)
-	@$(ECHO)  Ar........ $(AR)
-	@$(ECHO)  Rc........ $(RC)
-	@$(ECHO)
-	@$(ECHO)  Mv........ $(MVPROG)
-	@$(ECHO)  Cp........ $(CPPROG)
-	@$(ECHO)  Rm........ $(RMPROG)
-	@$(ECHO)  GInstall.. $(GINSTALL)
-	@$(ECHO)  Echo...... $(ECHO)
-	@$(ECHO)  Shell..... $(SHELL)
-	@$(ECHO)  Date...... $(DATE)
-	@$(ECHO)  FPCMake... $(FPCMAKE)
-	@$(ECHO)  PPUMove... $(PPUMOVE)
-	@$(ECHO)  Upx....... $(UPXPROG)
-	@$(ECHO)  Zip....... $(ZIPPROG)
-	@$(ECHO)
-	@$(ECHO)  == Object info ==
-	@$(ECHO)
-	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
-	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
-	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
-	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
-	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
-	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
-	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
-	@$(ECHO)
-	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
-	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
-	@$(ECHO)
-	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
-	@$(ECHO)  Install Files....... $(INSTALL_FILES)
-	@$(ECHO)
-	@$(ECHO)  == Install info ==
-	@$(ECHO)
-	@$(ECHO)  DateStr.............. $(DATESTR)
-	@$(ECHO)  ZipName.............. $(ZIPNAME)
-	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
-	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
-	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
-	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
-	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
-	@$(ECHO)
-	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
-	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
-	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
-	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
-	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
-	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
-	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
-	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
-	@$(ECHO)
-	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
-	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
-	@$(ECHO)
-.PHONY: fpc_info
-fpc_info: $(INFORULES)
-.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
-	fpc_makefile_dirs
-fpc_makefile:
-	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
-fpc_makefile_sub1:
-ifdef TARGET_DIRS
-	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
-endif
-ifdef TARGET_EXAMPLEDIRS
-	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
-endif
-fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
-fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
-fpc_makefiles: fpc_makefile fpc_makefile_dirs
-all: fpc_all
-debug: fpc_debug
-smart: fpc_smart
-release: fpc_release
-units: fpc_units
-examples:
-shared: fpc_shared
-install: fpc_install
-sourceinstall: fpc_sourceinstall
-exampleinstall: fpc_exampleinstall
-distinstall: fpc_distinstall
-zipinstall: fpc_zipinstall
-zipsourceinstall: fpc_zipsourceinstall
-zipexampleinstall: fpc_zipexampleinstall
-zipdistinstall: fpc_zipdistinstall
-clean: fpc_clean
-distclean: fpc_distclean
-cleanall: fpc_cleanall
-info: fpc_info
-makefiles: fpc_makefiles
-.PHONY: all debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
-ifneq ($(wildcard fpcmake.loc),)
-include fpcmake.loc
-endif
-.NOTPARALLEL:

+ 0 - 25
packages/base/sqlite/Makefile.fpc

@@ -1,25 +0,0 @@
-#
-#   Makefile.fpc for sqlite implementation
-#
-
-[package]
-name=sqlite
-version=2.0.0
-
-[target]
-units=sqlite sqlite3 sqlite3dyn sqlitedb sqlite3db
-
-[require]
-
-[install]
-fpcpackage=y
-
-[default]
-fpcdir=../../..
-
-[shared]
-build=n
-
-[rules]
-.NOTPARALLEL:
-

+ 0 - 9
packages/base/sqlite/fpmake.inc

@@ -1,9 +0,0 @@
-    StartPackage('sqlite');
-    {$IF defined(ALLPACKAGES)}
-    Directory:='base/sqlite';
-    {$ELSEIF defined(BASEPACKAGES)}
-    Directory:='sqlite';
-    {$ENDIF}
-    OS:=[linux,win32,freebsd,darwin];
-    T:=Targets.AddUnit('sqlite');
-    EndPackage;

+ 0 - 17
packages/base/sqlite/fpmake.pp

@@ -1,17 +0,0 @@
-{$mode objfpc}{$H+}
-program fpmake;
-
-uses fpmkunit;
-
-Var
-  T : TTarget;
-
-begin
-  With Installer do 
-    begin
-    { Base packages }
-    {$i fpmake.inc}
-    Run;
-    end;
-end.
-

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

@@ -1,162 +0,0 @@
-{$mode objfpc}
-
-{$ifdef bsd}
-  {$linklib c}
-{$endif}
-
-unit sqlite;
-
-interface
-
-{
-  Automatically converted by H2Pas 0.99.15 from sqlite.h
-  The following command line parameters were used:
-    -S
-    -D
-    -p
-    -l
-    sqlite
-    sqlite.h
-}
-
-{$PACKRECORDS C}
-
-const
-  External_library='sqlite';
- 
-  SQLITE_ISO8859 = 1;//?
-  
-  //sqlite_exec and sqlite_step return values
-  SQLITE_OK         = 0;
-  SQLITE_ERROR      = 1;
-  SQLITE_INTERNAL   = 2;
-  SQLITE_PERM       = 3;
-  SQLITE_ABORT      = 4;
-  SQLITE_BUSY       = 5;
-  SQLITE_LOCKED     = 6;
-  SQLITE_NOMEM      = 7;
-  SQLITE_READONLY   = 8;
-  SQLITE_INTERRUPT  = 9;
-  SQLITE_IOERR      = 10;
-  SQLITE_CORRUPT    = 11;
-  SQLITE_NOTFOUND   = 12;
-  SQLITE_FULL       = 13;
-  SQLITE_CANTOPEN   = 14;
-  SQLITE_PROTOCOL   = 15;
-  SQLITE_EMPTY      = 16;
-  SQLITE_SCHEMA     = 17;
-  SQLITE_TOOBIG     = 18;
-  SQLITE_CONSTRAINT = 19;
-  SQLITE_MISMATCH   = 20;
-  SQLITE_MISUSE     = 21;
-  SQLITE_NOLFS      = 22;
-  SQLITE_AUTH       = 23;
-  SQLITE_FORMAT     = 24;
-  SQLITE_RANGE      = 25;
-  SQLITE_ROW        = 100;
-  SQLITE_DONE       = 101;
-
-  // values used in sqlite_set_authorizer to define what operations authorize
-  SQLITE_COPY                = 0;
-  SQLITE_CREATE_INDEX        = 1;
-  SQLITE_CREATE_TABLE        = 2;
-  SQLITE_CREATE_TEMP_INDEX   = 3;
-  SQLITE_CREATE_TEMP_TABLE   = 4;
-  SQLITE_CREATE_TEMP_TRIGGER = 5;
-  SQLITE_CREATE_TEMP_VIEW    = 6;
-  SQLITE_CREATE_TRIGGER      = 7;
-  SQLITE_CREATE_VIEW         = 8;
-  SQLITE_DELETE              = 9;
-  SQLITE_DROP_INDEX          = 10;
-  SQLITE_DROP_TABLE          = 11;
-  SQLITE_DROP_TEMP_INDEX     = 12;
-  SQLITE_DROP_TEMP_TABLE     = 13;
-  SQLITE_DROP_TEMP_TRIGGER   = 14;
-  SQLITE_DROP_TEMP_VIEW      = 15;
-  SQLITE_DROP_TRIGGER        = 16;
-  SQLITE_DROP_VIEW           = 17;
-  SQLITE_INSERT              = 18;
-  SQLITE_PRAGMA              = 19;
-  SQLITE_READ                = 20;
-  SQLITE_SELECT              = 21;
-  SQLITE_TRANSACTION         = 22;
-  SQLITE_UPDATE              =  23;
-  
-  //Return values of the authorizer function
-  SQLITE_DENY                = 1;
-  SQLITE_IGNORE              = 2;
-
-  SQLITE_NUMERIC = -1;
-  SQLITE_TEXT    = -2;
-  SQLITE_ARGS    = -3;
-
-Type
-  PPPchar   = ^ppchar;
-  Psqlite = Pointer;
-  Psqlite_vm = Pointer;
-  PPsqlite_vm = ^Psqlite_vm;
-  Psqlite_func = Pointer;
-
-  // Procedural types used in functions.
-
-  sqlite_callback = function (_para1:pointer; _para2:longint; _para3:PPchar; _para4:PPchar):longint;cdecl;
-  sqlite_trace_func = procedure (_para1:pointer; _para2:Pchar);cdecl;
-  sqlite_create_func = procedure (_para1:Psqlite_func; _para2:longint; _para3:PPchar);cdecl;
-  sqlite_handler = function (_para1:pointer; _para2:Pchar; _para3:longint):longint;cdecl;
-  sqlite_step_func = procedure (_para1:Psqlite_func; _para2:longint; _para3:PPchar);cdecl;
-  sqlite_finalize_func = procedure (_para1:Psqlite_func);cdecl;
-  sqlite_authorize_func = function (_para1:pointer; _para2:longint; _para3, _para4,_para5,_para6:Pchar):longint;cdecl;
-
-  function sqlite_create_function(_para1:Psqlite; zName:Pchar; nArg:longint; xFunc:sqlite_create_func; pUserData:pointer):longint;cdecl;external External_library name 'sqlite_create_function';
-  function sqlite_open(filename:Pchar; mode:longint; errmsg:PPchar):Psqlite;cdecl;external External_library name 'sqlite_open';
-  procedure sqlite_close(_para1:Psqlite);cdecl;external External_library name 'sqlite_close';
-  function sqlite_exec(_para1:Psqlite; sql:Pchar; _para3:sqlite_callback; _para4:pointer; errmsg:PPchar):longint;cdecl;external External_library name 'sqlite_exec';
-  function sqlite_last_insert_rowid(_para1:Psqlite):longint;cdecl;external External_library name 'sqlite_last_insert_rowid';
-  function sqlite_changes(_para1:Psqlite):longint;cdecl;external External_library name 'sqlite_changes';
-  function sqlite_error_string(_para1:longint):Pchar;cdecl;external External_library name 'sqlite_error_string';
-  procedure do_sqlite_interrupt(_para1:Psqlite);cdecl;external External_library name 'sqlite_interrupt';
-  function sqlite_complete(sql:Pchar):longint;cdecl;external External_library name 'sqlite_complete';
-  procedure sqlite_busy_handler(_para1:Psqlite; _para2:sqlite_handler; _para3:pointer);cdecl;external External_library name 'sqlite_busy_handler';
-  procedure sqlite_busy_timeout(_para1:Psqlite; ms:longint);cdecl;external External_library name 'sqlite_busy_timeout';
-  function sqlite_get_table(_para1:Psqlite; sql:Pchar; resultp:PPPchar; nrow:Plongint; ncolumn:Plongint;
-             errmsg:PPchar):longint;cdecl;external External_library name 'sqlite_get_table';
-  procedure sqlite_free_table(result:PPchar);cdecl;external External_library name 'sqlite_free_table';
-  function sqlite_exec_printf(_para1:Psqlite; sqlFormat:Pchar; _para3:sqlite_callback; _para4:pointer; errmsg:PPchar;
-             args:array of const):longint;cdecl;external External_library name 'sqlite_exec_printf';
-  function sqlite_exec_printf(_para1:Psqlite; sqlFormat:Pchar; _para3:sqlite_callback; _para4:pointer; errmsg:PPchar):longint;cdecl;varargs;external External_library name 'sqlite_exec_printf';
-  function sqlite_exec_vprintf(_para1:Psqlite; sqlFormat:Pchar; _para3:sqlite_callback; _para4:pointer; errmsg:PPchar;
-             ap:array of const):longint;cdecl;external External_library name 'sqlite_exec_vprintf';
-  function sqlite_get_table_printf(_para1:Psqlite; sqlFormat:Pchar; resultp:PPPchar; nrow:Plongint; ncolumn:Plongint;
-             errmsg:PPchar; args:array of const):longint;cdecl;external External_library name 'sqlite_get_table_printf';
-  function sqlite_get_table_printf(_para1:Psqlite; sqlFormat:Pchar; resultp:PPPchar; nrow:Plongint; ncolumn:Plongint;
-             errmsg:PPchar):longint;cdecl;varargs;external External_library name 'sqlite_get_table_printf';
-  function sqlite_get_table_vprintf(_para1:Psqlite; sqlFormat:Pchar; resultp:PPPchar; nrow:Plongint; ncolumn:Plongint;
-             errmsg:PPchar; ap:array of const):longint;cdecl;external External_library name 'sqlite_get_table_vprintf';
-  function sqlite_mprintf(_para1:Pchar; args:array of const):Pchar;cdecl;external External_library name 'sqlite_mprintf';
-  function sqlite_mprintf(_para1:Pchar):Pchar;cdecl;varargs;external External_library name 'sqlite_mprintf';
-  procedure sqlite_freemem(p:pointer);cdecl;external External_library name 'sqlite_freemem';
-  function sqlite_libversion:Pchar;cdecl;external External_library name 'sqlite_libversion';
-  function sqlite_libencoding:Pchar;cdecl;external External_library name 'sqlite_libencoding';
-  function sqlite_create_aggregate(_para1:Psqlite; zName:Pchar; nArg:longint; xStep:sqlite_step_func ; xFinalize:sqlite_finalize_func;
-             pUserData:pointer):longint;cdecl;external External_library name 'sqlite_create_aggregate';
-  function sqlite_function_type(db:Psqlite; zName:Pchar; datatype:longint):longint;cdecl;external External_library name 'sqlite_function_type';
-  function sqlite_set_result_string(_para1:Psqlite_func; _para2:Pchar; _para3:longint):Pchar;cdecl;external External_library name 'sqlite_set_result_string';
-  procedure sqlite_set_result_int(_para1:Psqlite_func; _para2:longint);cdecl;external External_library name 'sqlite_set_result_int';
-  procedure sqlite_set_result_double(_para1:Psqlite_func; _para2:double);cdecl;external External_library name 'sqlite_set_result_double';
-  procedure sqlite_set_result_error(_para1:Psqlite_func; _para2:Pchar; _para3:longint);cdecl;external External_library name 'sqlite_set_result_error';
-  function sqlite_user_data(_para1:Psqlite_func):pointer;cdecl;external External_library name 'sqlite_user_data';
-  function sqlite_aggregate_context(_para1:Psqlite_func; nBytes:longint):pointer;cdecl;external External_library name 'sqlite_aggregate_context';
-  function sqlite_aggregate_count(_para1:Psqlite_func):longint;cdecl;external External_library name 'sqlite_aggregate_count';
-  function sqlite_set_authorizer(_para1:Psqlite; xAuth:sqlite_authorize_func ; pUserData:pointer):longint;cdecl;external External_library name 'sqlite_set_authorizer';
-  function sqlite_trace(_para1:Psqlite; xTrace:sqlite_trace_func; _para3:pointer):pointer;cdecl;external External_library name 'sqlite_trace';
-  function sqlite_compile(db:Psqlite; zSql:Pchar; pzTail:PPchar; ppVm:PPsqlite_vm; pzErrmsg:PPchar):longint;cdecl;external External_library name 'sqlite_compile';
-  function sqlite_step(pVm:Psqlite_vm; pN:Plongint; pazValue:PPPchar; pazColName:PPPchar):longint;cdecl;external External_library name 'sqlite_step';
-  function sqlite_finalize(_para1:Psqlite_vm; pzErrMsg:PPchar):longint;cdecl;external External_library name 'sqlite_finalize';
-  
-  //Use functions instead of external variables to retrieve version and encoding info
-  function sqlite_version: PChar external External_library name 'sqlite_libversion';
-  function sqlite_encoding: PChar external External_library name 'sqlite_libencoding';
-  
-implementation
-
-end.

+ 0 - 576
packages/base/sqlite/sqlite3.inc

@@ -1,576 +0,0 @@
-{$mode objfpc}
-
-{$ifdef BSD}
-  {$linklib c}
-  {$linklib pthread}
-{$endif}
-
-interface
-
-{$ifdef LOAD_DYNAMICALLY}
-uses 
-  SysUtils, DynLibs;
-{$endif}
-
-{
-  Automatically converted by H2Pas 0.99.16 from sqlite3.h
-  The following command line parameters were used:
-    -D
-    -c
-    sqlite3.h
-
-  Manual corrections made by Luiz Américo - 2005
-}
-
-{$PACKRECORDS C}
-
-const
-{$IFDEF WINDOWS}
-  Sqlite3Lib = 'sqlite3.dll';
-{$else}
-  Sqlite3Lib = 'libsqlite3.so';
-{$endif}
-
-  SQLITE_INTEGER = 1;   
-  SQLITE_FLOAT = 2;   
-{ #define SQLITE_TEXT  3  // See below  }
-  SQLITE_BLOB = 4;   
-  SQLITE_NULL = 5;   
-  SQLITE_TEXT = 3;   
-  SQLITE3_TEXT = 3;   
-  SQLITE_UTF8 = 1;       
-  SQLITE_UTF16LE = 2;       
-  SQLITE_UTF16BE = 3;       
-{ Use native byte order  }
-  SQLITE_UTF16 = 4;       
-{ sqlite3_create_function only  }
-  SQLITE_ANY = 5;  
-   
-   //sqlite_exec return values
-  SQLITE_OK = 0;   
-  SQLITE_ERROR = 1;{ SQL error or missing database  }
-  SQLITE_INTERNAL = 2;{ An internal logic error in SQLite  }
-  SQLITE_PERM = 3;   { Access permission denied  }
-  SQLITE_ABORT = 4; { Callback routine requested an abort  }
-  SQLITE_BUSY = 5;  { The database file is locked  }
-  SQLITE_LOCKED = 6;{ A table in the database is locked  }
-  SQLITE_NOMEM = 7; { A malloc() failed  }
-  SQLITE_READONLY = 8;{ Attempt to write a readonly database  }
-  SQLITE_INTERRUPT = 9;{ Operation terminated by sqlite3_interrupt() }
-  SQLITE_IOERR = 10;   { Some kind of disk I/O error occurred  }
-  SQLITE_CORRUPT = 11;   { The database disk image is malformed  }
-  SQLITE_NOTFOUND = 12;   { (Internal Only) Table or record not found  }
-  SQLITE_FULL = 13;   { Insertion failed because database is full  }
-  SQLITE_CANTOPEN = 14;   { Unable to open the database file  }
-  SQLITE_PROTOCOL = 15;   { Database lock protocol error  }
-  SQLITE_EMPTY = 16;   { Database is empty  }
-  SQLITE_SCHEMA = 17;   { The database schema changed  }
-  SQLITE_TOOBIG = 18;   { Too much data for one row of a table  }
-  SQLITE_CONSTRAINT = 19;   { Abort due to contraint violation  }
-  SQLITE_MISMATCH = 20;   { Data type mismatch  }
-  SQLITE_MISUSE = 21;   { Library used incorrectly  }
-  SQLITE_NOLFS = 22;   { Uses OS features not supported on host  }
-  SQLITE_AUTH = 23;   { Authorization denied  }
-  SQLITE_FORMAT = 24;   { Auxiliary database format error  }
-  SQLITE_RANGE = 25;   { 2nd parameter to sqlite3_bind out of range  }
-  SQLITE_NOTADB = 26;   { File opened that is not a database file  }
-  SQLITE_ROW = 100;   { sqlite3_step() has another row ready  }
-  SQLITE_DONE = 101;   { sqlite3_step() has finished executing  }
-
-   SQLITE_COPY = 0;   
-   SQLITE_CREATE_INDEX = 1;   
-   SQLITE_CREATE_TABLE = 2;   
-   SQLITE_CREATE_TEMP_INDEX = 3;   
-   SQLITE_CREATE_TEMP_TABLE = 4;   
-   SQLITE_CREATE_TEMP_TRIGGER = 5;   
-   SQLITE_CREATE_TEMP_VIEW = 6;   
-   SQLITE_CREATE_TRIGGER = 7;   
-   SQLITE_CREATE_VIEW = 8;   
-   SQLITE_DELETE = 9;   
-   SQLITE_DROP_INDEX = 10;   
-   SQLITE_DROP_TABLE = 11;   
-   SQLITE_DROP_TEMP_INDEX = 12;   
-   SQLITE_DROP_TEMP_TABLE = 13;   
-   SQLITE_DROP_TEMP_TRIGGER = 14;   
-   SQLITE_DROP_TEMP_VIEW = 15;   
-   SQLITE_DROP_TRIGGER = 16;   
-   SQLITE_DROP_VIEW = 17;   
-   SQLITE_INSERT = 18;   
-   SQLITE_PRAGMA = 19;   
-   SQLITE_READ = 20;   
-   SQLITE_SELECT = 21;   
-   SQLITE_TRANSACTION = 22;   
-   SQLITE_UPDATE = 23;   
-   SQLITE_ATTACH = 24;   
-   SQLITE_DETACH = 25;   
-   SQLITE_ALTER_TABLE = 26;   
-   SQLITE_REINDEX = 27;   
-
-  SQLITE_DENY = 1;   
-  SQLITE_IGNORE = 2;   
-
-// Original from sqlite3.h: 
-//#define SQLITE_STATIC      ((void(*)(void *))0)
-//#define SQLITE_TRANSIENT   ((void(*)(void *))-1)
-Const
-  SQLITE_STATIC    =  0;
-  SQLITE_TRANSIENT =  -1;
-
-type
-  sqlite_int64 = int64;
-  sqlite_uint64 = qword;
-  PPPChar = ^PPChar;
-  Psqlite3  = Pointer;
-  PPSqlite3 = ^PSqlite3;
-  Psqlite3_context  = Pointer;
-  Psqlite3_stmt  = Pointer;
-  PPsqlite3_stmt = ^Psqlite3_stmt;
-  Psqlite3_value  = Pointer;
-  PPsqlite3_value  = ^Psqlite3_value;
-
-//Callback function types
-//Notice that most functions were named using as prefix the function name that uses them,
-//rather than describing their functions  
-
-  sqlite3_callback = function (_para1:pointer; _para2:longint; _para3:PPchar; _para4:PPchar):longint;cdecl;
-  busy_handler_func = function (_para1:pointer; _para2:longint):longint;cdecl;
-  sqlite3_set_authorizer_func = function (_para1:pointer; _para2:longint; _para3:Pchar; _para4:Pchar; _para5:Pchar; _para6:Pchar):longint;cdecl;
-  sqlite3_trace_func = procedure (_para1:pointer; _para2:Pchar);cdecl;
-  sqlite3_progress_handler_func = function (_para1:pointer):longint;cdecl;
-  sqlite3_commit_hook_func = function (_para1:pointer):longint;cdecl;
-  bind_destructor_func = procedure (_para1:pointer);cdecl;
-  create_function_step_func = procedure (_para1:Psqlite3_context; _para2:longint; _para3:PPsqlite3_value);cdecl;
-  create_function_func_func = procedure (_para1:Psqlite3_context; _para2:longint; _para3:PPsqlite3_value);cdecl;
-  create_function_final_func = procedure (_para1:Psqlite3_context);cdecl;
-  sqlite3_set_auxdata_func = procedure (_para1:pointer);cdecl;
-  sqlite3_result_func = procedure (_para1:pointer);cdecl;
-  sqlite3_create_collation_func = function (_para1:pointer; _para2:longint; _para3:pointer; _para4:longint; _para5:pointer):longint;cdecl;
-  sqlite3_collation_needed_func = procedure (_para1:pointer; _para2:Psqlite3; eTextRep:longint; _para4:Pchar);cdecl;
-
-{$ifndef win32}
-var
-  //This is not working under windows. Any clues?
-  sqlite3_temp_directory : Pchar;cvar; external;
-{$endif}
-
-{$IFNDEF LOAD_DYNAMICALLY}
-
-function sqlite3_close(_para1:Psqlite3):longint;cdecl; external Sqlite3Lib name 'sqlite3_close';
-function sqlite3_exec(_para1:Psqlite3; sql:Pchar; _para3:sqlite3_callback; _para4:pointer; errmsg:PPchar):longint;cdecl; external Sqlite3Lib name 'sqlite3_exec';
-function sqlite3_last_insert_rowid(_para1:Psqlite3):sqlite_int64;cdecl; external Sqlite3Lib name 'sqlite3_last_insert_rowid';
-function sqlite3_changes(_para1:Psqlite3):longint;cdecl; external Sqlite3Lib name 'sqlite3_changes';
-function sqlite3_total_changes(_para1:Psqlite3):longint;cdecl; external Sqlite3Lib name 'sqlite3_total_changes';
-procedure sqlite3_interrupt(_para1:Psqlite3);cdecl; external Sqlite3Lib name 'sqlite3_interrupt';
-function sqlite3_complete(sql:Pchar):longint;cdecl; external Sqlite3Lib name 'sqlite3_complete';
-function sqlite3_complete16(sql:pointer):longint;cdecl; external Sqlite3Lib name 'sqlite3_complete16';
-function sqlite3_busy_handler(_para1:Psqlite3; _para2:busy_handler_func; _para3:pointer):longint;cdecl; external Sqlite3Lib name 'sqlite3_busy_handler';
-function sqlite3_busy_timeout(_para1:Psqlite3; ms:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_busy_timeout';
-function sqlite3_get_table(_para1:Psqlite3; sql:Pchar; resultp:PPPchar; nrow:Plongint; ncolumn:Plongint; errmsg:PPchar):longint;cdecl; external Sqlite3Lib name 'sqlite3_get_table';
-procedure sqlite3_free_table(result:PPchar);cdecl; external Sqlite3Lib name 'sqlite3_free_table';
-// Todo: see how translate sqlite3_mprintf, sqlite3_vmprintf, sqlite3_snprintf
-// function sqlite3_mprintf(_para1:Pchar; args:array of const):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_mprintf';
-function sqlite3_mprintf(_para1:Pchar):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_mprintf';
-//function sqlite3_vmprintf(_para1:Pchar; _para2:va_list):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_vmprintf';
-procedure sqlite3_free(z:Pchar);cdecl; external Sqlite3Lib name 'sqlite3_free';
-//function sqlite3_snprintf(_para1:longint; _para2:Pchar; _para3:Pchar; args:array of const):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_snprintf';
-function sqlite3_snprintf(_para1:longint; _para2:Pchar; _para3:Pchar):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_snprintf';
-function sqlite3_set_authorizer(_para1:Psqlite3; xAuth:sqlite3_set_authorizer_func; pUserData:pointer):longint;cdecl; external Sqlite3Lib name 'sqlite3_set_authorizer';
-function sqlite3_trace(_para1:Psqlite3; xTrace:sqlite3_trace_func; _para3:pointer):pointer;cdecl; external Sqlite3Lib name 'sqlite3_trace';
-procedure sqlite3_progress_handler(_para1:Psqlite3; _para2:longint; _para3:sqlite3_progress_handler_func; _para4:pointer);cdecl; external Sqlite3Lib name 'sqlite3_progress_handler';
-function sqlite3_commit_hook(_para1:Psqlite3; _para2:sqlite3_commit_hook_func; _para3:pointer):pointer;cdecl; external Sqlite3Lib name 'sqlite3_commit_hook';
-function sqlite3_open(filename:Pchar; ppDb:PPsqlite3):longint;cdecl; external Sqlite3Lib name 'sqlite3_open';
-function sqlite3_open16(filename:pointer; ppDb:PPsqlite3):longint;cdecl; external Sqlite3Lib name 'sqlite3_open16';
-function sqlite3_errcode(db:Psqlite3):longint;cdecl; external Sqlite3Lib name 'sqlite3_errcode';
-function sqlite3_errmsg(_para1:Psqlite3):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_errmsg';
-function sqlite3_errmsg16(_para1:Psqlite3):pointer;cdecl; external Sqlite3Lib name 'sqlite3_errmsg16';
-function sqlite3_prepare(db:Psqlite3; zSql:Pchar; nBytes:longint; ppStmt:PPsqlite3_stmt; pzTail:PPchar):longint;cdecl; external Sqlite3Lib name 'sqlite3_prepare';
-function sqlite3_prepare16(db:Psqlite3; zSql:pointer; nBytes:longint; ppStmt:PPsqlite3_stmt; pzTail:Ppointer):longint;cdecl; external Sqlite3Lib name 'sqlite3_prepare16';
-function sqlite3_bind_blob(_para1:Psqlite3_stmt; _para2:longint; _para3:pointer; n:longint; _para5:bind_destructor_func):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_blob';
-function sqlite3_bind_double(_para1:Psqlite3_stmt; _para2:longint; _para3:double):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_double';
-function sqlite3_bind_int(_para1:Psqlite3_stmt; _para2:longint; _para3:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_int';
-function sqlite3_bind_int64(_para1:Psqlite3_stmt; _para2:longint; _para3:sqlite_int64):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_int64';
-function sqlite3_bind_null(_para1:Psqlite3_stmt; _para2:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_null';
-function sqlite3_bind_text(_para1:Psqlite3_stmt; _para2:longint; _para3:Pchar; n:longint; _para5:bind_destructor_func):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_text';
-function sqlite3_bind_text16(_para1:Psqlite3_stmt; _para2:longint; _para3:pointer; _para4:longint; _para5:bind_destructor_func):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_text16';
-//function sqlite3_bind_value(_para1:Psqlite3_stmt; _para2:longint; _para3:Psqlite3_value):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_value';
-//These overloaded functions were introduced to allow the use of SQLITE_STATIC and SQLITE_TRANSIENT
-//It's the c world man ;-)
-function sqlite3_bind_blob(_para1:Psqlite3_stmt; _para2:longint; _para3:pointer; n:longint; _para5:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_blob';
-function sqlite3_bind_text(_para1:Psqlite3_stmt; _para2:longint; _para3:Pchar; n:longint; _para5:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_text';
-function sqlite3_bind_text16(_para1:Psqlite3_stmt; _para2:longint; _para3:pointer; _para4:longint; _para5:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_text16';
-
-function sqlite3_bind_parameter_count(_para1:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_parameter_count';
-function sqlite3_bind_parameter_name(_para1:Psqlite3_stmt; _para2:longint):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_bind_parameter_name';
-function sqlite3_bind_parameter_index(_para1:Psqlite3_stmt; zName:Pchar):longint;cdecl; external Sqlite3Lib name 'sqlite3_bind_parameter_index';
-//function sqlite3_clear_bindings(_para1:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_clear_bindings';
-function sqlite3_column_count(pStmt:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_column_count';
-function sqlite3_column_name(_para1:Psqlite3_stmt; _para2:longint):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_column_name';
-function sqlite3_column_name16(_para1:Psqlite3_stmt; _para2:longint):pointer;cdecl; external Sqlite3Lib name 'sqlite3_column_name16';
-function sqlite3_column_decltype(_para1:Psqlite3_stmt; i:longint):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_column_decltype';
-function sqlite3_column_decltype16(_para1:Psqlite3_stmt; _para2:longint):pointer;cdecl; external Sqlite3Lib name 'sqlite3_column_decltype16';
-function sqlite3_step(_para1:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_step';
-function sqlite3_data_count(pStmt:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_data_count';
-function sqlite3_column_blob(_para1:Psqlite3_stmt; iCol:longint):pointer;cdecl; external Sqlite3Lib name 'sqlite3_column_blob';
-function sqlite3_column_bytes(_para1:Psqlite3_stmt; iCol:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_column_bytes';
-function sqlite3_column_bytes16(_para1:Psqlite3_stmt; iCol:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_column_bytes16';
-function sqlite3_column_double(_para1:Psqlite3_stmt; iCol:longint):double;cdecl; external Sqlite3Lib name 'sqlite3_column_double';
-function sqlite3_column_int(_para1:Psqlite3_stmt; iCol:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_column_int';
-function sqlite3_column_int64(_para1:Psqlite3_stmt; iCol:longint):sqlite_int64;cdecl; external Sqlite3Lib name 'sqlite3_column_int64';
-function sqlite3_column_text(_para1:Psqlite3_stmt; iCol:longint):PChar;cdecl; external Sqlite3Lib name 'sqlite3_column_text';
-function sqlite3_column_text16(_para1:Psqlite3_stmt; iCol:longint):pointer;cdecl; external Sqlite3Lib name 'sqlite3_column_text16';
-function sqlite3_column_type(_para1:Psqlite3_stmt; iCol:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_column_type';
-function sqlite3_finalize(pStmt:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_finalize';
-function sqlite3_reset(pStmt:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_reset';
-function sqlite3_create_function(_para1:Psqlite3; zFunctionName:Pchar; nArg:longint; eTextRep:longint; _para5:pointer;        xFunc:create_function_func_func; xStep:create_function_step_func; xFinal:create_function_final_func):longint;cdecl; external Sqlite3Lib name 'sqlite3_create_function';
-function sqlite3_create_function16(_para1:Psqlite3; zFunctionName:pointer; nArg:longint; eTextRep:longint; _para5:pointer;            xFunc:create_function_func_func; xStep:create_function_step_func; xFinal:create_function_final_func):longint;cdecl; external Sqlite3Lib name 'sqlite3_create_function16';
-function sqlite3_aggregate_count(_para1:Psqlite3_context):longint;cdecl; external Sqlite3Lib name 'sqlite3_aggregate_count';
-function sqlite3_value_blob(_para1:Psqlite3_value):pointer;cdecl; external Sqlite3Lib name 'sqlite3_value_blob';
-function sqlite3_value_bytes(_para1:Psqlite3_value):longint;cdecl; external Sqlite3Lib name 'sqlite3_value_bytes';
-function sqlite3_value_bytes16(_para1:Psqlite3_value):longint;cdecl; external Sqlite3Lib name 'sqlite3_value_bytes16';
-function sqlite3_value_double(_para1:Psqlite3_value):double;cdecl; external Sqlite3Lib name 'sqlite3_value_double';
-function sqlite3_value_int(_para1:Psqlite3_value):longint;cdecl; external Sqlite3Lib name 'sqlite3_value_int';
-function sqlite3_value_int64(_para1:Psqlite3_value):sqlite_int64;cdecl; external Sqlite3Lib name 'sqlite3_value_int64';
-function sqlite3_value_text(_para1:Psqlite3_value):PChar;cdecl; external Sqlite3Lib name 'sqlite3_value_text';
-function sqlite3_value_text16(_para1:Psqlite3_value):pointer;cdecl; external Sqlite3Lib name 'sqlite3_value_text16';
-function sqlite3_value_text16le(_para1:Psqlite3_value):pointer;cdecl; external Sqlite3Lib name 'sqlite3_value_text16le';
-function sqlite3_value_text16be(_para1:Psqlite3_value):pointer;cdecl; external Sqlite3Lib name 'sqlite3_value_text16be';
-function sqlite3_value_type(_para1:Psqlite3_value):longint;cdecl; external Sqlite3Lib name 'sqlite3_value_type';
-function sqlite3_aggregate_context(_para1:Psqlite3_context; nBytes:longint):pointer;cdecl; external Sqlite3Lib name 'sqlite3_aggregate_context';
-function sqlite3_user_data(_para1:Psqlite3_context):pointer;cdecl; external Sqlite3Lib name 'sqlite3_user_data';
-function sqlite3_get_auxdata(_para1:Psqlite3_context; _para2:longint):pointer;cdecl; external Sqlite3Lib name 'sqlite3_get_auxdata';
-procedure sqlite3_set_auxdata(_para1:Psqlite3_context; _para2:longint; _para3:pointer; _para4:sqlite3_set_auxdata_func);cdecl; external Sqlite3Lib name 'sqlite3_set_auxdata';
-procedure sqlite3_result_blob(_para1:Psqlite3_context; _para2:pointer; _para3:longint; _para4:sqlite3_result_func);cdecl; external Sqlite3Lib name 'sqlite3_result_blob';
-procedure sqlite3_result_double(_para1:Psqlite3_context; _para2:double);cdecl; external Sqlite3Lib name 'sqlite3_result_double';
-procedure sqlite3_result_error(_para1:Psqlite3_context; _para2:Pchar; _para3:longint);cdecl; external Sqlite3Lib name 'sqlite3_result_error';
-procedure sqlite3_result_error16(_para1:Psqlite3_context; _para2:pointer; _para3:longint);cdecl; external Sqlite3Lib name 'sqlite3_result_error16';
-procedure sqlite3_result_int(_para1:Psqlite3_context; _para2:longint);cdecl; external Sqlite3Lib name 'sqlite3_result_int';
-procedure sqlite3_result_int64(_para1:Psqlite3_context; _para2:sqlite_int64);cdecl; external Sqlite3Lib name 'sqlite3_result_int64';
-procedure sqlite3_result_null(_para1:Psqlite3_context);cdecl; external Sqlite3Lib name 'sqlite3_result_null';
-procedure sqlite3_result_text(_para1:Psqlite3_context; _para2:Pchar; _para3:longint; _para4:sqlite3_result_func);cdecl; external Sqlite3Lib name 'sqlite3_result_text';
-procedure sqlite3_result_text16(_para1:Psqlite3_context; _para2:pointer; _para3:longint; _para4:sqlite3_result_func);cdecl; external Sqlite3Lib name 'sqlite3_result_text16';
-procedure sqlite3_result_text16le(_para1:Psqlite3_context; _para2:pointer; _para3:longint; _para4:sqlite3_result_func);cdecl; external Sqlite3Lib name 'sqlite3_result_text16le';
-procedure sqlite3_result_text16be(_para1:Psqlite3_context; _para2:pointer; _para3:longint; _para4:sqlite3_result_func);cdecl; external Sqlite3Lib name 'sqlite3_result_text16be';
-procedure sqlite3_result_value(_para1:Psqlite3_context; _para2:Psqlite3_value);cdecl; external Sqlite3Lib name 'sqlite3_result_value';     
-function sqlite3_create_collation(_para1:Psqlite3; zName:Pchar; eTextRep:longint; _para4:pointer; xCompare:sqlite3_create_collation_func):longint;cdecl; external Sqlite3Lib name 'sqlite3_create_collation';
-function sqlite3_create_collation16(_para1:Psqlite3; zName:Pchar; eTextRep:longint; _para4:pointer; xCompare:sqlite3_create_collation_func):longint;cdecl; external Sqlite3Lib name 'sqlite3_create_collation16';
-function sqlite3_collation_needed(_para1:Psqlite3; _para2:pointer; _para3:sqlite3_collation_needed_func):longint;cdecl; external Sqlite3Lib name 'sqlite3_collation_needed';
-function sqlite3_collation_needed16(_para1:Psqlite3; _para2:pointer; _para3:sqlite3_collation_needed_func):longint;cdecl; external Sqlite3Lib name 'sqlite3_collation_needed16';
-function sqlite3_libversion:PChar;cdecl; external Sqlite3Lib name 'sqlite3_libversion';
-//Alias for allowing better code portability (win32 is not working with external variables) 
-function sqlite3_version:PChar;cdecl; external Sqlite3Lib name 'sqlite3_libversion';
-
-// Not published functions
-function sqlite3_libversion_number:longint;cdecl; external Sqlite3Lib name 'sqlite3_libversion_number';
-//function sqlite3_key(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_key';
-//function sqlite3_rekey(db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_rekey';
-//function sqlite3_sleep(_para1:longint):longint;cdecl; external Sqlite3Lib name 'sqlite3_sleep';
-//function sqlite3_expired(_para1:Psqlite3_stmt):longint;cdecl; external Sqlite3Lib name 'sqlite3_expired';
-//function sqlite3_global_recover:longint;cdecl; external Sqlite3Lib name 'sqlite3_global_recover';
-
-{$ELSE LOAD_DYNAMICALLY}
-
-Var
-  sqlite3_close : function (_para1:Psqlite3):longint;cdecl;
-  sqlite3_exec : function (_para1:Psqlite3; sql:Pchar; _para3:sqlite3_callback; _para4:pointer; errmsg:PPchar):longint;cdecl;
-  sqlite3_last_insert_rowid : function (_para1:Psqlite3):sqlite_int64;cdecl;
-  sqlite3_changes : function (_para1:Psqlite3):longint;cdecl;
-  sqlite3_total_changes : function (_para1:Psqlite3):longint;cdecl;
-  sqlite3_interrupt : procedure (_para1:Psqlite3);cdecl;
-  sqlite3_complete : function (sql:Pchar):longint;cdecl;
-  sqlite3_complete16 : function (sql:pointer):longint;cdecl;
-  sqlite3_busy_handler : function (_para1:Psqlite3; _para2:busy_handler_func; _para3:pointer):longint;cdecl;
-  sqlite3_busy_timeout : function (_para1:Psqlite3; ms:longint):longint;cdecl;
-  sqlite3_get_table : function (_para1:Psqlite3; sql:Pchar; resultp:PPPchar; nrow:Plongint; ncolumn:Plongint; errmsg:PPchar):longint;cdecl;
-  sqlite3_free_table : procedure (result:PPchar);cdecl;
-// Todo: see how translate sqlite3_mprintf, sqlite3_vmprintf, sqlite3_snprintf
-//   sqlite3_mprintf : function (_para1:Pchar; args:array of const):Pchar;cdecl;
-  sqlite3_mprintf : function (_para1:Pchar):Pchar;cdecl;
-//  sqlite3_vmprintf : function (_para1:Pchar; _para2:va_list):Pchar;cdecl;
-  sqlite3_free : procedure (z:Pchar);cdecl;
-//  sqlite3_snprintf : function (_para1:longint; _para2:Pchar; _para3:Pchar; args:array of const):Pchar;cdecl;
-  sqlite3_snprintf : function (_para1:longint; _para2:Pchar; _para3:Pchar):Pchar;cdecl;
-  sqlite3_set_authorizer : function (_para1:Psqlite3; xAuth:sqlite3_set_authorizer_func; pUserData:pointer):longint;cdecl;
-  sqlite3_trace : function (_para1:Psqlite3; xTrace:sqlite3_trace_func; _para3:pointer):pointer;cdecl;
-  sqlite3_progress_handler : procedure (_para1:Psqlite3; _para2:longint; _para3:sqlite3_progress_handler_func; _para4:pointer);cdecl;
-  sqlite3_commit_hook : function (_para1:Psqlite3; _para2:sqlite3_commit_hook_func; _para3:pointer):pointer;cdecl;
-  sqlite3_open : function (filename:Pchar; ppDb:PPsqlite3):longint;cdecl;
-  sqlite3_open16 : function (filename:pointer; ppDb:PPsqlite3):longint;cdecl;
-  sqlite3_errcode : function (db:Psqlite3):longint;cdecl;
-  sqlite3_errmsg : function (_para1:Psqlite3):Pchar;cdecl;
-  sqlite3_errmsg16 : function (_para1:Psqlite3):pointer;cdecl;
-  sqlite3_prepare : function (db:Psqlite3; zSql:Pchar; nBytes:longint; ppStmt:PPsqlite3_stmt; pzTail:PPchar):longint;cdecl;
-  sqlite3_prepare16 : function (db:Psqlite3; zSql:pointer; nBytes:longint; ppStmt:PPsqlite3_stmt; pzTail:Ppointer):longint;cdecl;
-  sqlite3_bind_blob : function (_para1:Psqlite3_stmt; _para2:longint; _para3:pointer; n:longint; _para5:bind_destructor_func):longint;cdecl;
-  sqlite3_bind_double : function (_para1:Psqlite3_stmt; _para2:longint; _para3:double):longint;cdecl;
-  sqlite3_bind_int : function (_para1:Psqlite3_stmt; _para2:longint; _para3:longint):longint;cdecl;
-  sqlite3_bind_int64 : function (_para1:Psqlite3_stmt; _para2:longint; _para3:sqlite_int64):longint;cdecl;
-  sqlite3_bind_null : function (_para1:Psqlite3_stmt; _para2:longint):longint;cdecl;
-  sqlite3_bind_text : function (_para1:Psqlite3_stmt; _para2:longint; _para3:Pchar; n:longint; _para5:bind_destructor_func):longint;cdecl;
-  sqlite3_bind_text16 : function (_para1:Psqlite3_stmt; _para2:longint; _para3:pointer; _para4:longint; _para5:bind_destructor_func):longint;cdecl;
-//  sqlite3_bind_value : function (_para1:Psqlite3_stmt; _para2:longint; _para3:Psqlite3_value):longint;cdecl;
-//These overloaded functions were introduced to allow the use of SQLITE_STATIC and SQLITE_TRANSIENT
-//It's the c world man ;-)
-  sqlite3_bind_blob1 : function (_para1:Psqlite3_stmt; _para2:longint; _para3:pointer; n:longint; _para5:longint):longint;cdecl;
-  sqlite3_bind_text1 : function (_para1:Psqlite3_stmt; _para2:longint; _para3:Pchar; n:longint; _para5:longint):longint;cdecl;
-  sqlite3_bind_text161 : function (_para1:Psqlite3_stmt; _para2:longint; _para3:pointer; _para4:longint; _para5:longint):longint;cdecl;
-
-  sqlite3_bind_parameter_count : function (_para1:Psqlite3_stmt):longint;cdecl;
-  sqlite3_bind_parameter_name : function (_para1:Psqlite3_stmt; _para2:longint):Pchar;cdecl;
-  sqlite3_bind_parameter_index : function (_para1:Psqlite3_stmt; zName:Pchar):longint;cdecl;
-//  sqlite3_clear_bindings : function (_para1:Psqlite3_stmt):longint;cdecl;
-  sqlite3_column_count : function (pStmt:Psqlite3_stmt):longint;cdecl;
-  sqlite3_column_name : function (_para1:Psqlite3_stmt; _para2:longint):Pchar;cdecl;
-  sqlite3_column_name16 : function (_para1:Psqlite3_stmt; _para2:longint):pointer;cdecl;
-  sqlite3_column_decltype : function (_para1:Psqlite3_stmt; i:longint):Pchar;cdecl;
-  sqlite3_column_decltype16 : function (_para1:Psqlite3_stmt; _para2:longint):pointer;cdecl;
-  sqlite3_step : function (_para1:Psqlite3_stmt):longint;cdecl;
-  sqlite3_data_count : function (pStmt:Psqlite3_stmt):longint;cdecl;
-  sqlite3_column_blob : function (_para1:Psqlite3_stmt; iCol:longint):pointer;cdecl;
-  sqlite3_column_bytes : function (_para1:Psqlite3_stmt; iCol:longint):longint;cdecl;
-  sqlite3_column_bytes16 : function (_para1:Psqlite3_stmt; iCol:longint):longint;cdecl;
-  sqlite3_column_double : function (_para1:Psqlite3_stmt; iCol:longint):double;cdecl;
-  sqlite3_column_int : function (_para1:Psqlite3_stmt; iCol:longint):longint;cdecl;
-  sqlite3_column_int64 : function (_para1:Psqlite3_stmt; iCol:longint):sqlite_int64;cdecl;
-  sqlite3_column_text : function (_para1:Psqlite3_stmt; iCol:longint):PChar;cdecl;
-  sqlite3_column_text16 : function (_para1:Psqlite3_stmt; iCol:longint):pointer;cdecl;
-  sqlite3_column_type : function (_para1:Psqlite3_stmt; iCol:longint):longint;cdecl;
-  sqlite3_finalize : function (pStmt:Psqlite3_stmt):longint;cdecl;
-  sqlite3_reset : function (pStmt:Psqlite3_stmt):longint;cdecl;
-  sqlite3_create_function : function (_para1:Psqlite3; zFunctionName:Pchar; nArg:longint; eTextRep:longint; _para5:pointer;        xFunc:create_function_func_func; xStep:create_function_step_func; xFinal:create_function_final_func):longint;cdecl;
-  sqlite3_create_function16 : function (_para1:Psqlite3; zFunctionName:pointer; nArg:longint; eTextRep:longint; _para5:pointer;            xFunc:create_function_func_func; xStep:create_function_step_func; xFinal:create_function_final_func):longint;cdecl;
-  sqlite3_aggregate_count : function (_para1:Psqlite3_context):longint;cdecl;
-  sqlite3_value_blob : function (_para1:Psqlite3_value):pointer;cdecl;
-  sqlite3_value_bytes : function (_para1:Psqlite3_value):longint;cdecl;
-  sqlite3_value_bytes16 : function (_para1:Psqlite3_value):longint;cdecl;
-  sqlite3_value_double : function (_para1:Psqlite3_value):double;cdecl;
-  sqlite3_value_int : function (_para1:Psqlite3_value):longint;cdecl;
-  sqlite3_value_int64 : function (_para1:Psqlite3_value):sqlite_int64;cdecl;
-  sqlite3_value_text : function (_para1:Psqlite3_value):PChar;cdecl;
-  sqlite3_value_text16 : function (_para1:Psqlite3_value):pointer;cdecl;
-  sqlite3_value_text16le : function (_para1:Psqlite3_value):pointer;cdecl;
-  sqlite3_value_text16be : function (_para1:Psqlite3_value):pointer;cdecl;
-  sqlite3_value_type : function (_para1:Psqlite3_value):longint;cdecl;
-  sqlite3_aggregate_context : function (_para1:Psqlite3_context; nBytes:longint):pointer;cdecl;
-  sqlite3_user_data : function (_para1:Psqlite3_context):pointer;cdecl;
-  sqlite3_get_auxdata : function (_para1:Psqlite3_context; _para2:longint):pointer;cdecl;
-  sqlite3_set_auxdata : procedure (_para1:Psqlite3_context; _para2:longint; _para3:pointer; _para4:sqlite3_set_auxdata_func);cdecl;
-  sqlite3_result_blob : procedure (_para1:Psqlite3_context; _para2:pointer; _para3:longint; _para4:sqlite3_result_func);cdecl;
-  sqlite3_result_double : procedure (_para1:Psqlite3_context; _para2:double);cdecl;
-  sqlite3_result_error : procedure (_para1:Psqlite3_context; _para2:Pchar; _para3:longint);cdecl;
-  sqlite3_result_error16 : procedure (_para1:Psqlite3_context; _para2:pointer; _para3:longint);cdecl;
-  sqlite3_result_int : procedure (_para1:Psqlite3_context; _para2:longint);cdecl;
-  sqlite3_result_int64 : procedure (_para1:Psqlite3_context; _para2:sqlite_int64);cdecl;
-  sqlite3_result_null : procedure (_para1:Psqlite3_context);cdecl;
-  sqlite3_result_text : procedure (_para1:Psqlite3_context; _para2:Pchar; _para3:longint; _para4:sqlite3_result_func);cdecl;
-  sqlite3_result_text16 : procedure (_para1:Psqlite3_context; _para2:pointer; _para3:longint; _para4:sqlite3_result_func);cdecl;
-  sqlite3_result_text16le : procedure (_para1:Psqlite3_context; _para2:pointer; _para3:longint; _para4:sqlite3_result_func);cdecl;
-  sqlite3_result_text16be : procedure (_para1:Psqlite3_context; _para2:pointer; _para3:longint; _para4:sqlite3_result_func);cdecl;
-  sqlite3_result_value : procedure (_para1:Psqlite3_context; _para2:Psqlite3_value);cdecl;     
-  sqlite3_create_collation : function (_para1:Psqlite3; zName:Pchar; eTextRep:longint; _para4:pointer; xCompare:sqlite3_create_collation_func):longint;cdecl;
-  sqlite3_create_collation16 : function (_para1:Psqlite3; zName:Pchar; eTextRep:longint; _para4:pointer; xCompare:sqlite3_create_collation_func):longint;cdecl;
-  sqlite3_collation_needed : function (_para1:Psqlite3; _para2:pointer; _para3:sqlite3_collation_needed_func):longint;cdecl;
-  sqlite3_collation_needed16 : function (_para1:Psqlite3; _para2:pointer; _para3:sqlite3_collation_needed_func):longint;cdecl;
-  sqlite3_libversion: function : PChar;cdecl;
-//Alias for allowing better code portability (win32 is not working with external variables) 
-  sqlite3_version: function: PChar;cdecl;
-
-// Not published functions
-  sqlite3_libversion_number : Function :longint;cdecl;
-//  sqlite3_key : function (db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl;
-//  sqlite3_rekey : function (db:Psqlite3; pKey:pointer; nKey:longint):longint;cdecl;
-//  sqlite3_sleep : function (_para1:longint):longint;cdecl;
-//  sqlite3_expired : function (_para1:Psqlite3_stmt):longint;cdecl;
-//function sqlite3_global_recover:longint;cdecl;
-
-Procedure InitialiseSQLite;
-Procedure InitialiseSQLite(LibraryName : String);
-Procedure ReleaseSQLite;
-
-var 
-  SQLiteLibraryHandle : TLibHandle;
-  DefaultLibrary : String = Sqlite3Lib;
-
-{$ENDIF LOAD_DYNAMICALLY}
-
-implementation
-
-{$IFDEF LOAD_DYNAMICALLY}
-
-ResourceString
-  SErrLoadFailed     = 'Can not load SQLite client library "%s". Check your installation.';
-  SErrAlreadyLoaded  = 'SQLIte interface already initialized from library %s.';
-
-Procedure LoadAddresses(LibHandle : TLibHandle);
-
-begin
-  pointer(sqlite3_close) := GetProcedureAddress(LibHandle,'sqlite3_close');
-  pointer(sqlite3_exec) := GetProcedureAddress(LibHandle,'sqlite3_exec');
-  pointer(sqlite3_last_insert_rowid) := GetProcedureAddress(LibHandle,'sqlite3_last_insert_rowid');
-  pointer(sqlite3_changes) := GetProcedureAddress(LibHandle,'sqlite3_changes');
-  pointer(sqlite3_total_changes) := GetProcedureAddress(LibHandle,'sqlite3_total_changes');
-  pointer(sqlite3_interrupt) := GetProcedureAddress(LibHandle,'sqlite3_interrupt');
-  pointer(sqlite3_complete) := GetProcedureAddress(LibHandle,'sqlite3_complete');
-  pointer(sqlite3_complete16) := GetProcedureAddress(LibHandle,'sqlite3_complete16');
-  pointer(sqlite3_busy_handler) := GetProcedureAddress(LibHandle,'sqlite3_busy_handler');
-  pointer(sqlite3_busy_timeout) := GetProcedureAddress(LibHandle,'sqlite3_busy_timeout');
-  pointer(sqlite3_get_table) := GetProcedureAddress(LibHandle,'sqlite3_get_table');
-  pointer(sqlite3_free_table) := GetProcedureAddress(LibHandle,'sqlite3_free_table');
-// Todo: see how translate sqlite3_mprintf, sqlite3_vmprintf, sqlite3_snprintf
-//   pointer(sqlite3_mprintf) := GetProcedureAddress(LibHandle,'sqlite3_mprintf');
-  pointer(sqlite3_mprintf) := GetProcedureAddress(LibHandle,'sqlite3_mprintf');
-//  pointer(sqlite3_vmprintf) := GetProcedureAddress(LibHandle,'sqlite3_vmprintf');
-  pointer(sqlite3_free) := GetProcedureAddress(LibHandle,'sqlite3_free');
-//  pointer(sqlite3_snprintf) := GetProcedureAddress(LibHandle,'sqlite3_snprintf');
-  pointer(sqlite3_snprintf) := GetProcedureAddress(LibHandle,'sqlite3_snprintf');
-  pointer(sqlite3_set_authorizer) := GetProcedureAddress(LibHandle,'sqlite3_set_authorizer');
-  pointer(sqlite3_trace) := GetProcedureAddress(LibHandle,'sqlite3_trace');
-  pointer(sqlite3_progress_handler) := GetProcedureAddress(LibHandle,'sqlite3_progress_handler');
-  pointer(sqlite3_commit_hook) := GetProcedureAddress(LibHandle,'sqlite3_commit_hook');
-  pointer(sqlite3_open) := GetProcedureAddress(LibHandle,'sqlite3_open');
-  pointer(sqlite3_open16) := GetProcedureAddress(LibHandle,'sqlite3_open16');
-  pointer(sqlite3_errcode) := GetProcedureAddress(LibHandle,'sqlite3_errcode');
-  pointer(sqlite3_errmsg) := GetProcedureAddress(LibHandle,'sqlite3_errmsg');
-  pointer(sqlite3_errmsg16) := GetProcedureAddress(LibHandle,'sqlite3_errmsg16');
-  pointer(sqlite3_prepare) := GetProcedureAddress(LibHandle,'sqlite3_prepare');
-  pointer(sqlite3_prepare16) := GetProcedureAddress(LibHandle,'sqlite3_prepare16');
-  pointer(sqlite3_bind_blob) := GetProcedureAddress(LibHandle,'sqlite3_bind_blob');
-  pointer(sqlite3_bind_double) := GetProcedureAddress(LibHandle,'sqlite3_bind_double');
-  pointer(sqlite3_bind_int) := GetProcedureAddress(LibHandle,'sqlite3_bind_int');
-  pointer(sqlite3_bind_int64) := GetProcedureAddress(LibHandle,'sqlite3_bind_int64');
-  pointer(sqlite3_bind_null) := GetProcedureAddress(LibHandle,'sqlite3_bind_null');
-  pointer(sqlite3_bind_text) := GetProcedureAddress(LibHandle,'sqlite3_bind_text');
-  pointer(sqlite3_bind_text16) := GetProcedureAddress(LibHandle,'sqlite3_bind_text16');
-//  pointer(sqlite3_bind_value) := GetProcedureAddress(LibHandle,'sqlite3_bind_value');
-//These overloaded functions were introduced to allow the use of SQLITE_STATIC and SQLITE_TRANSIENT
-//It's the c world man ;-)
-  pointer(sqlite3_bind_blob1) := GetProcedureAddress(LibHandle,'sqlite3_bind_blob');
-  pointer(sqlite3_bind_text1) := GetProcedureAddress(LibHandle,'sqlite3_bind_text');
-  pointer(sqlite3_bind_text161) := GetProcedureAddress(LibHandle,'sqlite3_bind_text16');
-
-  pointer(sqlite3_bind_parameter_count) := GetProcedureAddress(LibHandle,'sqlite3_bind_parameter_count');
-  pointer(sqlite3_bind_parameter_name) := GetProcedureAddress(LibHandle,'sqlite3_bind_parameter_name');
-  pointer(sqlite3_bind_parameter_index) := GetProcedureAddress(LibHandle,'sqlite3_bind_parameter_index');
-//  pointer(sqlite3_clear_bindings) := GetProcedureAddress(LibHandle,'sqlite3_clear_bindings');
-  pointer(sqlite3_column_count) := GetProcedureAddress(LibHandle,'sqlite3_column_count');
-  pointer(sqlite3_column_name) := GetProcedureAddress(LibHandle,'sqlite3_column_name');
-  pointer(sqlite3_column_name16) := GetProcedureAddress(LibHandle,'sqlite3_column_name16');
-  pointer(sqlite3_column_decltype) := GetProcedureAddress(LibHandle,'sqlite3_column_decltype');
-  pointer(sqlite3_column_decltype16) := GetProcedureAddress(LibHandle,'sqlite3_column_decltype16');
-  pointer(sqlite3_step) := GetProcedureAddress(LibHandle,'sqlite3_step');
-  pointer(sqlite3_data_count) := GetProcedureAddress(LibHandle,'sqlite3_data_count');
-  pointer(sqlite3_column_blob) := GetProcedureAddress(LibHandle,'sqlite3_column_blob');
-  pointer(sqlite3_column_bytes) := GetProcedureAddress(LibHandle,'sqlite3_column_bytes');
-  pointer(sqlite3_column_bytes16) := GetProcedureAddress(LibHandle,'sqlite3_column_bytes16');
-  pointer(sqlite3_column_double) := GetProcedureAddress(LibHandle,'sqlite3_column_double');
-  pointer(sqlite3_column_int) := GetProcedureAddress(LibHandle,'sqlite3_column_int');
-  pointer(sqlite3_column_int64) := GetProcedureAddress(LibHandle,'sqlite3_column_int64');
-  pointer(sqlite3_column_text) := GetProcedureAddress(LibHandle,'sqlite3_column_text');
-  pointer(sqlite3_column_text16) := GetProcedureAddress(LibHandle,'sqlite3_column_text16');
-  pointer(sqlite3_column_type) := GetProcedureAddress(LibHandle,'sqlite3_column_type');
-  pointer(sqlite3_finalize) := GetProcedureAddress(LibHandle,'sqlite3_finalize');
-  pointer(sqlite3_reset) := GetProcedureAddress(LibHandle,'sqlite3_reset');
-  pointer(sqlite3_create_function) := GetProcedureAddress(LibHandle,'sqlite3_create_function');
-  pointer(sqlite3_create_function16) := GetProcedureAddress(LibHandle,'sqlite3_create_function16');
-  pointer(sqlite3_aggregate_count) := GetProcedureAddress(LibHandle,'sqlite3_aggregate_count');
-  pointer(sqlite3_value_blob) := GetProcedureAddress(LibHandle,'sqlite3_value_blob');
-  pointer(sqlite3_value_bytes) := GetProcedureAddress(LibHandle,'sqlite3_value_bytes');
-  pointer(sqlite3_value_bytes16) := GetProcedureAddress(LibHandle,'sqlite3_value_bytes16');
-  pointer(sqlite3_value_double) := GetProcedureAddress(LibHandle,'sqlite3_value_double');
-  pointer(sqlite3_value_int) := GetProcedureAddress(LibHandle,'sqlite3_value_int');
-  pointer(sqlite3_value_int64) := GetProcedureAddress(LibHandle,'sqlite3_value_int64');
-  pointer(sqlite3_value_text) := GetProcedureAddress(LibHandle,'sqlite3_value_text');
-  pointer(sqlite3_value_text16) := GetProcedureAddress(LibHandle,'sqlite3_value_text16');
-  pointer(sqlite3_value_text16le) := GetProcedureAddress(LibHandle,'sqlite3_value_text16le');
-  pointer(sqlite3_value_text16be) := GetProcedureAddress(LibHandle,'sqlite3_value_text16be');
-  pointer(sqlite3_value_type) := GetProcedureAddress(LibHandle,'sqlite3_value_type');
-  pointer(sqlite3_aggregate_context) := GetProcedureAddress(LibHandle,'sqlite3_aggregate_context');
-  pointer(sqlite3_user_data) := GetProcedureAddress(LibHandle,'sqlite3_user_data');
-  pointer(sqlite3_get_auxdata) := GetProcedureAddress(LibHandle,'sqlite3_get_auxdata');
-  pointer(sqlite3_set_auxdata) := GetProcedureAddress(LibHandle,'sqlite3_set_auxdata');
-  pointer(sqlite3_result_blob) := GetProcedureAddress(LibHandle,'sqlite3_result_blob');
-  pointer(sqlite3_result_double) := GetProcedureAddress(LibHandle,'sqlite3_result_double');
-  pointer(sqlite3_result_error) := GetProcedureAddress(LibHandle,'sqlite3_result_error');
-  pointer(sqlite3_result_error16) := GetProcedureAddress(LibHandle,'sqlite3_result_error16');
-  pointer(sqlite3_result_int) := GetProcedureAddress(LibHandle,'sqlite3_result_int');
-  pointer(sqlite3_result_int64) := GetProcedureAddress(LibHandle,'sqlite3_result_int64');
-  pointer(sqlite3_result_null) := GetProcedureAddress(LibHandle,'sqlite3_result_null');
-  pointer(sqlite3_result_text) := GetProcedureAddress(LibHandle,'sqlite3_result_text');
-  pointer(sqlite3_result_text16) := GetProcedureAddress(LibHandle,'sqlite3_result_text16');
-  pointer(sqlite3_result_text16le) := GetProcedureAddress(LibHandle,'sqlite3_result_text16le');
-  pointer(sqlite3_result_text16be) := GetProcedureAddress(LibHandle,'sqlite3_result_text16be');
-  pointer(sqlite3_result_value) := GetProcedureAddress(LibHandle,'sqlite3_result_value');
-  pointer(sqlite3_create_collation) := GetProcedureAddress(LibHandle,'sqlite3_create_collation');
-  pointer(sqlite3_create_collation16) := GetProcedureAddress(LibHandle,'sqlite3_create_collation16');
-  pointer(sqlite3_collation_needed) := GetProcedureAddress(LibHandle,'sqlite3_collation_needed');
-  pointer(sqlite3_collation_needed16) := GetProcedureAddress(LibHandle,'sqlite3_collation_needed16');
-  pointer(sqlite3_libversion):=GetProcedureAddress(LibHandle,'sqlite3_libversion');
-//Alias for allowing better code portability (win32 is not working with external variables) 
-  pointer(sqlite3_version):=GetProcedureAddress(LibHandle,'sqlite3_libversion');
-
-// Not published functions
-  pointer(sqlite3_libversion_number):=GetProcedureAddress(LibHandle,'sqlite3_libversion_number');
-//  pointer(sqlite3_key) := GetProcedureAddress(LibHandle,'sqlite3_key');
-//  pointer(sqlite3_rekey) := GetProcedureAddress(LibHandle,'sqlite3_rekey');
-//  pointer(sqlite3_sleep) := GetProcedureAddress(LibHandle,'sqlite3_sleep');
-//  pointer(sqlite3_expired) := GetProcedureAddress(LibHandle,'sqlite3_expired');
-// function sqlite3_global_recover:longint;cdecl;
-end;
-        
-var
-  RefCount : integer;
-  LoadedLibrary : String;
-            
-
-Function TryInitialiseSqlite(Const LibraryName : String) : Boolean;
-            
-begin
-  Result:=False;
-  if (RefCount=0) then
-    begin
-    SQLiteLibraryHandle:=LoadLibrary(LibraryName);
-    Result:=(SQLiteLibraryHandle<>nilhandle);
-    If not Result then
-      Exit;
-    inc(RefCount);
-    LoadedLibrary:=LibraryName;
-    LoadAddresses(SQLiteLibraryHandle);
-    end
-  else
-    begin
-    If (LoadedLibrary<>LibraryName) then
-      Raise EInoutError.CreateFmt(SErrAlreadyLoaded,[LoadedLibrary]);
-    inc(RefCount);
-    Result:=True;
-    end;
-end;
-
-Procedure InitialiseSQLite;
-
-begin
-  InitialiseSQLite(DefaultLibrary);
-end;
-
-
-Procedure InitialiseSQLite(LibraryName : String);
-
-begin
-  If Not TryInitialiseSQLIte(LibraryName) then
-    Raise EInOutError.CreateFmt(SErrLoadFailed,[LibraryName]);
-end;
-
-Procedure ReleaseSQLITE;
-
-begin
-  if RefCount>1 then
-    Dec(RefCount)
-  else if UnloadLibrary(SQLITELibraryHandle) then
-    begin
-    Dec(RefCount);
-    SQLITELibraryHandle := NilHandle;
-    LoadedLibrary:='';
-    end;
-end;
-
-{$ENDIF}
-
-end.

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

@@ -1,5 +0,0 @@
-unit sqlite3;
-
-{$i sqlite3.inc}
-
-end.

+ 0 - 494
packages/base/sqlite/sqlite3db.pas

@@ -1,494 +0,0 @@
-{$mode objfpc}
-{$h+}
-{*************************************************************
-SQLite3 Object Oriented handle
-O. Rinaudo - 2005 - [email protected]
-G. Marcou  - 2007 - [email protected]
-*************************************************************}
-
-unit SQLite3db;
-
-interface
-
-uses  Classes,strings,sqlite3;
-{*************************************************************}
-{*************************************************************}
-type
-   TSQLiteExecCallback = function(Sender: pointer; Columns: Integer; ColumnValues: ppchar; ColumnNames: ppchar): integer of object; cdecl;
-   TSQLiteBusyCallback = function(Sender: TObject; BusyCount: integer): longint of object; cdecl;
-   TOnData = Procedure(Sender: TObject; Columns: Integer; ColumnNames, ColumnValues: String)  of object;
-   TOnBusy = Procedure(Sender: TObject; BusyCount: integer; var Cancel: Boolean) of object;
-   TOnQueryComplete = Procedure(Sender: TObject) of object;
-
-   TSQLite = class(TObject)
-{*************************************************************}
-{*************************************************************}   
-   private
-   fPSQlite: PPsqlite3;
-   fSQLite:Psqlite3;
-   fMsg: String;
-   fIsOpen: Boolean;
-   fBusy: Boolean;
-   fError: longint;
-   fVersion: String;
-   fEncoding: String;
-   fTable: TStrings;
-   fLstName: TStringList;
-   fLstVal: TStringList;
-   fOnData: TOnData;
-   fOnBusy: TOnBusy;
-   fOnQueryComplete: TOnQueryComplete;
-   fBusyTimeout: longint;
-   fPMsg: PChar;
-   fChangeCount: longint;
-   fNb_Champ :  Integer;
-   fList_FieldName : TStringList;
-   fList_Field : TList;
-   procedure SetBusyTimeout(Timeout: integer);
-{*************************************************************}
-{*************************************************************}   
-   public
-   constructor Create(DBFileName: String);
-   destructor Destroy; override;
-   function Query(Sql: String; Table: TStrings ): boolean;
-   function ErrorMessage(ErrNo: Integer): string;
-   function IsComplete(Sql: String): boolean;
-   function LastInsertRow: integer;
-   function Cancel: boolean;
-   function DatabaseDetails(Table: TStrings): boolean;
-   property LastErrorMessage: string read fMsg;
-   property LastError: longint read fError;
-   property Version: String read fVersion;
-   property Encoding: String read fEncoding;
-   property OnData: TOnData read fOnData write fOnData;
-   property OnBusy: TOnBusy read fOnBusy write fOnBusy;
-   property OnQueryComplete: TOnQueryComplete read fOnQueryComplete write fOnQueryComplete;
-   property BusyTimeout: longint read fBusyTimeout write SetBusyTimeout;
-   property ChangeCount: longint read fChangeCount;
-   property List_FieldName: TStringList read fList_FieldName write fList_FieldName;
-   property List_Field: TList read fList_Field write fList_Field;
-   property Nb_Champ: integer read fNb_Champ write fNb_Champ;
- procedure SQLOnData(Sender: TObject; Columns: Integer; ColumnNames, ColumnValues: String);
-
- end;
-function Pas2SQLStr(const PasString: string): string;
-function SQL2PasStr(const SQLString: string): string;
-function QuoteStr(const s: string; QuoteChar: Char ): string;
-function UnQuoteStr(const s: string; QuoteChar: Char ): string;
-procedure ValueList(const ColumnNames, ColumnValues: String; NameValuePairs: TStrings);
-{*************************************************************}
-{*************************************************************}
-implementation
-Const
-   DblQuote: Char      = '"';
-   SngQuote: Char      = #39;
-   DblSngQuote: String = #39#39;
-   Crlf: String	       = #13#10;
-   Tab: Char	       = #9;
-var
-   MsgNoError : String;
-{*************************************************************}
-{*************************************************************}
-function QuoteStr(const s: string; QuoteChar: Char ): string;
-{*************************************************************
-SQlite3 enclosing string with quotes
-G. Marcou
-*************************************************************}
-begin
-   Result := Concat(QuoteChar, s, QuoteChar);
-end;
-{*************************************************************}
-function UnQuoteStr(const s: string; QuoteChar: Char ): string;
-{*************************************************************
-SQlite3 Remove enclosing quotes from string
-G. Marcou
-*************************************************************}
-begin
-   Result := s;
-   if length(Result) > 1 then
-   begin
-      if Result[1] = QuoteChar then
-	 Delete(Result, 1, 1);
-      if Result[Length(Result)] = QuoteChar then
-	 Delete(Result, Length(Result), 1);
-   end;
-end;
-{*************************************************************}
-function Pas2SQLStr(const PasString: string): string;
-{*************************************************************
-SQlite3 SQL string are use double quotes, Pascal string use
-single quote.
-G. Marcou
-*************************************************************}
-var
-   n : integer;
-begin
-   Result := SQL2PasStr(PasString);
-   n := Length(Result);
-   while n > 0 do
-   begin
-      if Result[n] = SngQuote then
-	 Insert(SngQuote, Result, n);
-      dec(n);
-   end;
-   Result := QuoteStr(Result,SngQuote);
-end;
-{*************************************************************}
-function SQL2PasStr(const SQLString: string): string;
-{*************************************************************
-SQlite3 SQL string are use double quotes, Pascal string use
-single quote.
-G. Marcou
-*************************************************************}
-var
-   p : integer;
-begin
-   Result := SQLString;
-   p := pos(DblSngQuote, Result);
-   while p > 0 do
-   begin
-      Delete(Result, p, 1);
-      p := pos(DblSngQuote, Result);
-   end;
-   Result := UnQuoteStr(Result,SngQuote);
-end;
-{*************************************************************}
-procedure ValueList(const ColumnNames, ColumnValues : String;
-NameValuePairs					    : TStrings);
-{*************************************************************
-SQlite3 build (name=value) pair list
-G. Marcou
-*************************************************************}
-var
-   n		     : integer;
-   lstName, lstValue : TStringList;
-begin		     
-   if NameValuePairs <> nil then
-   begin
-      lstName := TStringList.Create;
-      lstValue := TStringList.Create;
-      lstName.CommaText := ColumnNames;
-      lstValue.CommaText := ColumnValues;
-      NameValuePairs.Clear;
-      if lstName.Count = LstValue.Count then
-	 if lstName.Count > 0 then
-	    for n := 0 to lstName.Count - 1 do
-	       NameValuePairs.Append(Concat(lstName.Strings[n], '=', lstValue.Strings[n]));
-      lstValue.Free;
-      lstName.Free;
-   end;
-end;
-{*************************************************************}
-{function SystemErrorMsg(ErrNo: Integer ): String;
-var
-  buf: PChar;
-  size: Integer;
-  MsgLen: Integer;
-begin}
-{  size := 256;
-  GetMem(buf, size);
-  If ErrNo = - 1 then
-    ErrNo := GetLastError;
-  MsgLen := FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nil, ErrNo, 0, buf, size, nil);
-  if MsgLen = 0 then
-    Result := 'ERROR'
-  else
-    Result := buf;}
-{end;}
-{*************************************************************}
-function BusyCallback(Sender : pointer;
-BusyCount		     : integer): longint; cdecl;
-{*************************************************************
-SQlite3 busy callback 
-G. Marcou
-*************************************************************}
-var
-  bCancel: Boolean;
-begin
-  Result := -1;
-  with TObject(Sender) as TSQLite do
-  begin
-    if Assigned(fOnBusy) then
-    begin
-      bCancel := False;
-      fOnBusy(Tobject(Sender), BusyCount, bCancel);
-      if bCancel then
-        Result := 0;
-    end;
-  end;
-end;
-{*************************************************************}
-function ExecCallback(Sender : Pointer;
-Columns			     : Integer;
-ColumnValues		     : PPChar;
-ColumnNames		     : PPchar): integer; cdecl;
-{*************************************************************
-SQlite3 Build table and data from callback
-G. Marcou
-*************************************************************}
-var
-   PVal, PName : ^PChar;
-   n	       : integer;
-   sVal, sName : String;
-begin
-   Result := 0;
-   with TObject(Sender) as TSQLite do
-   begin
-      if (Assigned(fOnData) or Assigned(fTable)) then
-      begin
-	 fLstName.Clear;
-	 fLstVal.Clear;
-	 if Columns > 0 then
-	 begin
-	    PName := ColumnNames;
-	    PVal := ColumnValues;
-	    for n := 0 to Columns - 1 do
-	    begin
-	       fLstName.Append(PName^);
-	       fLstVal.Append(PVal^);
-	       inc(PName);
-	       inc(PVal);
-	    end;
-	 end;
-	 sVal := fLstVal.CommaText;
-	 sName := fLstName.CommaText;
-	 if Assigned(fOnData) then
-	    fOnData(TObject(Sender), Columns, sName, sVal);
-	 if Assigned(fTable) then
-	 begin
-	    if fTable.Count = 0 then
-	       fTable.Append(sName);
-	    fTable.Append(sVal);
-	 end;
-      end;
-   end;
-end;
-{*************************************************************}
-procedure TSQLite.SQLOnData(Sender : TObject;
-Columns				   : Integer;
-ColumnNames, ColumnValues	   : String);
-{*************************************************************
-SQlite3 Fill up field list names and field list values
-G. Marcou
-*************************************************************}
-Var
-   InterS,val : String;
-   Field      : TStringList;
-   {************************************************}
-   function Pos1(a: String ; s : char) : integer;
-   var i,j : Integer;
-   begin
-      j:=-1;
-      for i:=1 to length(a) Do
-      begin
-	 if a[i] = s then
-	 begin
-	    j:=i;
-	    break;
-	 end;
-      end;
-      result:=j;
-   end; { Pos1 }
-   {*************************************************}
-begin
-   If Nb_Champ = -1 Then
-   Begin {Put the fields name in List_FieldName}
-      Nb_Champ:=Columns;
-      InterS:=ColumnNames;
-      While (Pos1(InterS,',') > 0)  do
-      begin
-	 val:=copy(InterS,1,Pos1(InterS,',')-1);
-	 InterS:=copy(InterS,Pos1(InterS,',')+1,length(InterS));
-	 List_FieldName.add(val);
-      end;
-      if length(InterS) > 0 then List_FieldName.add(InterS);
-   end;
-   {Put the list of TStringList of value}
-   Field :=TStringList.Create;
-        InterS:=ColumnValues;
-   While (Pos1(InterS,',') > 0)  do
-   begin
-      val:=copy(InterS,1,Pos1(InterS,',')-1);
-      InterS:=copy(InterS,Pos1(InterS,',')+1,length(InterS));
-      Field.add(val);
-   end;
-   if length(InterS) > 0 then Field.add(InterS);
-   List_Field.add(Field);
-end;
-{*************************************************************}
-constructor TSQLite.Create(DBFileName: String);
-{*************************************************************
-SQlite3 constructor
-G. Marcou
-*************************************************************}
-var
-   name	  : pchar;
-begin	  
-   inherited Create;
-   List_FieldName := TStringList.Create;
-   List_Field := TList.Create;
-   fError := SQLITE_ERROR;
-   fIsOpen := False;
-   fLstName := TStringList.Create;
-   fLstVal := TStringList.Create;
-   fOnData := nil;
-   fOnBusy := nil;
-   fOnQueryComplete := nil;
-   fChangeCount := 0;
-   name:=StrAlloc (length(DBFileName)+1);
-   strpcopy(name,DBFileName);
-   OnData:=@SQLOnData;
-   writeln('Try to open');
-   sqlite3_open(name,@fSQLite);
-   writeln('Open success');
-   sqlite3_free(fPMsg);
-   writeln('Free memory');
-   if fSQLite <> nil then
-   begin
-      //fVersion := String(SQLite_Version);
-      //fEncoding := SQLite_Encoding;
-      fIsOpen := True;
-      fError := SQLITE_OK;
-   end;
-   fMsg := sqlite3_errmsg(fSQLite);
-end;
-{*************************************************************}
-destructor TSQLite.Destroy;
-{*************************************************************
-SQLite3 destructor
-G. Marcou
-*************************************************************}
-begin
-   if fIsOpen then
-      fError:=sqlite3_close(fSQLite);
-   fIsOpen := False;
-   fLstName.Free;
-   fLstVal.Free;
-   fSQLite := nil;
-   fOnData := nil;
-   fOnBusy := nil;
-   fOnQueryComplete := nil;
-   fLstName := nil;
-   fLstVal := nil;
-   List_FieldName.destroy;
-   List_Field.destroy;
-   inherited Destroy;
-end;
-{*************************************************************}
-function TSQLite.Query(Sql: String; Table: TStrings ): boolean;
-{*************************************************************
-SQLite3 query the database
-G. Marcou
-*************************************************************}
-//var
-//  fPMsg: PChar;
-//var Psql : pchar;
-begin
-   fError := SQLITE_ERROR;
-   if fIsOpen then
-   begin
-      fPMsg := nil;
-      fBusy := True;
-      fTable := Table;
-      if fTable <> nil then
-	 fTable.Clear;
-      List_FieldName.clear;
-      List_Field.clear;
-      Nb_Champ:=-1;
-      fError := sqlite3_exec(fSQLite, PChar(sql), @ExecCallback, Self, @fPMsg);
-      sqlite3_free(fPMsg);
-      fChangeCount := sqlite3_changes(fSQLite);
-      fTable := nil;
-      fBusy := False;
-      if Assigned(fOnQueryComplete) then
-	 fOnQueryComplete(Self);
-   end;
-   fMsg := ErrorMessage(fError);
-   Result := (fError = SQLITE_OK);
-end;
-{*************************************************************}
-function TSQLite.Cancel: boolean;
-{*************************************************************
-SQLite3 interrupt database
-G. Marcou
-*************************************************************}
-begin
-   Result := False;
-   if fBusy and fIsOpen then
-   begin
-      sqlite3_interrupt(fSQLite);
-      fBusy := false;
-      Result := True;
-   end;
-end;
-{*************************************************************}
-procedure TSQLite.SetBusyTimeout(Timeout: Integer);
-{*************************************************************
-SQLite3 busy timeout
-G. Marcou
-*************************************************************}
-begin
-   fBusyTimeout := Timeout;
-   if fIsOpen then
-   begin
-      fError:=sqlite3_busy_timeout(fSQLite, fBusyTimeout);
-      if fBusyTimeout > 0 then
-	 sqlite3_busy_handler(fSQLite, @BusyCallback, Self)
-      else
-	 sqlite3_busy_handler(fSQLite, nil, nil);
-   end;
-end;
-{*************************************************************}
-function TSQLite.LastInsertRow: longint;
-{*************************************************************
-SQLite3 Get ID of the last inserted row
-G. Marcou
-*************************************************************}
-begin
-  if fIsOpen then
-    Result := sqlite3_last_insert_rowid(fSQLite)
-  else
-    Result := -1;
-end;
-{*************************************************************}
-function TSQLite.ErrorMessage(ErrNo: Integer): string;
-{*************************************************************
-SQLite3 Return comprehensive error message
-G. Marcou
-*************************************************************}
-begin
-  if ErrNo = 0 then
-    Result := MsgNoError
-  else
-    Result := sqlite3_errmsg(fSQLite);
-end;
-{*************************************************************}
-function TSQLite.IsComplete(Sql: String): boolean;
-{*************************************************************
-SQLite3 Return true when complete
-G. Marcou
-*************************************************************}
-var Psql : pchar;
-begin
-   Psql:=StrAlloc (length(Sql)+1);
-   strpcopy(Psql,Sql);
-//   Writeln('Testing: ',psql);
-   Result := sqlite3_complete(Psql)<>0;
-   strdispose(Psql);
-end;
-{*************************************************************}
-function TSQLite.DatabaseDetails(Table: TStrings): boolean;
-{*************************************************************
-SQLite3 Query the database
-G. Marcou
-*************************************************************}
-begin
-  Result := Query('SELECT * FROM SQLITE_MASTER;', Table);
-end;
-{*************************************************************}
-{*************************************************************}
-initialization
-
-finalization
-
-end.

+ 0 - 7
packages/base/sqlite/sqlite3dyn.pp

@@ -1,7 +0,0 @@
-unit sqlite3dyn;
-
-{$DEFINE LOAD_DYNAMICALLY}
-
-{$i sqlite3.inc}
-
-end.

+ 0 - 410
packages/base/sqlite/sqlitedb.pas

@@ -1,410 +0,0 @@
-{$mode objfpc}
-{$h+}
-
-unit SQLitedb;
-
-interface
-
-uses  Classes,strings,sqlite;
-
-type
-  TSQLiteExecCallback = function(Sender: pointer; Columns: Integer; ColumnValues: ppchar; ColumnNames: ppchar): integer of object; cdecl;
-  TSQLiteBusyCallback = function(Sender: TObject; ObjectName: PChar; BusyCount: integer): integer of object; cdecl;
-  TOnData = Procedure(Sender: TObject; Columns: Integer; ColumnNames, ColumnValues: String)  of object;
-  TOnBusy = Procedure(Sender: TObject; ObjectName: String; BusyCount: integer; var Cancel: Boolean) of object;
-  TOnQueryComplete = Procedure(Sender: TObject) of object;
-
-  TSQLite = class(TObject)
-  private
-    fSQLite: Pointer;
-    fMsg: String;
-    fIsOpen: Boolean;
-    fBusy: Boolean;
-    fError: Integer;
-    fVersion: String;
-    fEncoding: String;
-    fTable: TStrings;
-    fLstName: TStringList;
-    fLstVal: TStringList;
-    fOnData: TOnData;
-    fOnBusy: TOnBusy;
-    fOnQueryComplete: TOnQueryComplete;
-    fBusyTimeout: integer;
-    fPMsg: PChar;
-    fChangeCount: integer;
-        fNb_Champ :  Integer;
-        fList_FieldName : TStringList;
-        fList_Field : TList;
-    procedure SetBusyTimeout(Timeout: integer);
-  public
-    constructor Create(DBFileName: String);
-    destructor Destroy; override;
-    function Query(Sql: String; Table: TStrings ): boolean;
-    function ErrorMessage(ErrNo: Integer): string;
-    function IsComplete(Sql: String): boolean;
-    function LastInsertRow: integer;
-    function Cancel: boolean;
-    function DatabaseDetails(Table: TStrings): boolean;
-    property LastErrorMessage: string read fMsg;
-    property LastError: Integer read fError;
-    property Version: String read fVersion;
-    property Encoding: String read fEncoding;
-    property OnData: TOnData read fOnData write fOnData;
-    property OnBusy: TOnBusy read fOnBusy write fOnBusy;
-    property OnQueryComplete: TOnQueryComplete read fOnQueryComplete write fOnQueryComplete;
-    property BusyTimeout: Integer read fBusyTimeout write SetBusyTimeout;
-    property ChangeCount: Integer read fChangeCount;
-    property List_FieldName: TStringList read fList_FieldName write fList_FieldName;
-    property List_Field: TList read fList_Field write fList_Field;
-    property Nb_Champ: integer read fNb_Champ write fNb_Champ;
-
-  procedure SQLOnData(Sender: TObject; Columns: Integer; ColumnNames, ColumnValues: String);
-
-  end;
-  function Pas2SQLStr(const PasString: string): string;
-  function SQL2PasStr(const SQLString: string): string;
-  function QuoteStr(const s: string; QuoteChar: Char ): string;
-  function UnQuoteStr(const s: string; QuoteChar: Char ): string;
-  procedure ValueList(const ColumnNames, ColumnValues: String; NameValuePairs: TStrings);
-
-implementation
-
-Const
-  DblQuote: Char    = '"';
-  SngQuote: Char    = #39;
-  Crlf: String      = #13#10;
-  Tab: Char         = #9;
-
-var
-  MsgNoError: String;
-
-function QuoteStr(const s: string; QuoteChar: Char ): string;
-begin
-  Result := Concat(QuoteChar, s, QuoteChar);
-end;
-
-function UnQuoteStr(const s: string; QuoteChar: Char ): string;
-begin
-  Result := s;
-  if length(Result) > 1 then
-  begin
-    if Result[1] = QuoteChar then
-      Delete(Result, 1, 1);
-    if Result[Length(Result)] = QuoteChar then
-      Delete(Result, Length(Result), 1);
-  end;
-end;
-
-function Pas2SQLStr(const PasString: string): string;
-var
-  n: integer;
-begin
-  Result := SQL2PasStr(PasString);
-  n := Length(Result);
-  while n > 0 do
-  begin
-    if Result[n] = SngQuote then
-      Insert(SngQuote, Result, n);
-    dec(n);
-  end;
-  Result := QuoteStr(Result,#39);
-end;
-
-function SQL2PasStr(const SQLString: string): string;
-const
-  DblSngQuote: String = #39#39;
-var
-  p: integer;
-begin
-  Result := SQLString;
-  p := pos(DblSngQuote, Result);
-  while p > 0 do
-  begin
-    Delete(Result, p, 1);
-    p := pos(DblSngQuote, Result);
-  end;
-  Result := UnQuoteStr(Result,#39);
-end;
-
-procedure ValueList(const ColumnNames, ColumnValues: String; NameValuePairs: TStrings);
-var
-  n: integer;
-  lstName, lstValue: TStringList;
-begin
-  if NameValuePairs <> nil then
-  begin
-    lstName := TStringList.Create;
-    lstValue := TStringList.Create;
-    lstName.CommaText := ColumnNames;
-    lstValue.CommaText := ColumnValues;
-    NameValuePairs.Clear;
-    if lstName.Count = LstValue.Count then
-      if lstName.Count > 0 then
-        for n := 0 to lstName.Count - 1 do
-          NameValuePairs.Append(Concat(lstName.Strings[n], '=', lstValue.Strings[n]));
-    lstValue.Free;
-    lstName.Free;
-  end;
-end;
-
-
-
-function SystemErrorMsg(ErrNo: Integer ): String;
-var
-  buf: PChar;
-  size: Integer;
-  MsgLen: Integer;
-begin
-{  size := 256;
-  GetMem(buf, size);
-  If ErrNo = - 1 then
-    ErrNo := GetLastError;
-  MsgLen := FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nil, ErrNo, 0, buf, size, nil);
-  if MsgLen = 0 then
-    Result := 'ERROR'
-  else
-    Result := buf;}
-end;
-
-function BusyCallback(Sender: pointer; ObjectName: PChar; BusyCount: integer): integer; cdecl;
-var
-  sObjName: String;
-  bCancel: Boolean;
-begin
-  Result := -1;
-  with TObject(Sender) as TSQLite do
-  begin
-    if Assigned(fOnBusy) then
-    begin
-      bCancel := False;
-      sObjName := ObjectName;
-      fOnBusy(Tobject(Sender), sObjName, BusyCount, bCancel);
-      if bCancel then
-        Result := 0;
-    end;
-  end;
-end;
-
-function ExecCallback(Sender: Pointer; Columns: Integer; ColumnValues: PPChar; ColumnNames: PPchar): integer; cdecl;
-var
-  PVal, PName: ^PChar;
-  n: integer;
-  sVal, sName: String;
-begin
-  Result := 0;
-  with TObject(Sender) as TSQLite do
-  begin
-    if (Assigned(fOnData) or Assigned(fTable)) then
-    begin
-      fLstName.Clear;
-      fLstVal.Clear;
-      if Columns > 0 then
-      begin
-        PName := ColumnNames;
-        PVal := ColumnValues;
-        for n := 0 to Columns - 1 do
-        begin
-          fLstName.Append(PName^);
-          fLstVal.Append(PVal^);
-          inc(PName);
-          inc(PVal);
-        end;
-      end;
-      sVal := fLstVal.CommaText;
-      sName := fLstName.CommaText;
-      if Assigned(fOnData) then
-        fOnData(TObject(Sender), Columns, sName, sVal);
-      if Assigned(fTable) then
-      begin
-        if fTable.Count = 0 then
-          fTable.Append(sName);
-        fTable.Append(sVal);
-      end;
-    end;
-  end;
-end;
-
-
-procedure TSQLite.SQLOnData(Sender: TObject; Columns: Integer; ColumnNames, ColumnValues: String);
-Var i : Integer;
-          InterS,val : String;
-          Field : TStringList;
-
-          function Pos1(a: String ; s : char) : integer;
-          var i,j : Integer;
-
-          begin
-          j:=-1;
-                for i:=1 to length(a) Do
-                begin
-                        if a[i] = s then
-                        begin
-                                j:=i;
-                                break;
-                        end;
-                end;
-                result:=j;
-          end;
-begin
-        If Nb_Champ = -1 Then
-        Begin // Put the fields name in List_FieldName
-                Nb_Champ:=Columns;
-                InterS:=ColumnNames;
-                While (Pos1(InterS,',') > 0)  do
-                begin
-                        val:=copy(InterS,1,Pos1(InterS,',')-1);
-                        InterS:=copy(InterS,Pos1(InterS,',')+1,length(InterS));
-                        List_FieldName.add(val);
-                end;
-                if length(InterS) > 0 then List_FieldName.add(InterS);
-        end;
-        // Put the list of TStringList of value
-        Field :=TStringList.Create;
-        InterS:=ColumnValues;
-        While (Pos1(InterS,',') > 0)  do
-        begin
-                val:=copy(InterS,1,Pos1(InterS,',')-1);
-                InterS:=copy(InterS,Pos1(InterS,',')+1,length(InterS));
-                Field.add(val);
-        end;
-        if length(InterS) > 0 then Field.add(InterS);
-        List_Field.add(Field);
-end;
-
-constructor TSQLite.Create(DBFileName: String);
-var
-  fPMsg1: PChar;
-  name : pchar;
-begin
-  inherited Create;
-  List_FieldName := TStringList.Create;
-  List_Field := TList.Create;
-  fError := SQLITE_ERROR;
-  fIsOpen := False;
-  fLstName := TStringList.Create;
-  fLstVal := TStringList.Create;
-  fOnData := nil;
-  fOnBusy := nil;
-  fOnQueryComplete := nil;
-  fChangeCount := 0;
-   name:=StrAlloc (length(DBFileName)+1);
-   strpcopy(name,DBFileName);
-   OnData:=@SQLOnData;
-    fSQLite := SQLite_Open(name, 1, @fPMsg);
-    SQLite_FreeMem(fPMsg);
-    if fSQLite <> nil then
-    begin
-      //fVersion := String(SQLite_Version);
-      //fEncoding := SQLite_Encoding;
-      fIsOpen := True;
-      fError := SQLITE_OK;
-    end;
-  fMsg := ErrorMessage(fError);
-end;
-
-destructor TSQLite.Destroy;
-begin
-  if fIsOpen then
-    SQLite_Close(fSQLite);
-  fIsOpen := False;
-  fLstName.Free;
-  fLstVal.Free;
-  fSQLite := nil;
-  fOnData := nil;
-  fOnBusy := nil;
-  fOnQueryComplete := nil;
-  fLstName := nil;
-  fLstVal := nil;
-  List_FieldName.destroy;
-  List_Field.destroy;
-  inherited Destroy;
-end;
-
-function TSQLite.Query(Sql: String; Table: TStrings ): boolean;
-//var
-//  fPMsg: PChar;
-//var Psql : pchar;
-begin
-  fError := SQLITE_ERROR;
-  if fIsOpen then
-  begin
-    fPMsg := nil;
-    fBusy := True;
-    fTable := Table;
-    if fTable <> nil then
-      fTable.Clear;
-   List_FieldName.clear;
-   List_Field.clear;
-   Nb_Champ:=-1;
-    fError := SQLite_Exec(fSQLite, PChar(sql), @ExecCallback, Self, @fPMsg);
-    SQLite_FreeMem(fPMsg);
-    fChangeCount := SQLite_Changes(fSQLite);
-    fTable := nil;
-    fBusy := False;
-    if Assigned(fOnQueryComplete) then
-      fOnQueryComplete(Self);
-  end;
-  fMsg := ErrorMessage(fError);
-  Result := (fError = SQLITE_OK);
-end;
-
-function TSQLite.Cancel: boolean;
-begin
-  Result := False;
-  if fBusy and fIsOpen then
-  begin
-    do_SQLite_interrupt(fSQLite);
-    fBusy := false;
-    Result := True;
-  end;
-end;
-
-procedure TSQLite.SetBusyTimeout(Timeout: Integer);
-begin
-  fBusyTimeout := Timeout;
-  if fIsOpen then
-  begin
-    SQLite_Busy_Timeout(fSQLite, fBusyTimeout);
-    if fBusyTimeout > 0 then
-      SQLite_Busy_Handler(fSQLite, @BusyCallback, Self)
-    else
-      SQLite_Busy_Handler(fSQLite, nil, nil);
-  end;
-end;
-
-function TSQLite.LastInsertRow: integer;
-begin
-  if fIsOpen then
-    Result := SQLite_Last_Insert_RowID(fSQLite)
-  else
-    Result := -1;
-end;
-
-function TSQLite.ErrorMessage(ErrNo: Integer): string;
-begin
-  if ErrNo = 0 then
-    Result := MsgNoError
-  else
-    Result := SQLite_Error_String(ErrNo);
-end;
-
-function TSQLite.IsComplete(Sql: String): boolean;
-var Psql : pchar;
-begin
-  Psql:=StrAlloc (length(Sql)+1);
-  strpcopy(Psql,Sql);
-  Writeln('Testing: ',psql);
-  Result := SQLite_Complete(Psql)<>0;
-  strdispose(Psql);
-end;
-
-function TSQLite.DatabaseDetails(Table: TStrings): boolean;
-begin
-  Result := Query('SELECT * FROM SQLITE_MASTER;', Table);
-end;
-
-initialization
-
-finalization
-
-end.

+ 0 - 52
packages/base/sqlite/test.pas

@@ -1,52 +0,0 @@
-program test;
-
-uses sqlite,sqlitedb, strings,classes;
-
-var
-  MySQL: TSQLite;
-  SQL: String;
-  i, j: Integer;
-  a: TStringList;
-begin
-  Writeln('Creating class');
-  MySQL := TSQLite.Create('test.db');
-  MySQL.BusyTimeout := 1000;
-
- // writeln(MySQL.Version);
-  Writeln('Creating table');
-  SQL := 'CREATE TABLE Test(No int, Nom varchar(32),Prenom varchar(32));';
-  MySQL.Query(sql, nil);
-  SQL := 'INSERT INTO Test VALUES(1,''Coursiere'', ''Olivier'');';
-  if MySQL.IsComplete(sql) then
-    begin
-    Writeln('Inserting first row');
-    MySQL.Query(sql, nil);
-    end;
-  SQL := 'INSERT INTO Test VALUES(2,''Jourde'', ''Eric'');';
-  if MySQL.IsComplete(sql) then
-    begin
-    Writeln('Inserting second row') ;
-    MySQL.Query(sql, nil);
-    end;
-  Writeln('Selecting rows') ;
-
-  SQL := 'SELECT * FROM Test;';
-  MySQL.Query(sql, nil);
-  writeln('Fields Names -------------------');
-  for i:=0 to MySQL.List_FieldName.count-1 do
-    writeln(i,' -> ',MySQL.List_FieldName.Strings[i]);
-  writeln('Fields -------------------');
-  for i:=0 to MySQL.List_Field.count-1 do
-      begin
-        a:=TStringList(MySQL.List_Field.items[i]);
-        write(i,' -> ');
-        for j:=0 to a.count-1 do
-          write(a.Strings[j],'  ');
-        writeln('');
-      end;
-
-// Uncomment to remove table again.
-//  SQL := 'DROP TABLE Test;';
-//  MySQL.Query(sql, nil);
-  MySQL.Free;
-end.

+ 0 - 44
packages/base/sqlite/testapiv3x.README

@@ -1,44 +0,0 @@
-Testing SQLite v3
-
-This prog is a simple direct api call
-sample for sqlite v3x.
-
-I.install
-1°)win32
-
-sqlite3.dll should be in default path or current dir
-and can be downloaded from here : 
- http://www.sqlite.org/
-
-
-2°)wince-arm
-
-.sqlite3.dll should be in default path or current dir
-and wince version can be downloaded from here :
- http://sourceforge.net/projects/sqlite-wince
-this is a source only release need evc++4
-also pre-compiled libraries for arm-wince are
-on  ftp://ftp.freepascal.org/pub/fpc/contrib/arm-wince-sqlite322.zip
-..shell/console is required on target system
-more info here : http://www.freepascal.org/wiki/index.php/WinCE_port
-...sqlite unit is not build automaticaly for arm-wince target
-add it in the path or build it manually
-
-II.tests
-
-2005/09/19 :
- wince-arm : 
-  testapvv3x have been tested with v3.2.2
-  compiled fpc2.1.1 today svn rep
-  command line for cross-compiling from XP:
-   fpc.exe -a -dNORMAL -Twince -Parm -XParm-wince-pe- -FDd:\binutils\win32-arm-pe -FE. -va testapiv3x.pp >test-arm-wince.log
-
- win32 :
-  testapvv3x have been tested with v3.2.4
-  compiled fpc2.1.1 today svn rep under lazarus
-
-
-
-Regards
-olivier
[email protected]

+ 0 - 83
packages/base/sqlite/testapiv3x.pp

@@ -1,83 +0,0 @@
-program testapiv3x;
-
-{$APPTYPE CONSOLE}
-{$MODE DELPHI}
-
-uses sqlite3, sysutils;
-
-const
- DBFILE='dbtest.db';
-
-var
- rc       : Integer;
- db       : PPsqlite3;
- sql      : string;
- pzErrMsg : PChar;
- 
-function MyCallback(_para1:pointer; plArgc:longint; argv:PPchar; argcol:PPchar):longint; cdecl;
-var i: Integer;
-    PVal, PName: ^PChar;
-begin
- PVal:=argv;
- PName:=argcol;
- for i:=0 to plArgc-1 do begin
-  writeln(Format('%s = ''%s'''#13, [PName^, PVal^]));
-  inc(PVal);
-  inc(PName);
- end;
- writeln(#13);
- Result:=0;
-end;
-
-begin
-  writeln(Format('SQLite version : %d',[sqlite3_libversion_number]));
-  rc := sqlite3_open(PChar(DBFILE), @db);
-  try
-   if rc<>SQLITE_OK then begin
-    writeln(Format('Can''t open database: %s',[DBFILE]));
-   end;
-
-   sql:= 'DROP TABLE Test;';
-   rc:=sqlite3_exec(db, PChar(sql), @MyCallback, nil, @pzErrMsg);
-   if( rc<>SQLITE_OK )
-   then writeln(Format('SQL error: %s', [pzErrMsg^]));
-
-   sql:='CREATE TABLE Test(No integer, name varchar(32),shortname varchar(32), age integer);';
-   rc:=sqlite3_exec(db, PChar(sql), @MyCallback, nil, @pzErrMsg);
-   if( rc<>SQLITE_OK )
-   then writeln(Format('SQL error: %s', [pzErrMsg^]));
-   
-   sql:='INSERT INTO Test VALUES(1,''hi'', ''by'', -1);';
-   rc:=sqlite3_exec(db, PChar(sql), @MyCallback, nil, @pzErrMsg);
-   Writeln('Inserting row');
-   if( rc<>SQLITE_OK )
-   then writeln(Format('SQL error: %s', [pzErrMsg^]));
-
-   SQL := 'INSERT INTO Test VALUES(2,''dualcore'', ''runwell'',-1);';
-   rc:=sqlite3_exec(db, PChar(sql), @MyCallback, nil, @pzErrMsg);
-   Writeln('Inserting row') ;
-   if( rc<>SQLITE_OK )
-   then writeln(Format('SQL error: %s', [pzErrMsg^]));
-
-   SQL := 'INSERT INTO Test VALUES(3,''Hello'', ''World'',NULL);';
-   rc:=sqlite3_exec(db, PChar(sql), @MyCallback, nil, @pzErrMsg);
-   Writeln('Inserting row') ;
-   if( rc<>SQLITE_OK )
-   then writeln(Format('SQL error: %s', [pzErrMsg^]));
-
-   SQL := 'INSERT INTO Test VALUES(4,''just a little'', ''test'',-1);';
-   rc:=sqlite3_exec(db, PChar(sql), @MyCallback, nil, @pzErrMsg);
-   Writeln('Inserting row') ;
-   if( rc<>SQLITE_OK )
-   then writeln(Format('SQL error: %s', [pzErrMsg^]));
-
-   SQL := 'select * from Test;';
-   rc:=sqlite3_exec(db, PChar(sql), @MyCallback, nil, @pzErrMsg);
-   if( rc<>SQLITE_OK )
-   then writeln(Format('SQL error: %s', [pzErrMsg^]));
-  finally sqlite3_close(db); end;
-
-  sleep(5000);
-end.
-
-