Browse Source

+ Initial check-in from Felipe Monteiro de Carvalho's implementation of dbus

git-svn-id: trunk@4872 -
michael 19 years ago
parent
commit
df7323318f

+ 22 - 0
.gitattributes

@@ -1242,6 +1242,28 @@ packages/Makefile svneol=native#text/plain
 packages/Makefile.fpc svneol=native#text/plain
 packages/Makefile.fpc svneol=native#text/plain
 packages/base/Makefile svneol=native#text/plain
 packages/base/Makefile svneol=native#text/plain
 packages/base/Makefile.fpc svneol=native#text/plain
 packages/base/Makefile.fpc svneol=native#text/plain
+packages/base/dbus/Makefile svneol=native#text/plain
+packages/base/dbus/Makefile.fpc svneol=native#text/plain
+packages/base/dbus/dbus-address.inc svneol=native#text/plain
+packages/base/dbus/dbus-arch-deps.inc svneol=native#text/plain
+packages/base/dbus/dbus-bus.inc svneol=native#text/plain
+packages/base/dbus/dbus-connection.inc svneol=native#text/plain
+packages/base/dbus/dbus-errors.inc svneol=native#text/plain
+packages/base/dbus/dbus-macros.inc svneol=native#text/plain
+packages/base/dbus/dbus-memory.inc svneol=native#text/plain
+packages/base/dbus/dbus-message.inc svneol=native#text/plain
+packages/base/dbus/dbus-pending-call.inc svneol=native#text/plain
+packages/base/dbus/dbus-protocol.inc svneol=native#text/plain
+packages/base/dbus/dbus-server.inc svneol=native#text/plain
+packages/base/dbus/dbus-shared.inc svneol=native#text/plain
+packages/base/dbus/dbus-signature.inc svneol=native#text/plain
+packages/base/dbus/dbus-threads.inc svneol=native#text/plain
+packages/base/dbus/dbus-types.inc svneol=native#text/plain
+packages/base/dbus/dbus.pas svneol=native#text/plain
+packages/base/dbus/dbus_arch_deps.inc svneol=native#text/plain
+packages/base/dbus/example/Makefile svneol=native#text/plain
+packages/base/dbus/example/Makefile.fpc svneol=native#text/plain
+packages/base/dbus/example/busexample.pp svneol=native#text/plain
 packages/base/fpmake.inc svneol=native#text/plain
 packages/base/fpmake.inc svneol=native#text/plain
 packages/base/fpmake.pp svneol=native#text/plain
 packages/base/fpmake.pp svneol=native#text/plain
 packages/base/gdbint/Makefile svneol=native#text/plain
 packages/base/gdbint/Makefile svneol=native#text/plain

+ 1766 - 0
packages/base/dbus/Makefile

@@ -0,0 +1,1766 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/08/20]
+#
+default: all
+MAKEFILETARGETS=i386-linux m68k-linux powerpc-linux sparc-linux x86_64-linux arm-linux powerpc64-linux
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx
+LIMIT83fs = go32v2 os2 emx watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override DEFAULT_FPCDIR=../../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+FPC:=$(shell $(FPCPROG) -PB)
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifneq ($(words $(FPC_COMPILERINFO)),5)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+override PACKAGE_NAME=dbus
+override PACKAGE_VERSION=2.0.4
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_UNITS+=dbus
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_UNITS+=dbus
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_UNITS+=dbus
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_UNITS+=dbus
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_UNITS+=dbus
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_UNITS+=dbus
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=dbus
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_EXAMPLEDIRS+=example
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_EXAMPLEDIRS+=example
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_EXAMPLEDIRS+=example
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_EXAMPLEDIRS+=example
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_EXAMPLEDIRS+=example
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_EXAMPLEDIRS+=example
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_EXAMPLEDIRS+=example
+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
+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
+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),m68k-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifdef REQUIRE_PACKAGES_RTL
+PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_RTL),)
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
+UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
+else
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_RTL)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_RTL=
+UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_RTL),)
+UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override COMPILER_UNITDIR+=$(UNITDIR_RTL)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(CPU_TARGET)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX) -Xc
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O1r
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef GCCLIBDIR
+override FPCOPT+=-Fl$(GCCLIBDIR)
+endif
+ifdef OTHERLIBDIR
+override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+EXECPPAS:=@$(PPAS)
+endif
+endif
+.PHONY: fpc_units
+ifneq ($(TARGET_UNITS),)
+override ALLTARGET+=fpc_units
+override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
+override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
+override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+endif
+fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_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 %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_distinstall
+fpc_distinstall: install exampleinstall
+.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
+ifndef PACKDIR
+ifndef inUnix
+PACKDIR=$(BASEDIR)/../fpc-pack
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+ifndef ZIPNAME
+ifdef DIST_ZIPNAME
+ZIPNAME=$(DIST_ZIPNAME)
+else
+ZIPNAME=$(PACKAGE_NAME)
+endif
+endif
+ifndef FULLZIPNAME
+FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
+endif
+ifndef ZIPTARGET
+ifdef DIST_ZIPTARGET
+ZIPTARGET=DIST_ZIPTARGET
+else
+ZIPTARGET=install
+endif
+endif
+ifndef USEZIP
+ifdef inUnix
+USETAR=1
+endif
+endif
+ifndef inUnix
+USEZIPWRAPPER=1
+endif
+ifdef USEZIPWRAPPER
+ZIPPATHSEP=$(PATHSEP)
+ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
+else
+ZIPPATHSEP=/
+endif
+ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
+ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
+ifdef USETAR
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
+ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
+else
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
+ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
+endif
+fpc_zipinstall:
+	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
+	$(MKDIR) $(DIST_DESTDIR)
+	$(DEL) $(ZIPDESTFILE)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
+else
+	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
+	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
+	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
+endif
+ifdef inUnix
+	/bin/sh $(ZIPWRAPPER)
+else
+	$(ZIPWRAPPER)
+endif
+	$(DEL) $(ZIPWRAPPER)
+else
+	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
+endif
+	$(DELTREE) $(PACKDIR)
+fpc_zipsourceinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
+fpc_zipexampleinstall:
+ifdef HASEXAMPLES
+	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
+endif
+fpc_zipdistinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+endif
+ifdef CLEAN_UNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
+endif
+ifdef CLEANPPUFILES
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
+override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+	-$(DELTREE) units
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+	-$(DEL) *.o *.ppu *.a
+endif
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *_ppas$(BATCHEXT)
+ifdef AOUTEXT
+	-$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+	-$(DEL) *$(DEBUGSYMEXT)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+	@$(ECHO)
+	@$(ECHO)  == Package info ==
+	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
+	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC.......... $(FPC)
+	@$(ECHO)  FPC Version.. $(FPC_VERSION)
+	@$(ECHO)  Source CPU... $(CPU_SOURCE)
+	@$(ECHO)  Target CPU... $(CPU_TARGET)
+	@$(ECHO)  Source OS.... $(OS_SOURCE)
+	@$(ECHO)  Target OS.... $(OS_TARGET)
+	@$(ECHO)  Full Source.. $(FULL_SOURCE)
+	@$(ECHO)  Full Target.. $(FULL_TARGET)
+	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
+	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
+	@$(ECHO)
+	@$(ECHO)  == Directory info ==
+	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
+	@$(ECHO)  Basedir......... $(BASEDIR)
+	@$(ECHO)  FPCDir.......... $(FPCDIR)
+	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
+	@$(ECHO)  UnitsDir........ $(UNITSDIR)
+	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
+	@$(ECHO)
+	@$(ECHO)  GCC library..... $(GCCLIBDIR)
+	@$(ECHO)  Other library... $(OTHERLIBDIR)
+	@$(ECHO)
+	@$(ECHO)  == Tools info ==
+	@$(ECHO)
+	@$(ECHO)  As........ $(AS)
+	@$(ECHO)  Ld........ $(LD)
+	@$(ECHO)  Ar........ $(AR)
+	@$(ECHO)  Rc........ $(RC)
+	@$(ECHO)
+	@$(ECHO)  Mv........ $(MVPROG)
+	@$(ECHO)  Cp........ $(CPPROG)
+	@$(ECHO)  Rm........ $(RMPROG)
+	@$(ECHO)  GInstall.. $(GINSTALL)
+	@$(ECHO)  Echo...... $(ECHO)
+	@$(ECHO)  Shell..... $(SHELL)
+	@$(ECHO)  Date...... $(DATE)
+	@$(ECHO)  FPCMake... $(FPCMAKE)
+	@$(ECHO)  PPUMove... $(PPUMOVE)
+	@$(ECHO)  Upx....... $(UPXPROG)
+	@$(ECHO)  Zip....... $(ZIPPROG)
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)
+	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
+	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
+	@$(ECHO)
+	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
+	@$(ECHO)  Install Files....... $(INSTALL_FILES)
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+	@$(ECHO)  DateStr.............. $(DATESTR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
+	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
+	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
+	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
+	@$(ECHO)
+	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
+	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
+	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
+	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
+	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
+	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
+	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
+	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
+	@$(ECHO)
+	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
+	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
+	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+ifeq ($(FULL_TARGET),i386-linux)
+TARGET_EXAMPLEDIRS_EXAMPLE=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+TARGET_EXAMPLEDIRS_EXAMPLE=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+TARGET_EXAMPLEDIRS_EXAMPLE=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+TARGET_EXAMPLEDIRS_EXAMPLE=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+TARGET_EXAMPLEDIRS_EXAMPLE=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+TARGET_EXAMPLEDIRS_EXAMPLE=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+TARGET_EXAMPLEDIRS_EXAMPLE=1
+endif
+ifdef TARGET_EXAMPLEDIRS_EXAMPLE
+example_all:
+	$(MAKE) -C example all
+example_debug:
+	$(MAKE) -C example debug
+example_smart:
+	$(MAKE) -C example smart
+example_release:
+	$(MAKE) -C example release
+example_units:
+	$(MAKE) -C example units
+example_examples:
+	$(MAKE) -C example examples
+example_shared:
+	$(MAKE) -C example shared
+example_install:
+	$(MAKE) -C example install
+example_sourceinstall:
+	$(MAKE) -C example sourceinstall
+example_exampleinstall:
+	$(MAKE) -C example exampleinstall
+example_distinstall:
+	$(MAKE) -C example distinstall
+example_zipinstall:
+	$(MAKE) -C example zipinstall
+example_zipsourceinstall:
+	$(MAKE) -C example zipsourceinstall
+example_zipexampleinstall:
+	$(MAKE) -C example zipexampleinstall
+example_zipdistinstall:
+	$(MAKE) -C example zipdistinstall
+example_clean:
+	$(MAKE) -C example clean
+example_distclean:
+	$(MAKE) -C example distclean
+example_cleanall:
+	$(MAKE) -C example cleanall
+example_info:
+	$(MAKE) -C example info
+example_makefiles:
+	$(MAKE) -C example makefiles
+example:
+	$(MAKE) -C example all
+.PHONY: example_all example_debug example_smart example_release example_units example_examples example_shared example_install example_sourceinstall example_exampleinstall example_distinstall example_zipinstall example_zipsourceinstall example_zipexampleinstall example_zipdistinstall example_clean example_distclean example_cleanall example_info example_makefiles example
+endif
+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 $(addsuffix _clean,$(TARGET_EXAMPLEDIRS))
+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

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

@@ -0,0 +1,22 @@
+#
+#  Makefile.fpc for dbus unit
+#
+
+[package]
+name=dbus
+version=2.0.4
+
+[target]
+units=dbus
+exampledirs=example
+
+[require]
+libc=y
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../../..
+
+[rules]

+ 45 - 0
packages/base/dbus/dbus-address.inc

@@ -0,0 +1,45 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-address.h  Server address parser.
+ *
+ * Copyright (C) 2003  CodeFactory AB
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+//#include <dbus/dbus-types.h>
+//#include <dbus/dbus-errors.h>
+
+type
+
+  DBusAddressEntry = record end;
+
+  PDBusAddressEntry = ^DBusAddressEntry;
+
+  PPDBusAddressEntry = ^PDBusAddressEntry;
+
+  PPPDBusAddressEntry = ^PPDBusAddressEntry;
+
+function dbus_parse_address(const address: PChar; entry: PPPDBusAddressEntry;
+ array_len: PInteger; error: PDBusError): dbus_bool_t; cdecl; external LibDBus;
+function dbus_address_entry_get_value(entry: PDBusAddressEntry; const key: PChar): PChar; cdecl; external LibDBus;
+function dbus_address_entry_get_method(entry: PDBusAddressEntry): PChar; cdecl; external LibDBus;
+procedure dbus_address_entries_free(entries: PPDBusAddressEntry); cdecl; external LibDBus;
+
+function dbus_address_escape_value(const value: PChar): PChar; cdecl; external LibDBus;
+function dbus_address_unescape_value(const value: PChar; error: PDBusError): PChar; cdecl; external LibDBus;
+

+ 46 - 0
packages/base/dbus/dbus-arch-deps.inc

@@ -0,0 +1,46 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir
+ *
+ * Copyright (C) 2003 Red Hat, Inc.
+ *
+ * Licensed under the Academic Free License version 2.0
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+//#include <dbus/dbus-macros.h>
+
+const DBUS_HAVE_INT64 = 1;
+
+type
+  dbus_int64_t = Int64;
+
+  dbus_uint64_t = Int64;
+
+{#define DBUS_INT64_CONSTANT(val)  (val##LL)
+#define DBUS_UINT64_CONSTANT(val) (val##ULL)}
+
+  dbus_int32_t = cint;
+  Pdbus_int32_t = ^dbus_int32_t;
+
+  dbus_uint32_t = cuint;
+  Pdbus_uint32_t = ^dbus_uint32_t;
+
+  dbus_int16_t = cshort;
+  dbus_uint16_t = cushort;
+
+  size_t = Integer;
+

+ 52 - 0
packages/base/dbus/dbus-bus.inc

@@ -0,0 +1,52 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-bus.h  Convenience functions for communicating with the bus.
+ *
+ * Copyright (C) 2003  CodeFactory AB
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+//#include <dbus/dbus-connection.h>
+
+function dbus_bus_get(type_: DBusBusType; error: PDBusError): PDBusConnection; cdecl; external LibDBus;
+function dbus_bus_get_private(type_: DBusBusType; error: PDBusError): PDBusConnection; cdecl; external LibDBus;
+ 
+function dbus_bus_register(connection: PDBusConnection; error: PDBusError): dbus_bool_t; cdecl; external LibDBus;
+function dbus_bus_set_unique_name(connection: PDBusConnection;
+ const unique_name: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_bus_get_unique_name(connection: PDBusConnection): PChar; cdecl; external LibDBus;
+function dbus_bus_get_unix_user(connection: PDBusConnection;
+ const name: PChar; error: PDBusError): culong; cdecl; external LibDBus;
+function dbus_bus_request_name(connection: PDBusConnection;
+ const name: PChar; flags: cuint; error: PDBusError): cint; cdecl; external LibDBus;
+function dbus_bus_release_name(connection: PDBusConnection;
+ const name: PChar; error: PDBusError): cint; cdecl; external LibDBus;
+function dbus_bus_name_has_owner(connection: PDBusConnection;
+ const name: PChar; error: PDBusError): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_bus_start_service_by_name (connection: PDBusConnection;
+ const name: PChar; flags: dbus_uint32_t; reply: Pdbus_uint32_t;
+ error: PDBusError): dbus_bool_t; cdecl; external LibDBus;
+
+procedure dbus_bus_add_match(connection: PDBusConnection;
+ const rule: PChar; error: PDBusError); cdecl; external LibDBus;
+procedure dbus_bus_remove_match(connection: PDBusConnection;
+ const rule: PChar; error: PDBusError); cdecl; external LibDBus;
+
+procedure _dbus_bus_check_connection_and_unref (connection: PDBusConnection); cdecl; external LibDBus;
+

+ 236 - 0
packages/base/dbus/dbus-connection.inc

@@ -0,0 +1,236 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-connection.h DBusConnection object
+ *
+ * Copyright (C) 2002, 2003  Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{#include <dbus/dbus-errors.h>}
+{.$include dbus-memory.inc}
+{#include <dbus/dbus-message.h>}
+{.$include dbus-shared.inc}
+
+type
+  DBusWatch = record end;
+  PDBusWatch = ^DBusWatch;
+
+  DBusTimeout = record end;
+  PDBusTimeout = ^DBusTimeout;
+
+  DBusPreallocatedSend = record end;
+  PDBusPreallocatedSend = ^DBusPreallocatedSend;
+
+  DBusPendingCall = record end;
+  PDBusPendingCall = ^DBusPendingCall;
+  PPDBusPendingCall = ^PDBusPendingCall;
+
+  DBusConnection = record end;
+  PDBusConnection = ^DBusConnection;
+
+  DBusWatchFlags =
+  (
+    DBUS_WATCH_READABLE = 1 shl 0, {< As in POLLIN }
+    DBUS_WATCH_WRITABLE = 1 shl 1, {< As in POLLOUT }
+    DBUS_WATCH_ERROR    = 1 shl 2, {< As in POLLERR (can't watch for this, but
+                                 *   the flag can be passed to dbus_watch_handle()).}
+    DBUS_WATCH_HANGUP   = 1 shl 3  {< As in POLLHUP (can't watch for it, but
+                                 *   can be present in current state). }
+  );
+
+  DBusDispatchStatus =
+  (
+    DBUS_DISPATCH_DATA_REMAINS,  {< There is more data to potentially convert to messages. }
+    DBUS_DISPATCH_COMPLETE,      {< All currently available data has been processed. }
+    DBUS_DISPATCH_NEED_MEMORY    {< More memory is needed to continue. }
+  );
+
+  DBusAddWatchFunction = function (watch: PDBusWatch; data: Pointer): dbus_bool_t;
+  DBusWatchToggledFunction = procedure(watch: PDBusWatch; data: Pointer);
+  DBusRemoveWatchFunction = procedure(watch: PDBusWatch; data: Pointer);
+  DBusAddTimeoutFunction = function(timeout: PDBusTimeout; data: Pointer): dbus_bool_t;
+  DBusTimeoutToggledFunction = procedure(timeout: PDBusTimeout; data: Pointer);
+  DBusRemoveTimeoutFunction = procedure(timeout: PDBusTimeout; data: Pointer);
+  DBusDispatchStatusFunction = procedure(connection: PDBusConnection;
+   new_status: DBusDispatchStatus; data: Pointer);
+  DBusWakeupMainFunction = procedure(data: Pointer);
+  DBusAllowUnixUserFunction = function(connection: PDBusConnection;
+   uid: cuint; data: Pointer): dbus_bool_t;
+
+  DBusPendingCallNotifyFunction = procedure(pending: PDBusPendingCall;
+   user_data: Pointer);
+
+  DBusHandleMessageFunction = function(connection: PDBusConnection;
+   message_: PDBusMessage; user_data: Pointer): DBusHandlerResult;
+
+function dbus_connection_open(const address: PChar; error: PDBusError): PDBusConnection; cdecl; external LibDBus;
+function dbus_connection_open_private(const address: PChar; error: PDBusError): PDBusConnection; cdecl; external LibDBus;
+function dbus_connection_ref(connection: PDBusConnection): PDBusConnection; cdecl; external LibDBus;
+procedure dbus_connection_unref(connection: PDBusConnection); cdecl; external LibDBus;
+procedure dbus_connection_close(connection: PDBusConnection); cdecl; external LibDBus;
+function dbus_connection_get_is_connected(connection: PDBusConnection): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_get_is_authenticated(connection: PDBusConnection): dbus_bool_t; cdecl; external LibDBus;
+procedure dbus_connection_set_exit_on_disconnect(connection: PDBusConnection;
+ exit_on_disconnect: dbus_bool_t); cdecl; external LibDBus;
+procedure dbus_connection_flush(connection: PDBusConnection); cdecl; external LibDBus;
+function dbus_connection_read_write_dispatch(connection: PDBusConnection;
+ timeout_milliseconds: Integer): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_read_write(connection: PDBusConnection;
+ timeout_milliseconds: Integer): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_borrow_message(connection: PDBusConnection): PDBusMessage; cdecl; external LibDBus;
+procedure dbus_connection_return_message(connection: PDBusConnection; message_: PDBusMessage); cdecl; external LibDBus;
+procedure dbus_connection_steal_borrowed_message(connection: PDBusConnection; message_: PDBusMessage); cdecl; external LibDBus;
+function dbus_connection_pop_message(connection: PDBusConnection): PDBusMessage; cdecl; external LibDBus;
+function dbus_connection_get_dispatch_status(connection: PDBusConnection): DBusDispatchStatus; cdecl; external LibDBus;
+function dbus_connection_dispatch(connection: PDBusConnection): DBusDispatchStatus; cdecl; external LibDBus;
+function dbus_connection_has_messages_to_send(connection: PDBusConnection): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_send(connection: PDBusConnection; message_: PDBusMessage;
+ client_serial: Pdbus_uint32_t): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_send_with_reply(connection: PDBusConnection;
+ message_: PDBusMessage;
+ pending_return: PPDBusPendingCall;
+ timeout_milliseconds: cint): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_send_with_reply_and_block(connection: PDBusConnection;
+ message_: PDBusMessage;
+ timeout_milliseconds: cint;
+ error: PDBusError): PDBusMessage; cdecl; external LibDBus;
+function dbus_connection_set_watch_functions(connection: PDBusConnection;
+ add_function: DBusAddWatchFunction;
+ remove_function: DBusRemoveWatchFunction;
+ toggled_function: DBusWatchToggledFunction;
+ data: Pointer;
+ free_data_function: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_set_timeout_functions(connection: PDBusConnection;
+ add_function: DBusAddTimeoutFunction;
+ remove_function: DBusRemoveTimeoutFunction;
+ toggled_function: DBusTimeoutToggledFunction;
+ data: Pointer;
+ free_data_function: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+procedure dbus_connection_set_wakeup_main_function(connection: PDBusConnection;
+ wakeup_main_function: DBusWakeupMainFunction;
+ data: Pointer;
+ free_data_function: DBusFreeFunction); cdecl; external LibDBus;
+procedure dbus_connection_set_dispatch_status_function (connection: PDBusConnection;
+ function_: DBusDispatchStatusFunction;
+ data: Pointer;
+ free_data_function: DBusFreeFunction); cdecl; external LibDBus;
+function dbus_connection_get_unix_user(connection: PDBusConnection;
+ uid: Pculong): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_get_unix_process_id(connection: PDBusConnection;
+ pid: Pculong): dbus_bool_t; cdecl; external LibDBus;
+procedure dbus_connection_set_unix_user_function(connection: PDBusConnection;
+ function_: DBusAllowUnixUserFunction;
+ data: Pointer;
+ free_data_function: DBusFreeFunction); cdecl; external LibDBus;
+
+
+function dbus_watch_get_fd(watch: PDBusWatch): cint; cdecl; external LibDBus;
+function dbus_watch_get_flags(watch: PDBusWatch): cuint; cdecl; external LibDBus;
+function dbus_watch_get_data(watch: PDBusWatch): Pointer; cdecl; external LibDBus;
+procedure dbus_watch_set_data(watch: PDBusWatch;
+ data: Pointer; free_data_function: DBusFreeFunction); cdecl; external LibDBus;
+function dbus_watch_handle(watch: PDBusWatch; flags: cuint): dbus_bool_t; cdecl; external LibDBus;
+function  dbus_watch_get_enabled(watch: PDBusWatch): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_timeout_get_interval(timeout: PDBusTimeout): cint; cdecl; external LibDBus;
+function dbus_timeout_get_data(timeout: PDBusTimeout): Pointer; cdecl; external LibDBus;
+procedure dbus_timeout_set_data(timeout: PDBusTimeout;
+ data: Pointer; free_data_function: DBusFreeFunction); cdecl; external LibDBus;
+function dbus_timeout_handle(timeout: PDBusTimeout): dbus_bool_t; cdecl; external LibDBus;
+function dbus_timeout_get_enabled(timeout: PDBusTimeout): dbus_bool_t; cdecl; external LibDBus;
+
+{ Filters }
+
+function dbus_connection_add_filter(connection: PDBusConnection;
+ function_: DBusHandleMessageFunction;
+ user_data: Pointer; free_data_function: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+procedure dbus_connection_remove_filter (connection: PDBusConnection;
+ function_: DBusHandleMessageFunction; user_data: Pointer); cdecl; external LibDBus;
+
+
+{ Other }
+function dbus_connection_allocate_data_slot (slot_p: Pdbus_int32_t): dbus_bool_t; cdecl; external LibDBus;
+procedure dbus_connection_free_data_slot     (slot_p: Pdbus_int32_t); cdecl; external LibDBus;
+function dbus_connection_set_data(connection: PDBusConnection;
+ slot: dbus_int32_t; data: Pointer; free_data_func: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_get_data(connection: PDBusConnection; slot: dbus_int32_t): Pointer; cdecl; external LibDBus;
+
+procedure dbus_connection_set_change_sigpipe (will_modify_sigpipe: dbus_bool_t); cdecl; external LibDBus;
+
+procedure dbus_connection_set_max_message_size  (connection: PDBusConnection; size: clong); cdecl; external LibDBus;
+function dbus_connection_get_max_message_size  (connection: PDBusConnection): clong; cdecl; external LibDBus;
+procedure dbus_connection_set_max_received_size (connection: PDBusConnection; size: clong); cdecl; external LibDBus;
+function dbus_connection_get_max_received_size (connection: PDBusConnection): clong; cdecl; external LibDBus;
+function dbus_connection_get_outgoing_size     (connection: PDBusConnection): clong; cdecl; external LibDBus;
+
+function dbus_connection_preallocate_send       (connection: PDBusConnection): PDBusPreallocatedSend; cdecl; external LibDBus;
+procedure dbus_connection_free_preallocated_send (connection: PDBusConnection; preallocated: PDBusPreallocatedSend); cdecl; external LibDBus;
+procedure dbus_connection_send_preallocated      (connection: PDBusConnection;
+ preallocated: PDBusPreallocatedSend;
+ message_: PDBusMessage; client_serial: Pdbus_uint32_t); cdecl; external LibDBus;
+
+
+{ Object tree functionality }
+
+type
+  DBusObjectPathUnregisterFunction = procedure(connection: PDBusConnection;
+   user_data: Pointer);
+  DBusObjectPathMessageFunction = function(connection: PDBusConnection;
+   message_: PDBusMessage; user_data: Pointer): DBusHandlerResult;
+
+{
+ * Virtual table that must be implemented to handle a portion of the
+ * object path hierarchy.
+ }
+  dbus_internal_func = procedure(param1: Pointer);
+
+  PDBusObjectPathVTable = ^DBusObjectPathVTable;
+
+  DBusObjectPathVTable = record
+
+    unregister_function: DBusObjectPathUnregisterFunction; {< Function to unregister this handler }
+    message_function: DBusObjectPathMessageFunction; {< Function to handle messages }
+  
+    dbus_internal_pad1: dbus_internal_func; {< Reserved for future expansion }
+    dbus_internal_pad2: dbus_internal_func; {< Reserved for future expansion }
+    dbus_internal_pad3: dbus_internal_func; {< Reserved for future expansion }
+    dbus_internal_pad4: dbus_internal_func; {< Reserved for future expansion }
+  end;
+
+function dbus_connection_register_object_path(connection: PDBusConnection;
+ const path: PChar;
+ const vtable: PDBusObjectPathVTable;
+ user_data: Pointer): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_register_fallback(connection: PDBusConnection;
+ const path: PChar;
+ const vtable: PDBusObjectPathVTable;
+ user_data: Pointer): dbus_bool_t; cdecl; external LibDBus;
+function dbus_connection_unregister_object_path(connection: PDBusConnection;
+ const path: PChar): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_connection_get_object_path_data(connection: PDBusConnection;
+ const path: PChar;
+ data_p: PPointer): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_connection_list_registered(connection: PDBusConnection;
+ const parent_path: PChar;
+ child_entries: PPPChar): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_connection_get_unix_fd(connection: PDBusConnection;
+ fd: Pcint): dbus_bool_t; cdecl; external LibDBus;
+

+ 54 - 0
packages/base/dbus/dbus-errors.inc

@@ -0,0 +1,54 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-errors.h Error reporting
+ *
+ * Copyright (C) 2002  Red Hat Inc.
+ * Copyright (C) 2003  CodeFactory AB
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+//#include <dbus/dbus-macros.h>
+//#include <dbus/dbus-types.h>
+
+type
+  PDBusError = ^DBusError;
+
+{
+ * Object representing an exception.
+ }
+  DBusError = record
+    name: PChar;    {< error name }
+    message: PChar; {< error message }
+
+    dummy1: cuint; //: 1; {< placeholder }
+//  unsigned int dummy2 : 1; {< placeholder }
+//  unsigned int dummy3 : 1; {< placeholder }
+//  unsigned int dummy4 : 1; {< placeholder }
+//  unsigned int dummy5 : 1; {< placeholder }
+
+    padding1: Pointer; {< placeholder }
+  end;
+
+procedure dbus_error_init(error: PDBusError); cdecl; external LibDBus;
+procedure dbus_error_free(error: PDBusError); cdecl; external LibDBus;
+procedure dbus_set_error(error: PDBusError; const name, message: PChar; others: array of const); cdecl; external LibDBus;
+procedure dbus_set_error_const(error: PDBusError; const name, message: PChar); cdecl; external LibDBus;
+procedure dbus_move_error(src, dest: PDBusError); cdecl; external LibDBus;
+function dbus_error_has_name(const error: PDBusError; const name: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_error_is_set(const error: PDBusError): dbus_bool_t; cdecl; external LibDBus;
+

+ 63 - 0
packages/base/dbus/dbus-macros.inc

@@ -0,0 +1,63 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-macros.h  generic macros
+ *
+ * Copyright (C) 2002  Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{ Normally docs are in .c files, but there isn't a .c file for this. }
+{
+ * @defgroup DBusMacros Utility macros
+ * @ingroup  DBus
+ * @brief #TRUE, #FALSE, #NULL, and so on
+ *
+ * Utility macros.
+ *
+ }
+
+{
+ * @def DBUS_BEGIN_DECLS
+ *
+ * Macro used prior to declaring functions in the D-Bus header
+ * files. Expands to "extern "C"" when using a C++ compiler,
+ * and expands to nothing when using a C compiler.
+ }
+{
+ * @def DBUS_END_DECLS
+ *
+ * Macro used after declaring functions in the D-Bus header
+ * files. Expands to "}{" when using a C++ compiler,
+ * and expands to nothing when using a C compiler.
+ }
+{
+ * @def TRUE
+ *
+ * Expands to "1"
+ }
+{
+ * @def FALSE
+ *
+ * Expands to "0"
+ }
+{
+ * @def NULL
+ *
+ * A null pointer, defined appropriately for C or C++.
+ }
+

+ 41 - 0
packages/base/dbus/dbus-memory.inc

@@ -0,0 +1,41 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-memory.h  D-Bus memory handling
+ *
+ * Copyright (C) 2002  Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{#include <dbus/dbus-macros.h>
+#include <stddef.h>}
+
+function dbus_malloc(bytes: size_t): Pointer; cdecl; external LibDBus;
+function dbus_malloc0(bytes: size_t): Pointer; cdecl; external LibDBus;
+function dbus_realloc(memory: Pointer; bytes: size_t): Pointer; cdecl; external LibDBus;
+procedure dbus_free(memory: Pointer); cdecl; external LibDBus;
+
+//#define dbus_new(type, count)  ((type*)dbus_malloc (sizeof (type) * (count)));
+//#define dbus_new0(type, count) ((type*)dbus_malloc0 (sizeof (type) * (count)));
+
+procedure dbus_free_string_array(str_array: PPChar); cdecl; external LibDBus;
+
+type
+  DBusFreeFunction = procedure(memory: Pointer);
+
+procedure dbus_shutdown; cdecl; external LibDBus;
+

+ 166 - 0
packages/base/dbus/dbus-message.inc

@@ -0,0 +1,166 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-message.h DBusMessage object
+ *
+ * Copyright (C) 2002, 2003, 2005 Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{#include <dbus/dbus-macros.h>
+#include <dbus/dbus-types.h>
+#include <dbus/dbus-arch-deps.h>}
+{$include dbus-memory.inc}
+{#include <dbus/dbus-errors.h>
+#include <stdarg.h>}
+
+type
+  DBusMessage = record end;
+  PDBusMessage = ^DBusMessage;
+
+  PDBusMessageIter = ^DBusMessageIter;
+
+{
+ * DBusMessageIter struct; contains no public fields 
+ }
+  DBusMessageIter = record
+   dummy1: Pointer;        {< Don't use this }
+   dummy2: Pointer;        {< Don't use this }
+   dummy3: dbus_uint32_t;  {< Don't use this }
+   dummy4: cint;           {< Don't use this }
+   dummy5: cint;           {< Don't use this }
+   dummy6: cint;           {< Don't use this }
+   dummy7: cint;           {< Don't use this }
+   dummy8: cint;           {< Don't use this }
+   dummy9: cint;           {< Don't use this }
+   dummy10: cint;          {< Don't use this }
+   dummy11: cint;          {< Don't use this }
+   pad1: cint;             {< Don't use this }
+   pad2: cint;             {< Don't use this }
+   pad3: Pointer           {< Don't use this }
+  end;
+
+function dbus_message_new(message_type: Integer): PDBusMessage; cdecl; external LibDBus;
+function dbus_message_new_method_call(
+ const bus_name, path, interface_, method: PChar): PDBusMessage; cdecl; external LibDBus;
+function dbus_message_new_method_return(method_call: PDBusMessage): PDBusMessage; cdecl; external LibDBus;
+function dbus_message_new_signal(const path, interface_, name: PChar): PDBusMessage; cdecl; external LibDBus;
+function dbus_message_new_error(reply_to: PDBusMessage;
+ const error_name, error_message: PChar): PDBusMessage; cdecl; external LibDBus;
+function dbus_message_new_error_printf(reply_to: PDBusMessage;
+ const error_name, error_format: PChar;
+ others: array of const): PDBusMessage; cdecl; external LibDBus;
+
+function dbus_message_copy(const message_: PDBusMessage): PDBusMessage; cdecl; external LibDBus;
+
+function dbus_message_ref(message_: PDBusMessage): PDBusMessage; cdecl; external LibDBus;
+procedure dbus_message_unref(message_: PDBusMessage); cdecl; external LibDBus;
+function dbus_message_get_type(message_: PDBusMessage): cint; cdecl; external LibDBus;
+function dbus_message_set_path(message_: PDBusMessage;
+ const object_path: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_path(message_: PDBusMessage): PChar; cdecl; external LibDBus;
+function dbus_message_has_path(message_: PDBusMessage;
+ const object_path: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_set_interface(message_: PDBusMessage;
+ const interface_: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_interface(message_: PDBusMessage): PChar; cdecl; external LibDBus;
+function dbus_message_has_interface(message_: PDBusMessage;
+ const interface_: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_set_member(message_: PDBusMessage;
+ const member: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_member(message_: PDBusMessage): PChar; cdecl; external LibDBus;
+function dbus_message_has_member(message_: PDBusMessage;
+ const member: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_set_error_name(message_: PDBusMessage;
+ const name: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_error_name(message_: PDBusMessage): PChar; cdecl; external LibDBus;
+function dbus_message_set_destination(message_: PDBusMessage;
+ const destination: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_destination(message_: PDBusMessage): PChar; cdecl; external LibDBus;
+function dbus_message_set_sender(message_: PDBusMessage;
+ const sender: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_sender(message_: PDBusMessage): PChar; cdecl; external LibDBus;
+function dbus_message_get_signature(message_: PDBusMessage): PChar; cdecl; external LibDBus;
+procedure dbus_message_set_no_reply(message_: PDBusMessage;
+ no_reply: dbus_bool_t); cdecl; external LibDBus;
+function dbus_message_get_no_reply(message_: PDBusMessage): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_is_method_call(message_: PDBusMessage;
+ const interface_, method: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_is_signal(message_: PDBusMessage;
+ const interface_, signal_name: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_is_error(message_: PDBusMessage;
+ const error_name: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_has_destination(message_: PDBusMessage;
+ const bus_name: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_has_sender(message_: PDBusMessage;
+ const unique_bus_name: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_has_signature(message_: PDBusMessage;
+ const signature: PChar): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_serial(message_: PDBusMessage): dbus_uint32_t; cdecl; external LibDBus;
+function dbus_message_set_reply_serial(message_: PDBusMessage;
+ reply_serial: dbus_uint32_t): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_reply_serial(message_: PDBusMessage): dbus_uint32_t; cdecl; external LibDBus;
+
+procedure dbus_message_set_auto_start(message_: PDBusMessage; auto_start: dbus_bool_t); cdecl; external LibDBus;
+function dbus_message_get_auto_start(message_: PDBusMessage): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_message_get_path_decomposed(message_: PDBusMessage; path: PPPChar): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_message_append_args(message_: PDBusMessage;
+ first_arg_type: cint; others: array of const): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_append_args_valist(message_: PDBusMessage;
+ first_arg_type: cint; var_args: va_list): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_args(message_: PDBusMessage;
+ error: PDBusError; first_arg_type: cint; others: array of const): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_args_valist(message_: PDBusMessage;
+ error: PDBusError; first_arg_type: cint; var_args: va_list): dbus_bool_t; cdecl; external LibDBus;
+
+
+function dbus_message_iter_init(message_: PDBusMessage; iter: PDBusMessageIter): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_iter_has_next(iter: PDBusMessageIter): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_iter_next(iter: PDBusMessageIter): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_iter_get_signature(iter: PDBusMessageIter): PChar; cdecl; external LibDBus;
+function dbus_message_iter_get_arg_type(iter: PDBusMessageIter): cint; cdecl; external LibDBus;
+function dbus_message_iter_get_element_type(iter: PDBusMessageIter): cint; cdecl; external LibDBus;
+procedure dbus_message_iter_recurse(iter, sub: PDBusMessageIter); cdecl; external LibDBus;
+procedure dbus_message_iter_get_basic(iter: PDBusMessageIter; value: Pointer); cdecl; external LibDBus;
+function dbus_message_iter_get_array_len(iter: PDBusMessageIter): cint; cdecl; external LibDBus;
+procedure dbus_message_iter_get_fixed_array(iter: PDBusMessageIter; value: Pointer; n_elements: Pcint); cdecl; external LibDBus;
+
+
+procedure dbus_message_iter_init_append(message_: PDBusMessage; iter: PDBusMessageIter); cdecl; external LibDBus;
+function dbus_message_iter_append_basic(iter: PDBusMessageIter;
+ type_: cint; const value: Pointer): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_iter_append_fixed_array(iter: PDBusMessageIter;
+ element_type: cint; const value: Pointer; n_elements: cint): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_iter_open_container(iter: PDBusMessageIter;
+ type_: cint; const contained_signature: PChar; sub: PDBusMessageIter): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_iter_close_container(iter, sub: PDBusMessageIter): dbus_bool_t; cdecl; external LibDBus;
+
+
+function dbus_set_error_from_message(error: PDBusError; message_: PDBusMessage): dbus_bool_t; cdecl; external LibDBus;
+
+
+function dbus_message_allocate_data_slot(slot_p: Pdbus_int32_t): dbus_bool_t; cdecl; external LibDBus;
+procedure dbus_message_free_data_slot(slot_p: Pdbus_int32_t); cdecl; external LibDBus;
+function dbus_message_set_data(message_: PDBusMessage;
+ slot: dbus_int32_t; data: Pointer; free_data_func: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+function dbus_message_get_data(message_: PDBusMessage; slot: dbus_int32_t): Pointer; cdecl; external LibDBus;
+
+function dbus_message_type_from_string(const type_str: PChar): cint; cdecl; external LibDBus;
+function dbus_message_type_to_string(type_: cint): PChar; cdecl; external LibDBus;
+

+ 43 - 0
packages/base/dbus/dbus-pending-call.inc

@@ -0,0 +1,43 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-pending-call.h Object representing a call in progress.
+ *
+ * Copyright (C) 2002, 2003 Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{#include <dbus/dbus-macros.h>
+#include <dbus/dbus-types.h>
+#include <dbus/dbus-connection.h>}
+
+function dbus_pending_call_ref(pending: PDBusPendingCall): PDBusPendingCall; cdecl; external LibDBus;
+procedure dbus_pending_call_unref(pending: PDBusPendingCall); cdecl; external LibDBus;
+function dbus_pending_call_set_notify(pending: PDBusPendingCall;
+ function_: DBusPendingCallNotifyFunction;
+ user_data: Pointer; free_user_data: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+procedure dbus_pending_call_cancel(pending: PDBusPendingCall); cdecl; external LibDBus;
+function dbus_pending_call_get_completed(pending: PDBusPendingCall): dbus_bool_t; cdecl; external LibDBus;
+function dbus_pending_call_steal_reply(pending: PDBusPendingCall): PDBusMessage; cdecl; external LibDBus;
+procedure dbus_pending_call_block(pending: PDBusPendingCall); cdecl; external LibDBus;
+
+function dbus_pending_call_allocate_data_slot(slot_p: Pdbus_int32_t): dbus_bool_t; cdecl; external LibDBus;
+procedure dbus_pending_call_free_data_slot(slot_p: Pdbus_int32_t); cdecl; external LibDBus;
+function dbus_pending_call_set_data(pending: PDBusPendingCall;
+ slot: dbus_int32_t; data: Pointer; free_data_func: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+function dbus_pending_call_get_data(pending: PDBusPendingCall; slot: dbus_int32_t): Pointer; cdecl; external LibDBus;
+

+ 251 - 0
packages/base/dbus/dbus-protocol.inc

@@ -0,0 +1,251 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-protocol.h  D-Bus protocol constants
+ *
+ * Copyright (C) 2002, 2003  CodeFactory AB
+ * Copyright (C) 2004, 2005 Red Hat, Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{ Normally docs are in .c files, but there isn't a .c file for this. }
+{
+ * @defgroup DBusProtocol Protocol constants
+ * @ingroup  DBus
+ *
+ * D-Bus protocol constants
+ *
+ * @brief  Defines constants which are part of the D-Bus protocol
+ }
+
+const
+
+{ Message byte order }
+  DBUS_LITTLE_ENDIAN = 'l';  {< LSB first }
+  DBUS_BIG_ENDIAN    = 'B';  {< MSB first }
+
+{ Protocol version }
+  DBUS_MAJOR_PROTOCOL_VERSION = 1;
+
+{ Never a legitimate type }
+  DBUS_TYPE_INVALID      = 0;
+  DBUS_TYPE_INVALID_AS_STRING = #0;
+
+{ Primitive types }
+  DBUS_TYPE_BYTE         = Integer('y');
+  DBUS_TYPE_BYTE_AS_STRING = 'y';
+  DBUS_TYPE_BOOLEAN      = Integer('b');
+  DBUS_TYPE_BOOLEAN_AS_STRING =       'b';
+  DBUS_TYPE_INT16        = Integer('n');
+  DBUS_TYPE_INT16_AS_STRING         = 'n';
+  DBUS_TYPE_UINT16       = Integer('q');
+  DBUS_TYPE_UINT16_AS_STRING        = 'q';
+  DBUS_TYPE_INT32        = Integer('i');
+  DBUS_TYPE_INT32_AS_STRING         = 'i';
+  DBUS_TYPE_UINT32       = Integer('u');
+  DBUS_TYPE_UINT32_AS_STRING        = 'u';
+  DBUS_TYPE_INT64        = Integer('x');
+  DBUS_TYPE_INT64_AS_STRING         = 'x';
+  DBUS_TYPE_UINT64       = Integer('t');
+  DBUS_TYPE_UINT64_AS_STRING        = 't';
+  DBUS_TYPE_DOUBLE       = Integer('d');
+  DBUS_TYPE_DOUBLE_AS_STRING        = 'd';
+  DBUS_TYPE_STRING       = Integer('s');
+  DBUS_TYPE_STRING_AS_STRING        = 's';
+  DBUS_TYPE_OBJECT_PATH  = Integer('o');
+  DBUS_TYPE_OBJECT_PATH_AS_STRING   = 'o';
+  DBUS_TYPE_SIGNATURE    = Integer('g');
+  DBUS_TYPE_SIGNATURE_AS_STRING     = 'g';
+
+{ Compound types }
+  DBUS_TYPE_ARRAY        = Integer('a');
+  DBUS_TYPE_ARRAY_AS_STRING         = 'a';
+  DBUS_TYPE_VARIANT      = Integer('v');
+  DBUS_TYPE_VARIANT_AS_STRING       = 'v';
+
+{ STRUCT and DICT_ENTRY are sort of special since their codes can't
+ * appear in a type string, instead
+ * DBUS_STRUCT_BEGIN_CHAR/DBUS_DICT_ENTRY_BEGIN_CHAR have to appear
+ }
+  DBUS_TYPE_STRUCT       = Integer('r');
+  DBUS_TYPE_STRUCT_AS_STRING        = 'r';
+  DBUS_TYPE_DICT_ENTRY   = Integer('e');
+  DBUS_TYPE_DICT_ENTRY_AS_STRING    = 'e';
+
+{ Does not count INVALID }
+  DBUS_NUMBER_OF_TYPES   = (16);
+
+{ characters other than typecodes that appear in type signatures }
+  DBUS_STRUCT_BEGIN_CHAR  = Integer('(');
+  DBUS_STRUCT_BEGIN_CHAR_AS_STRING  = '(';
+  DBUS_STRUCT_END_CHAR    = Integer(')');
+  DBUS_STRUCT_END_CHAR_AS_STRING    = ')';
+  DBUS_DICT_ENTRY_BEGIN_CHAR  = Integer('{');
+  DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING  = '{';
+  DBUS_DICT_ENTRY_END_CHAR    = Integer('}');
+  DBUS_DICT_ENTRY_END_CHAR_AS_STRING    = '}';
+
+{ Max length in bytes of a bus name, interface, or member (not object
+ * path, paths are unlimited). This is limited because lots of stuff
+ * is O(n) in this number, plus it would be obnoxious to type in a
+ * paragraph-long method name so most likely something like that would
+ * be an exploit.
+ }
+  DBUS_MAXIMUM_NAME_LENGTH = 255;
+
+{ This one is 255 so it fits in a byte }
+  DBUS_MAXIMUM_SIGNATURE_LENGTH = 255;
+
+{ Max length of a match rule string; to keep people from hosing the
+ * daemon with some huge rule
+ }
+  DBUS_MAXIMUM_MATCH_RULE_LENGTH = 1024;
+
+{ Max arg number you can match on in a match rule, e.g.
+ * arg0='hello' is OK, arg3489720987='hello' is not
+ }
+  DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER = 63;
+  
+{ Max length of a marshaled array in bytes (64M, 2^26) We use signed
+ * int for lengths so must be INT_MAX or less.  We need something a
+ * bit smaller than INT_MAX because the array is inside a message with
+ * header info, etc.  so an INT_MAX array wouldn't allow the message
+ * overhead.  The 64M number is an attempt at a larger number than
+ * we'd reasonably ever use, but small enough that your bus would chew
+ * through it fairly quickly without locking up forever. If you have
+ * data that's likely to be larger than this, you should probably be
+ * sending it in multiple incremental messages anyhow.
+ }
+  DBUS_MAXIMUM_ARRAY_LENGTH = (67108864);
+{ Number of bits you need in an unsigned to store the max array size }
+  DBUS_MAXIMUM_ARRAY_LENGTH_BITS = 26;
+
+{ The maximum total message size including header and body; similar
+ * rationale to max array size.
+ }
+  DBUS_MAXIMUM_MESSAGE_LENGTH = (DBUS_MAXIMUM_ARRAY_LENGTH * 2);
+{ Number of bits you need in an unsigned to store the max message size }
+  DBUS_MAXIMUM_MESSAGE_LENGTH_BITS = 27;
+
+{ Depth of recursion in the type tree. This is automatically limited
+ * to DBUS_MAXIMUM_SIGNATURE_LENGTH since you could only have an array
+ * of array of array of ... that fit in the max signature.  But that's
+ * probably a bit too large.
+ }
+  DBUS_MAXIMUM_TYPE_RECURSION_DEPTH = 32;
+
+{ Types of message }
+  DBUS_MESSAGE_TYPE_INVALID      = 0;
+  DBUS_MESSAGE_TYPE_METHOD_CALL  = 1;
+  DBUS_MESSAGE_TYPE_METHOD_RETURN= 2;
+  DBUS_MESSAGE_TYPE_ERROR        = 3;
+  DBUS_MESSAGE_TYPE_SIGNAL       = 4;
+
+{ Header flags }
+  DBUS_HEADER_FLAG_NO_REPLY_EXPECTED = $1;
+  DBUS_HEADER_FLAG_NO_AUTO_START     = $2;
+
+{ Header fields }
+  DBUS_HEADER_FIELD_INVALID       = 0;
+  DBUS_HEADER_FIELD_PATH          = 1;
+  DBUS_HEADER_FIELD_INTERFACE     = 2;
+  DBUS_HEADER_FIELD_MEMBER        = 3;
+  DBUS_HEADER_FIELD_ERROR_NAME    = 4;
+  DBUS_HEADER_FIELD_REPLY_SERIAL  = 5;
+  DBUS_HEADER_FIELD_DESTINATION   = 6;
+  DBUS_HEADER_FIELD_SENDER        = 7;
+  DBUS_HEADER_FIELD_SIGNATURE     = 8;
+
+  DBUS_HEADER_FIELD_LAST = DBUS_HEADER_FIELD_SIGNATURE;
+
+{ Header format is defined as a signature:
+ *   byte                            byte order
+ *   byte                            message type ID
+ *   byte                            flags
+ *   byte                            protocol version
+ *   uint32                          body length
+ *   uint32                          serial
+ *   array of struct (byte,variant)  (field name, value)
+ *
+ * The length of the header can be computed as the
+ * fixed size of the initial data, plus the length of
+ * the array at the end, plus padding to an 8-boundary.
+ }
+{  DBUS_HEADER_SIGNATURE                   \
+     DBUS_TYPE_BYTE_AS_STRING                   \
+     DBUS_TYPE_BYTE_AS_STRING                   \
+     DBUS_TYPE_BYTE_AS_STRING                   \
+     DBUS_TYPE_BYTE_AS_STRING                   \
+     DBUS_TYPE_UINT32_AS_STRING                 \
+     DBUS_TYPE_UINT32_AS_STRING                 \
+     DBUS_TYPE_ARRAY_AS_STRING                  \
+     DBUS_STRUCT_BEGIN_CHAR_AS_STRING           \
+     DBUS_TYPE_BYTE_AS_STRING                   \
+     DBUS_TYPE_VARIANT_AS_STRING                \
+     DBUS_STRUCT_END_CHAR_AS_STRING}
+
+
+{
+ * The smallest header size that can occur.  (It won't be valid due to
+ * missing required header fields.) This is 4 bytes, two uint32, an
+ * array length. This isn't any kind of resource limit, just the
+ * necessary/logical outcome of the header signature.
+ }
+  DBUS_MINIMUM_HEADER_SIZE = 16;
+
+{ Errors }
+{ WARNING these get autoconverted to an enum in dbus-glib.h. Thus,
+ * if you change the order it breaks the ABI. Keep them in order.
+ * Also, don't change the formatting since that will break the sed
+ * script.
+ }
+  DBUS_ERROR_FAILED                    = 'org.freedesktop.DBus.Error.Failed';
+  DBUS_ERROR_NO_MEMORY                 = 'org.freedesktop.DBus.Error.NoMemory';
+  DBUS_ERROR_SERVICE_UNKNOWN           = 'org.freedesktop.DBus.Error.ServiceUnknown';
+  DBUS_ERROR_NAME_HAS_NO_OWNER         = 'org.freedesktop.DBus.Error.NameHasNoOwner';
+  DBUS_ERROR_NO_REPLY                  = 'org.freedesktop.DBus.Error.NoReply';
+  DBUS_ERROR_IO_ERROR                  = 'org.freedesktop.DBus.Error.IOError';
+  DBUS_ERROR_BAD_ADDRESS               = 'org.freedesktop.DBus.Error.BadAddress';
+  DBUS_ERROR_NOT_SUPPORTED             = 'org.freedesktop.DBus.Error.NotSupported';
+  DBUS_ERROR_LIMITS_EXCEEDED           = 'org.freedesktop.DBus.Error.LimitsExceeded';
+  DBUS_ERROR_ACCESS_DENIED             = 'org.freedesktop.DBus.Error.AccessDenied';
+  DBUS_ERROR_AUTH_FAILED               = 'org.freedesktop.DBus.Error.AuthFailed';
+  DBUS_ERROR_NO_SERVER                 = 'org.freedesktop.DBus.Error.NoServer';
+  DBUS_ERROR_TIMEOUT                   = 'org.freedesktop.DBus.Error.Timeout';
+  DBUS_ERROR_NO_NETWORK                = 'org.freedesktop.DBus.Error.NoNetwork';
+  DBUS_ERROR_ADDRESS_IN_USE            = 'org.freedesktop.DBus.Error.AddressInUse';
+  DBUS_ERROR_DISCONNECTED              = 'org.freedesktop.DBus.Error.Disconnected';
+  DBUS_ERROR_INVALID_ARGS              = 'org.freedesktop.DBus.Error.InvalidArgs';
+  DBUS_ERROR_FILE_NOT_FOUND            = 'org.freedesktop.DBus.Error.FileNotFound';
+  DBUS_ERROR_UNKNOWN_METHOD            = 'org.freedesktop.DBus.Error.UnknownMethod';
+  DBUS_ERROR_TIMED_OUT                 = 'org.freedesktop.DBus.Error.TimedOut';
+  DBUS_ERROR_MATCH_RULE_NOT_FOUND      = 'org.freedesktop.DBus.Error.MatchRuleNotFound';
+  DBUS_ERROR_MATCH_RULE_INVALID        = 'org.freedesktop.DBus.Error.MatchRuleInvalid';
+  DBUS_ERROR_SPAWN_EXEC_FAILED         = 'org.freedesktop.DBus.Error.Spawn.ExecFailed';
+  DBUS_ERROR_SPAWN_FORK_FAILED         = 'org.freedesktop.DBus.Error.Spawn.ForkFailed';
+  DBUS_ERROR_SPAWN_CHILD_EXITED        = 'org.freedesktop.DBus.Error.Spawn.ChildExited';
+  DBUS_ERROR_SPAWN_CHILD_SIGNALED      = 'org.freedesktop.DBus.Error.Spawn.ChildSignaled';
+  DBUS_ERROR_SPAWN_FAILED              = 'org.freedesktop.DBus.Error.Spawn.Failed';
+  DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN   = 'org.freedesktop.DBus.Error.UnixProcessIdUnknown';
+  DBUS_ERROR_INVALID_SIGNATURE         = 'org.freedesktop.DBus.Error.InvalidSignature';
+  DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN   = 'org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown';
+
+  DBUS_INTROSPECT_1_0_XML_NAMESPACE         = 'http://www.freedesktop.org/standards/dbus';
+  DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER = '-//freedesktop//DTD D-BUS Object Introspection 1.0//EN';
+  DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER = 'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd';
+  DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE = '<!DOCTYPE node PUBLIC \""DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER"\"\n\""DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER"\">\n';
+

+ 63 - 0
packages/base/dbus/dbus-server.inc

@@ -0,0 +1,63 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-server.h DBusServer object
+ *
+ * Copyright (C) 2002, 2003  Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{#include <dbus/dbus-errors.h>
+#include <dbus/dbus-message.h>
+#include <dbus/dbus-connection.h>
+#include <dbus/dbus-protocol.h>}
+
+type
+  DBusServer = record end;
+  PDBusServer = ^DBusServer;
+
+  DBusNewConnectionFunction = procedure (server: PDBusServer;
+   new_connection: PDBusConnection; data: Pointer);
+
+function dbus_server_listen(const address: PChar; error: PDBusError): PDBusServer; cdecl; external LibDBus;
+function dbus_server_ref(error: PDBusError): PDBusServer; cdecl; external LibDBus;
+procedure dbus_server_unref(error: PDBusError); cdecl; external LibDBus;
+procedure dbus_server_disconnect(error: PDBusError); cdecl; external LibDBus;
+function dbus_server_get_is_connected(error: PDBusError): dbus_bool_t; cdecl; external LibDBus;
+function dbus_server_get_address(error: PDBusError): PChar; cdecl; external LibDBus;
+procedure dbus_server_set_new_connection_function(server: PDBusServer;
+ function_: DBusNewConnectionFunction; data: Pointer; free_data_function: DBusFreeFunction); cdecl; external LibDBus;
+function dbus_server_set_watch_functions(server: PDBusServer;
+ add_function: DBusAddWatchFunction;
+ remove_function: DBusRemoveWatchFunction;
+ toggled_function: DBusWatchToggledFunction;
+ data: Pointer;
+ free_data_function: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+function dbus_server_set_timeout_functions(server: PDBusServer;
+ add_function: DBusAddTimeoutFunction;
+ remove_function: DBusRemoveTimeoutFunction;
+ toggled_function: DBusTimeoutToggledFunction;
+ data: Pointer;
+ free_data_function: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+function dbus_server_set_auth_mechanisms(server: PDBusServer; const mechanisms: PPChar): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_server_allocate_data_slot(slot_p: Pdbus_int32_t): dbus_bool_t; cdecl; external LibDBus;
+procedure dbus_server_free_data_slot(slot_p: Pdbus_int32_t); cdecl; external LibDBus;
+function dbus_server_set_data(server: PDBusServer;
+ slot: cint; data: Pointer; free_data_func: DBusFreeFunction): dbus_bool_t; cdecl; external LibDBus;
+function dbus_server_get_data(server: PDBusServer; slot: cint): Pointer; cdecl; external LibDBus;
+

+ 91 - 0
packages/base/dbus/dbus-shared.inc

@@ -0,0 +1,91 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-shared.h  Stuff used by both dbus/dbus.h low-level and C/C++ binding APIs
+ *
+ * Copyright (C) 2004 Red Hat, Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{ Normally docs are in .c files, but there isn't a .c file for this. }
+{
+ * @defgroup DBusShared Shared constants 
+ * @ingroup  DBus
+ *
+ * Shared constants.
+ *
+ * @brief Stuff used by both dbus/dbus.h low-level and C/C++ binding APIs 
+ }
+
+
+type
+  DBusBusType =
+  (
+   DBUS_BUS_SESSION,    {< The login session bus }
+   DBUS_BUS_SYSTEM,     {< The systemwide bus }
+   DBUS_BUS_STARTER     {< The bus that started us, if any }
+  );
+
+  DBusHandlerResult =
+  (
+   DBUS_HANDLER_RESULT_HANDLED,         {< Message has had its effect }
+   DBUS_HANDLER_RESULT_NOT_YET_HANDLED, {< Message has not had any effect }
+   DBUS_HANDLER_RESULT_NEED_MEMORY      {< Need more memory to return another result }
+  );
+
+{ Services }
+const
+  DBUS_SERVICE_DBUS =     'org.freedesktop.DBus';
+
+{ Paths }
+  DBUS_PATH_DBUS =  '/org/freedesktop/DBus';
+  DBUS_PATH_LOCAL = '/org/freedesktop/DBus/Local';
+
+{ Interfaces, these #define don't do much other than
+ * catch typos at compile time
+ }
+  DBUS_INTERFACE_DBUS =           'org.freedesktop.DBus';
+  DBUS_INTERFACE_INTROSPECTABLE = 'org.freedesktop.DBus.Introspectable';
+  DBUS_INTERFACE_PROPERTIES =     'org.freedesktop.DBus.Properties';
+  DBUS_INTERFACE_PEER =           'org.freedesktop.DBus.Peer';
+
+{ This is a special interface whose methods can only be invoked
+ * by the local implementation (messages from remote apps aren't
+ * allowed to specify this interface).
+ }
+  DBUS_INTERFACE_LOCAL = 'org.freedesktop.DBus.Local';
+
+{ Owner flags }
+  DBUS_NAME_FLAG_ALLOW_REPLACEMENT = $1; {< Allow another service to become the primary owner if requested }
+  DBUS_NAME_FLAG_REPLACE_EXISTING =  $2; {< Request to replace the current primary owner }
+  DBUS_NAME_FLAG_DO_NOT_QUEUE =      $4; {< If we can not become the primary owner do not place us in the queue }
+
+{ Replies to request for a name }
+  DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER = 1; {< Service has become the primary owner of the requested name }
+  DBUS_REQUEST_NAME_REPLY_IN_QUEUE      = 2; {< Service could not become the primary owner and has been placed in the queue }
+  DBUS_REQUEST_NAME_REPLY_EXISTS        = 3; {< Service is already in the queue }
+  DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER = 4; {< Service is already the primary owner }
+
+{ Replies to releasing a name }
+  DBUS_RELEASE_NAME_REPLY_RELEASED       = 1; {< Service was released from the given name }
+  DBUS_RELEASE_NAME_REPLY_NON_EXISTENT   = 2; {< The given name does not exist on the bus }
+  DBUS_RELEASE_NAME_REPLY_NOT_OWNER      = 3; {< Service is not an owner of the given name }
+
+{ Replies to service starts }
+  DBUS_START_REPLY_SUCCESS         = 1; {< service was auto started }
+  DBUS_START_REPLY_ALREADY_RUNNING = 2; {< service was already running }
+

+ 61 - 0
packages/base/dbus/dbus-signature.inc

@@ -0,0 +1,61 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-signatures.h utility functions for D-Bus types
+ *
+ * Copyright (C) 2005 Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{#include <dbus/dbus-macros.h>
+#include <dbus/dbus-types.h>
+#include <dbus/dbus-errors.h>}
+
+{
+ * DBusSignatureIter struct; contains no public fields 
+ }
+type
+  DBusSignatureIter = record
+    dummy1: Pointer;         {< Don't use this }
+    dummy2: Pointer;         {< Don't use this }
+    dummy8: dbus_uint32_t;   {< Don't use this }
+    dummy12: cint;           {< Don't use this }
+    dummy17: cint;           {< Don't use this }
+  end;
+  
+  PDBusSignatureIter = ^DBusSignatureIter;
+
+procedure dbus_signature_iter_init(iter: PDBusSignatureIter; const signature: PChar); cdecl; external LibDBus;
+
+function dbus_signature_iter_get_current_type(const iter: PDBusSignatureIter): Integer; cdecl; external LibDBus;
+
+function dbus_signature_iter_get_signature(const iter: PDBusSignatureIter): PChar; cdecl; external LibDBus;
+
+function dbus_signature_iter_get_element_type(const iter: PDBusSignatureIter): Integer; cdecl; external LibDBus;
+
+function dbus_signature_iter_next(const iter: PDBusSignatureIter): dbus_bool_t; cdecl; external LibDBus;
+
+procedure dbus_signature_iter_recurse(const iter: PDBusSignatureIter; subiter: PDBusSignatureIter); cdecl; external LibDBus;
+
+function dbus_signature_validate(const signature: PChar; error: PDBusError): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_signature_validate_single(const signature: PChar; error: PDBusError): dbus_bool_t; cdecl; external LibDBus;
+
+function dbus_type_is_basic(typecode: cint): dbus_bool_t; cdecl; external LibDBus;
+function dbus_type_is_container(typecode: cint): dbus_bool_t; cdecl; external LibDBus;
+function dbus_type_is_fixed(typecode: cint): dbus_bool_t; cdecl; external LibDBus;
+

+ 95 - 0
packages/base/dbus/dbus-threads.inc

@@ -0,0 +1,95 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-threads.h  D-Bus threads handling
+ *
+ * Copyright (C) 2002  Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{#include <dbus/dbus-macros.h>
+#include <dbus/dbus-types.h>}
+
+type
+  DBusMutex = record end;
+  PDBusMutex = ^DBusMutex;
+
+  DBusCondVar = record end;
+  PDBusCondVar = ^DBusCondVar;
+  
+  DBusMutexNewFunction = function (): DBusMutex;
+  DBusMutexFreeFunction = procedure (mutex: PDBusMutex);
+  DBusMutexLockFunction = function (mutex: PDBusMutex): dbus_bool_t;
+  DBusMutexUnlockFunction = function (mutex: PDBusMutex): dbus_bool_t;
+
+  DBusCondVarNewFunction = function (): PDBusCondVar;
+  DBusCondVarFreeFunction = procedure (cond: PDBusCondVar);
+  DBusCondVarWaitFunction = procedure (cond: PDBusCondVar; mutex: PDBusMutex);
+  DBusCondVarWaitTimeoutFunction = procedure (cond: PDBusCondVar; mutex: PDBusMutex;
+   timeout_milliseconds: cint);
+  DBusCondVarWakeOneFunction = procedure (cond: PDBusCondVar);
+  DBusCondVarWakeAllFunction = procedure (cond: PDBusCondVar);
+
+  DBusThreadFunctionsMask =
+  (
+   DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK      = 1 shl 0,
+   DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK     = 1 shl 1,
+   DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK     = 1 shl 2,
+   DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK   = 1 shl 3,
+   DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK    = 1 shl 4,
+   DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK   = 1 shl 5,
+   DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK   = 1 shl 6,
+   DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK   = 1 shl 7,
+   DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK = 1 shl 8,
+   DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK = 1 shl 9,
+
+   DBUS_THREAD_FUNCTIONS_ALL_MASK     = (1 shl 10) - 1
+  );
+
+{
+ * Functions that must be implemented to make the D-Bus
+ * library thread-aware. 
+ }
+  DBusThreadFunctions = record
+   mask: cuint; {< Mask indicating which functions are present. }
+
+   mutex_new: DBusMutexNewFunction; {< Function to create a mutex }
+   mutex_free: DBusMutexFreeFunction; {< Function to free a mutex }
+   mutex_lock: DBusMutexLockFunction; {< Function to lock a mutex }
+   mutex_unlock: DBusMutexUnlockFunction; {< Function to unlock a mutex }
+
+   condvar_new: DBusCondVarNewFunction; {< Function to create a condition variable }
+   condvar_free: DBusCondVarFreeFunction; {< Function to free a condition variable }
+   condvar_wait: DBusCondVarWaitFunction; {< Function to wait on a condition }
+   condvar_wait_timeout: DBusCondVarWaitTimeoutFunction; {< Function to wait on a condition with a timeout }
+   condvar_wake_one: DBusCondVarWakeOneFunction; {< Function to wake one thread waiting on the condition }
+   condvar_wake_all: DBusCondVarWakeAllFunction; {< Function to wake all threads waiting on the condition }
+  
+   padding1: procedure; {< Reserved for future expansion }
+   padding2: procedure; {< Reserved for future expansion }
+   padding3: procedure; {< Reserved for future expansion }
+   padding4: procedure; {< Reserved for future expansion }
+   padding5: procedure; {< Reserved for future expansion }
+   padding6: procedure; {< Reserved for future expansion }
+   padding7: procedure; {< Reserved for future expansion }
+   padding8: procedure; {< Reserved for future expansion }
+  end;
+  
+  PDBusThreadFunctions = ^DBusThreadFunctions;
+
+function dbus_threads_init(const functions: PDBusThreadFunctions): dbus_bool_t; cdecl; external LibDBus;
+

+ 115 - 0
packages/base/dbus/dbus-types.inc

@@ -0,0 +1,115 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-types.h  types such as dbus_bool_t
+ *
+ * Copyright (C) 2002  Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+//#include <stddef.h>
+//#include <dbus/dbus-arch-deps.h>
+
+type
+  dbus_unichar_t = dbus_uint32_t;
+
+{ boolean size must be fixed at 4 bytes due to wire protocol! }
+  dbus_bool_t = dbus_uint32_t;
+
+  PPPChar = ^PPChar;
+  
+  va_list = Pointer;
+
+{ Normally docs are in .c files, but there isn't a .c file for this. }
+{
+ * @defgroup DBusTypes Basic types
+ * @ingroup  DBus
+ * @brief dbus_bool_t, dbus_int32_t, etc.
+ *
+ * Typedefs for common primitive types.
+ *
+ }
+
+{
+ * @typedef dbus_bool_t
+ *
+ * A boolean, valid values are #TRUE and #FALSE.
+ }
+
+{
+ * @typedef dbus_uint32_t
+ *
+ * A 32-bit unsigned integer on all platforms.
+ }
+
+{
+ * @typedef dbus_int32_t
+ *
+ * A 32-bit signed integer on all platforms.
+ }
+
+{
+ * @typedef dbus_uint16_t
+ *
+ * A 16-bit unsigned integer on all platforms.
+ }
+
+{
+ * @typedef dbus_int16_t
+ *
+ * A 16-bit signed integer on all platforms.
+ }
+
+
+{
+ * @typedef dbus_uint64_t
+ *
+ * A 64-bit unsigned integer on all platforms that support it.
+ * If supported, #DBUS_HAVE_INT64 will be defined.
+ *
+ * C99 requires a 64-bit type and most likely all interesting
+ * compilers support one. GLib for example flat-out requires
+ * a 64-bit type.
+ }
+
+{
+ * @typedef dbus_int64_t
+ *
+ * A 64-bit signed integer on all platforms that support it.
+ * If supported, #DBUS_HAVE_INT64 will be defined.
+ *
+ * C99 requires a 64-bit type and most likely all interesting
+ * compilers support one. GLib for example flat-out requires
+ * a 64-bit type.
+ }
+
+{
+ * @def DBUS_INT64_CONSTANT
+ *
+ * Declare a 64-bit signed integer constant. The macro
+ * adds the necessary "LL" or whatever after the integer,
+ * giving a literal such as "325145246765LL"
+ }
+
+{
+ * @def DBUS_UINT64_CONSTANT
+ *
+ * Declare a 64-bit unsigned integer constant. The macro
+ * adds the necessary "ULL" or whatever after the integer,
+ * giving a literal such as "325145246765ULL"
+ }
+

+ 91 - 0
packages/base/dbus/dbus.pas

@@ -0,0 +1,91 @@
+{
+  Pascal translation of the dbus headers
+  
+  Based on dbus version 0.92
+}
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus.h  Convenience header including all other headers
+ *
+ * Copyright (C) 2002, 2003  Red Hat Inc.
+ *
+ * Licensed under the Academic Free License version 2.1
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+unit dbus;
+
+{$ifdef fpc}
+  {$mode delphi}{$H+}
+{$endif}
+
+{$minenumsize 4}
+
+{ FPC 2.0.2 compatibility code }
+{$ifdef win32}
+  {$define windows}
+{$endif}
+
+{ Delphi compatibility code }
+{$ifndef fpc}
+  {$define windows}
+{$endif}
+
+interface
+
+uses ctypes;
+
+{ D-Bus hasn't reached 1.0 and is subject to protocol and API churn.
+  See the README for a full explanation. }
+
+const
+{$ifdef unix}
+  LibDBus = 'libdbus-1';
+{$endif}
+{$ifdef windows}
+  LibDBus = 'libdbus.dll';
+{$endif}
+
+{$include dbus-macros.inc}
+{$include dbus-arch-deps.inc}
+{$include dbus-types.inc}
+{$include dbus-errors.inc}
+{$include dbus-address.inc}
+{$include dbus-message.inc}
+{$include dbus-shared.inc}
+{$include dbus-connection.inc}
+{$include dbus-bus.inc}
+
+{$include dbus-pending-call.inc}
+{$include dbus-protocol.inc}
+{$include dbus-server.inc}
+
+{$include dbus-signature.inc}
+{$include dbus-threads.inc}
+
+{
+ * @defgroup DBus D-Bus low-level public API
+ * @brief The low-level public API of the D-Bus library
+ *
+ * libdbus provides a low-level API intended primarily for use by
+ * bindings to specific object systems and languages.  D-Bus is most
+ * convenient when used with the GLib bindings, Python bindings, Qt
+ * bindings, Mono bindings, and so forth.  This low-level API has a
+ * lot of complexity useful only for bindings.
+ * 
+ }
+implementation
+
+end.

+ 45 - 0
packages/base/dbus/dbus_arch_deps.inc

@@ -0,0 +1,45 @@
+{ -*- mode: C; c-file-style: "gnu" -*- }
+{ dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir
+ *
+ * Copyright (C) 2003 Red Hat, Inc.
+ *
+ * Licensed under the Academic Free License version 2.0
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ }
+
+{ Only <dbus/dbus.h> can be included directly, this file may disappear or change contents. }
+
+//#include <dbus/dbus-macros.h>
+
+const DBUS_HAVE_INT64 = 1;
+
+type
+  dbus_int64_t = Int64;
+
+  dbus_uint64_t = Int64;
+
+{#define DBUS_INT64_CONSTANT(val)  (val##LL)
+#define DBUS_UINT64_CONSTANT(val) (val##ULL)}
+
+  dbus_int32_t = cint;
+  dbus_uint32_t = cuint;
+
+  dbus_int16_t = cshort;
+  dbus_uint16_t = cushort;
+  
+  size_t = Integer;
+

+ 1618 - 0
packages/base/dbus/example/Makefile

@@ -0,0 +1,1618 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/08/20]
+#
+default: all
+MAKEFILETARGETS=i386-linux m68k-linux powerpc-linux sparc-linux x86_64-linux arm-linux powerpc64-linux
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx
+LIMIT83fs = go32v2 os2 emx watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override DEFAULT_FPCDIR=../../../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+FPC:=$(shell $(FPCPROG) -PB)
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifneq ($(words $(FPC_COMPILERINFO)),5)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_PROGRAMS+=busexample
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_PROGRAMS+=busexample
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_PROGRAMS+=busexample
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_PROGRAMS+=busexample
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_PROGRAMS+=busexample
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_PROGRAMS+=busexample
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_PROGRAMS+=busexample
+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
+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
+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 dbus
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_DBUS=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_DBUS=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_DBUS=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_DBUS=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_DBUS=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_DBUS=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_DBUS=1
+endif
+ifdef REQUIRE_PACKAGES_RTL
+PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_RTL),)
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
+UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
+else
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_RTL)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_RTL=
+UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_RTL),)
+UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override COMPILER_UNITDIR+=$(UNITDIR_RTL)
+endif
+endif
+ifdef REQUIRE_PACKAGES_DBUS
+PACKAGEDIR_DBUS:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /dbus/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_DBUS),)
+ifneq ($(wildcard $(PACKAGEDIR_DBUS)/units/$(TARGETSUFFIX)),)
+UNITDIR_DBUS=$(PACKAGEDIR_DBUS)/units/$(TARGETSUFFIX)
+else
+UNITDIR_DBUS=$(PACKAGEDIR_DBUS)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_DBUS)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_DBUS) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_DBUS)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_DBUS=
+UNITDIR_DBUS:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /dbus/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_DBUS),)
+UNITDIR_DBUS:=$(firstword $(UNITDIR_DBUS))
+else
+UNITDIR_DBUS=
+endif
+endif
+ifdef UNITDIR_DBUS
+override COMPILER_UNITDIR+=$(UNITDIR_DBUS)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(CPU_TARGET)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX) -Xc
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O1r
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef GCCLIBDIR
+override FPCOPT+=-Fl$(GCCLIBDIR)
+endif
+ifdef OTHERLIBDIR
+override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+EXECPPAS:=@$(PPAS)
+endif
+endif
+.PHONY: fpc_exes
+ifndef CROSSINSTALL
+ifneq ($(TARGET_PROGRAMS),)
+override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
+override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
+ifeq ($(OS_TARGET),os2)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+ifeq ($(OS_TARGET),emx)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+endif
+endif
+fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+	@$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+	$(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+	$(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(PPUEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.lpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_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:
+zipinstall:
+zipsourceinstall:
+zipexampleinstall:
+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

+ 15 - 0
packages/base/dbus/example/Makefile.fpc

@@ -0,0 +1,15 @@
+#
+#  Makefile.fpc for dbus units example
+#
+
+[target]
+programs=busexample
+
+[require]
+packages=dbus
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../../../..

+ 82 - 0
packages/base/dbus/example/busexample.pp

@@ -0,0 +1,82 @@
+program busexample;
+
+{$ifdef fpc}
+  {$mode objfpc}{$H+}
+{$endif}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  SysUtils,
+  ctypes,
+  dbus;
+
+procedure BusSend;
+begin
+
+end;
+
+procedure BusReceive;
+begin
+
+end;
+
+procedure BusListen;
+begin
+
+end;
+
+procedure BusQuery;
+begin
+
+end;
+
+const
+  SINTAX_TEXT = 'Syntax: dbus-example [send|receive|listen|query] [<param>]';
+var
+  err: DBusError;
+  conn: PDBusConnection;
+  ret: cint;
+begin
+  { Initializes the errors }
+  dbus_error_init(@err);
+  
+  { Connection }
+  conn := dbus_bus_get(DBUS_BUS_SESSION, @err);
+
+  if dbus_error_is_set(@err) <> 0 then
+  begin
+    WriteLn('Connection Error: ' + err.message);
+    dbus_error_free(@err);
+  end;
+  
+  if conn = nil then Exit;
+  
+  { Request the name of the bus }
+  ret := dbus_bus_request_name(conn, 'test.method.server', DBUS_NAME_FLAG_REPLACE_EXISTING, @err);
+
+  if dbus_error_is_set(@err) <> 0 then
+  begin
+    WriteLn('Name Error: ' + err.message);
+    dbus_error_free(@err);
+  end;
+  
+  if ret <> DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER then Exit;
+
+  { Parses parameters }
+  
+  if (ParamCount <> 1) and (ParamCount <> 2) then WriteLn(SINTAX_TEXT)
+  else
+  begin
+    if ParamStr(1) = 'send' then BusSend
+    else if ParamStr(1) = 'receive' then BusReceive
+    else if ParamStr(1) = 'listen' then BusListen
+    else if ParamStr(1) = 'query' then BusQuery
+    else WriteLn(SINTAX_TEXT);
+  end;
+
+  { Finalization }
+  dbus_connection_close(conn);
+end.
+