Procházet zdrojové kódy

Added RTL for Symobi. Symobi uses the NetBSD C-library, so the RTL was started from the FreeBSD RTL (as I don't trust the state of the NetBSD RTL ^^) and adjusted accordingly.

The changes in Unix are mostly that "linklib foo" should not be used on Symobi as imported DLLs are taken care of similar to Windows. Also some functions are not available in Symobi's C-library (or not working correctly).

Please note: As most files in rtl/symobi are copied from the BSD RTLs the copyright and file information might not be correct.

* compiler/systems/i_symobi.pas
   Forgot to add the BSD define
* rtl/unix/oscdecl.inc
   Symobi does currently not define SetTimeOfDay (might be, because it's not even defined by POSIX...)
* rtl/unix/sysheap.inc
   (un)mmap does not work correctly
* rtl/inc/fpextres.pp:
   use the generic external implementation for Symobi

git-svn-id: branches/svenbarth/symobi@18061 -
svenbarth před 14 roky
rodič
revize
5173a3c241

+ 26 - 0
.gitattributes

@@ -7996,6 +7996,32 @@ rtl/symbian/uiq.pas svneol=native#text/plain
 rtl/symbian/uiqclasses.pas svneol=native#text/plain
 rtl/symbian/uiqinc/qikapplication.inc svneol=native#text/plain
 rtl/symbian/uiqinc/qikapplicationoo.inc svneol=native#text/plain
+rtl/symobi/Makefile svneol=native#text/plain
+rtl/symobi/Makefile.fpc svneol=native#text/plain
+rtl/symobi/bunxfunch.inc svneol=native#text/plain
+rtl/symobi/clocale.inc svneol=native#text/plain
+rtl/symobi/errno.inc svneol=native#text/plain
+rtl/symobi/errnostr.inc svneol=native#text/plain
+rtl/symobi/i386/sighnd.inc svneol=native#text/plain
+rtl/symobi/osdefs.inc svneol=native#text/plain
+rtl/symobi/osmacro.inc svneol=native#text/plain
+rtl/symobi/osmain.inc svneol=native#text/plain
+rtl/symobi/ossysc.inc svneol=native#text/plain
+rtl/symobi/ostypes.inc svneol=native#text/plain
+rtl/symobi/pthread.inc svneol=native#text/plain
+rtl/symobi/ptypes.inc svneol=native#text/plain
+rtl/symobi/signal.inc svneol=native#text/plain
+rtl/symobi/suuid.inc svneol=native#text/plain
+rtl/symobi/sysos.inc svneol=native#text/plain
+rtl/symobi/sysosh.inc svneol=native#text/plain
+rtl/symobi/system.pp svneol=native#text/pascal
+rtl/symobi/termio.pp svneol=native#text/pascal
+rtl/symobi/termios.inc svneol=native#text/plain
+rtl/symobi/termiosproc.inc svneol=native#text/plain
+rtl/symobi/unxconst.inc svneol=native#text/plain
+rtl/symobi/unxfunc.inc svneol=native#text/plain
+rtl/symobi/unxsockh.inc svneol=native#text/plain
+rtl/symobi/unxsysch.inc svneol=native#text/plain
 rtl/ucmaps/8859-1.txt svneol=native#text/plain
 rtl/ucmaps/8859-10.txt svneol=native#text/plain
 rtl/ucmaps/8859-13.txt svneol=native#text/plain

+ 1 - 1
compiler/systems/i_symobi.pas

@@ -43,7 +43,7 @@ unit i_symobi;
                             tf_safecall_exceptions];
             cpu          : cpu_i386;
             unit_env     : 'SYMOBIUNITS';
-            extradefines : 'SYMOBI;UNIX;HASSYMOBI';
+            extradefines : 'SYMOBI;UNIX;BSD;HASSYMOBI';
             exeext       : '.exe';
             defext       : '.def';
             scriptext    : '.sh';

+ 1 - 0
rtl/Makefile.fpc

@@ -34,6 +34,7 @@ dirs_symbian=symbian
 dirs_embedded=embedded
 dirs_nativent=nativent
 dirs_wii=wii
+dirs_symobi=symobi
 
 [install]
 fpcpackage=y

+ 5 - 1
rtl/inc/fpextres.pp

@@ -30,7 +30,11 @@ uses
   {$include extres_multiarch.inc}
 {$else}
   {$ifdef UNIX}
-    {$define EXTRES_MMAP}
+    {$ifdef SYMOBI}
+	  {$define EXTRES_GENERIC}
+	{$else}
+      {$define EXTRES_MMAP}
+	{$endif}
   {$else}
     {$define EXTRES_GENERIC}
   {$endif}

+ 1 - 1
rtl/inc/system.inc

@@ -142,7 +142,7 @@ function do_isdevice(handle:thandle):boolean;forward;
 { Under Haiku, bcopy cause a problem when searching for include file
   in the compiler. So, we use the internal implementation for now
   under BeOS and Haiku.  }
-{$ifndef BEOS}
+{$if not defined(BEOS) and not defined(SYMOBI)}
 { prefer libc implementations over our own, as they're most likely faster }
 {$i cgeneric.inc}
 { is now declared as external reference to another routine in the interface }

+ 2661 - 0
rtl/symobi/Makefile

@@ -0,0 +1,2661 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/06/27]
+#
+default: all
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-symobi m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx haiku
+LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+ifndef RUNBATCH
+RUNBATCH=$(COMSPEC) /C
+endif
+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 OS_TARGET_DEFAULT=symobi
+override DEFAULT_FPCDIR=../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+DETERMINE_NATIVE_COMPILER=1
+else
+ifdef CROSSCOMPILE
+ifndef FPCFPMAKE
+DETERMINE_NATIVE_COMPILER=1
+endif
+endif
+endif
+ifdef DETERMINE_NATIVE_COMPILER
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPCNATIVE:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
+FPCNATIVE:=$(shell $(FPCPROG) -PB)
+endif
+ifneq ($(findstring Error,$(FPCNATIVE)),)
+override FPCNATIVE=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+else
+ifeq ($(strip $(wildcard $(FPCNATIVE))),)
+FPCNATIVE:=$(firstword $(FPCPROG))
+endif
+endif
+else
+override FPCNATIVE=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+ifndef FPC
+FPC=$(FPCNATIVE)
+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)
+ifeq ($(CPU_TARGET),armeb)
+ARCH=arm
+override FPCOPT+=-Cb
+else
+ifeq ($(CPU_TARGET),armel)
+ARCH=arm
+override FPCOPT+=-CaEABI
+else
+ARCH=$(CPU_TARGET)
+endif
+endif
+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 ARCH 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
+ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
+ifeq ($(OS_SOURCE),darwin)
+DARWIN2DARWIN=1
+endif
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+ifndef DARWIN2DARWIN
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+ifndef FPCFPMAKE
+ifdef CROSSCOMPILE
+ifeq ($(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR)))),)
+FPCFPMAKE:=$(FPCNATIVE)
+else
+FPCFPMAKE=$(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR))))
+endif
+else
+FPCFPMAKE=$(FPC)
+endif
+endif
+export FPCFPMAKE
+override PACKAGE_NAME=rtl
+PACKAGEDIR_MAIN:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
+RTL=..
+INC=$(RTL)/inc
+COMMON=$(RTL)/common
+PROCINC=$(RTL)/$(CPU_TARGET)
+OSPROCINC=$(RTL)/symobi/$(CPU_TARGET)
+UNIXINC=$(RTL)/unix
+UNITPREFIX=rtl
+CPU_UNITS=
+ifeq ($(ARCH),i386)
+CPU_UNITS=cpu mmx
+endif
+ifeq ($(ARCH),x86_64)
+CPU_UNITS=cpu
+endif
+SYSTEMUNIT=system
+ifdef RELEASE
+override FPCOPT+=-Ur
+endif
+override FPCOPT+=-dFPC_USE_LIBC -dDONT_READ_TIMEZONE
+OBJPASDIR=$(RTL)/objpas
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-iphonesim)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-symobi)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 strings baseunix unixutil unix rtlconsts initc cmem matrix dl termio  printer sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo errors sockets terminfo bsd cwstring serial dateutils video keyboard mouse cthreads sysconst strutils convutils stdconvs dos objects fpextres clocale
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-iphonesim)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-symobi)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-iphonesim)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),i386-symobi)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
+endif
+override INSTALL_FPCPACKAGE=y y
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-iphonesim)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-symobi)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-nativent)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-iphonesim)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),i386-symobi)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+endif
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+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
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),emx)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=emx
+ECHO=echo
+IMPORTLIBPREFIX=
+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),haiku)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=hai
+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
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+ifneq ($(findstring $(OS_TARGET),darwin iphonesim),)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=dwn
+endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+ifeq ($(OS_TARGET),NativeNT)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=nativent
+endif
+ifeq ($(OS_TARGET),wii)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=wii
+endif
+ifeq ($(OS_TARGET),symobi)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symobi
+endif
+else
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+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
+IMPORTLIBPREFIX=
+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
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+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
+ifndef NOCPUDEF
+override FPCOPTDEF=$(ARCH)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(ARCH)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX)
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O2
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),linux)
+ifeq ($(CPU_TARGET),x86_64)
+override FPCOPT+=-Cg
+endif
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
+EXECPPAS:=@$(PPAS)
+endif
+endif
+endif
+.PHONY: fpc_units
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
+override ALLTARGET+=fpc_units
+override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
+override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
+override INSTALLPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES) $(IMPLICITUNITPPUFILES)
+endif
+fpc_units: $(COMPILER_UNITTARGETDIR) $(UNITPPUFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+	@$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+	$(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+	$(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(PPUEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.lpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.inc $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+endif
+ifdef CLEAN_PROGRAMS
+override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS)))
+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
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+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)  FPC fpmake... $(FPCFPMAKE)
+	@$(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
+.NOTPARALLEL:
+include $(INC)/makefile.inc
+SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
+include $(PROCINC)/makefile.cpu
+SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
+SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
+$(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp unxconst.inc $(SYSDEPS)
+	$(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
+objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
+dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
+strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
+		   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
+		   $(SYSTEMUNIT)$(PPUEXT)
+unixtype$(PPUEXT): $(UNIXINC)/unixtype.pp $(UNIXINC)/ctypes.inc ptypes.inc $(SYSTEMUNIT)$(PPUEXT)
+baseunix$(PPUEXT) : errno.inc ptypes.inc $(UNIXINC)/ctypes.inc \
+  signal.inc $(UNIXINC)/bunxh.inc \
+  bunxsysc.inc \
+  ostypes.inc osmacro.inc $(UNIXINC)/gensigset.inc \
+  $(UNIXINC)/genfuncs.inc $(SYSTEMUNIT)$(PPUEXT)
+unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
+		 unxconst.inc $(UNIXINC)/timezone.inc \
+		 unxfunc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+linux$(PPUEXT) : baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
+	       unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+crt$(PPUEXT) : $(UNIXINC)/crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
+printer$(PPUEXT) : $(UNIXINC)/printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
+		    objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
+	$(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp
+rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp
+	$(COMPILER) $(OBJPASDIR)/rtlconsts.pp
+classes$(PPUEXT) : $(UNIXINC)/classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
+		   sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) fgl$(PPUEXT)
+	$(COMPILER) -Fi$(OBJPASDIR)/classes $(UNIXINC)/classes.pp
+fgl$(PPUEXT) : $(OBJPASDIR)/fgl.pp objpas$(PPUEXT) types$(PPUEXT) system$(PPUEXT) sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/fgl.pp
+typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT) rtlconsts$(PPUEXT)
+	$(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
+math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/math.pp
+gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/gettext.pp
+varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
+		    $(OBJPASDIR)/varutilh.inc varutils.pp
+	$(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
+fmtbcd$(PPUEXT) : $(OBJPASDIR)/fmtbcd.pp objpas$(PPUEXT) sysutils$(PPUEXT) variants$(PPUEXT) classes$(PPUEXT) system$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/fmtbcd.pp
+types$(PPUEXT) : $(OBJPASDIR)/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/types.pp
+sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/sysconst.pp
+macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
+	$(COMPILER) $(INC)/macpas.pp $(REDIR)
+x86$(PPUEXT) : $(UNIXINC)/x86.pp $(SYSTEMUNIT)$(PPUEXT)
+ifeq ($(ARCH),x86_64)
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT)
+else
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
+endif
+mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
+heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) -Sg $(INC)/heaptrc.pp
+fpextres$(PPUEXT) : $(INC)/extres.inc $(INC)/fpextres.pp $(SYSTEMUNIT)$(PPUEXT)
+		$(COMPILER) -Sg $(INC)/fpextres.pp
+lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
+lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT)
+charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
+ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+sockets$(PPUEXT) : $(UNIXINC)/sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
+		   unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+errors$(PPUEXT) : $(UNIXINC)/errors.pp strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+terminfo$(PPUEXT) : terminfo.pp unix$(PPUEXT)
+callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)
+cmem$(PPUEXT) : $(INC)/cmem.pp $(SYSTEMUNIT)$(PPUEXT)
+cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp $(SYSTEMUNIT)$(PPUEXT)
+strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+		    sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/strutils.pp
+convutils$(PPUEXT) : $(OBJPASDIR)/convutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+		    sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/convutils.pp
+stdconvs$(PPUEXT) : $(OBJPASDIR)/stdconvs.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+		    sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/stdconvs.pp
+dynlibs$(PPUEXT) : $(INC)/dynlibs.pas $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
+ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
+variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) math$(PPUEXT)
+	$(COMPILER) -Fi$(INC) $(INC)/variants.pp
+cwstring$(PPUEXT) : $(UNIXINC)/cwstring.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) baseunix$(PPUEXT) unix$(PPUEXT) unixtype$(PPUEXT) ctypes$(PPUEXT)

+ 271 - 0
rtl/symobi/Makefile.fpc

@@ -0,0 +1,271 @@
+#
+#   Makefile.fpc for Free Pascal FreeBSD RTL
+#
+
+[package]
+main=rtl
+
+[install]
+fpcpackage=y
+
+[target]
+loaders=
+units=$(SYSTEMUNIT) unixtype ctypes objpas macpas iso7185 \
+      strings baseunix unixutil \
+      unix rtlconsts initc cmem matrix \
+       dl termio  printer \
+      sysutils varutils math variants typinfo types classes fgl fmtbcd dynlibs \
+      $(CPU_UNITS) charset ucomplex crt getopts heaptrc lnfodwrf lineinfo \
+      errors sockets terminfo cwstring \
+      serial dateutils video keyboard mouse \
+      sysconst strutils convutils stdconvs dos objects \
+      fpextres clocale
+implicitunits=exeinfo
+
+rsts=math varutils typinfo classes variants dateutils sysconst
+
+[require]
+nortl=y
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../..
+target=symobi
+
+[compiler]
+includedir=$(INC) $(PROCINC) $(UNIXINC) $(OSPROCINC)
+sourcedir=$(INC) $(PROCINC) $(UNIXINC) $(COMMON)
+
+
+[lib]
+libname=libfprtl.so
+libversion=2.0.0
+libunits=$(SYSTEMUNIT) objpas strings \
+      unix  \
+      dos crt objects printer \
+      sysutils typinfo math \
+      $(CPU_UNITS) getopts heaptrc \
+      errors sockets ipc dynlibs
+
+[prerules]
+RTL=..
+INC=$(RTL)/inc
+COMMON=$(RTL)/common
+PROCINC=$(RTL)/$(CPU_TARGET)
+OSPROCINC=$(RTL)/symobi/$(CPU_TARGET)
+UNIXINC=$(RTL)/unix
+UNITPREFIX=rtl
+CPU_UNITS=
+
+ifeq ($(ARCH),i386)
+CPU_UNITS=cpu mmx
+endif
+
+ifeq ($(ARCH),x86_64)
+CPU_UNITS=cpu
+endif
+
+SYSTEMUNIT=system
+
+
+# Use new feature from 1.0.5 version
+# that generates release PPU files
+# which will not be recompiled
+ifdef RELEASE
+override FPCOPT+=-Ur
+endif
+
+# Symobi requires usage of the C library, no syscalls
+override FPCOPT+=-dFPC_USE_LIBC -dDONT_READ_TIMEZONE
+
+# Paths
+OBJPASDIR=$(RTL)/objpas
+
+[rules]
+.NOTPARALLEL:
+# Get the system independent include file names.
+# This will set the following variables :
+# SYSINCNAMES
+include $(INC)/makefile.inc
+SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
+
+# Get the processor dependent include file names.
+# This will set the following variables :
+# CPUINCNAMES
+include $(PROCINC)/makefile.cpu
+SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
+
+# Put system unit dependencies together.
+SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
+
+
+#
+# System Units (System, Objpas, Strings)
+#
+
+$(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp unxconst.inc $(SYSDEPS)
+        $(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
+
+objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
+        $(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
+
+
+dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
+
+
+strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\
+                   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc\
+                   $(SYSTEMUNIT)$(PPUEXT)
+
+#
+# System Dependent Units
+#
+
+unixtype$(PPUEXT): $(UNIXINC)/unixtype.pp $(UNIXINC)/ctypes.inc ptypes.inc $(SYSTEMUNIT)$(PPUEXT)
+
+baseunix$(PPUEXT) : errno.inc ptypes.inc $(UNIXINC)/ctypes.inc \
+  signal.inc $(UNIXINC)/bunxh.inc \
+  bunxsysc.inc \
+  ostypes.inc osmacro.inc $(UNIXINC)/gensigset.inc \
+  $(UNIXINC)/genfuncs.inc $(SYSTEMUNIT)$(PPUEXT)
+
+
+unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
+                 unxconst.inc $(UNIXINC)/timezone.inc \
+                 unxfunc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+linux$(PPUEXT) : baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+#
+# TP7 Compatible RTL Units
+#
+
+dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
+               unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+crt$(PPUEXT) : $(UNIXINC)/crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT)
+
+printer$(PPUEXT) : $(UNIXINC)/printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+#
+# Delphi Compatible Units
+#
+
+sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
+                    objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) sysconst$(PPUEXT)
+        $(COMPILER) -Fi$(OBJPASDIR)/sysutils $(UNIXINC)/sysutils.pp
+
+rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp
+	$(COMPILER) $(OBJPASDIR)/rtlconsts.pp
+
+classes$(PPUEXT) : $(UNIXINC)/classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
+                   sysutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) fgl$(PPUEXT)
+        $(COMPILER) -Fi$(OBJPASDIR)/classes $(UNIXINC)/classes.pp
+
+fgl$(PPUEXT) : $(OBJPASDIR)/fgl.pp objpas$(PPUEXT) types$(PPUEXT) system$(PPUEXT) sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/fgl.pp
+
+typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT) rtlconsts$(PPUEXT)
+        $(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
+
+math$(PPUEXT): $(OBJPASDIR)/math.pp objpas$(PPUEXT) sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/math.pp
+
+gettext$(PPUEXT): $(OBJPASDIR)/gettext.pp objpas$(PPUEXT) sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/gettext.pp
+
+varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
+                    $(OBJPASDIR)/varutilh.inc varutils.pp
+        $(COMPILER) -I$(OBJPASDIR) $(UNIXINC)/varutils.pp
+
+fmtbcd$(PPUEXT) : $(OBJPASDIR)/fmtbcd.pp objpas$(PPUEXT) sysutils$(PPUEXT) variants$(PPUEXT) classes$(PPUEXT) system$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/fmtbcd.pp
+
+types$(PPUEXT) : $(OBJPASDIR)/types.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/types.pp
+
+sysconst$(PPUEXT) : $(OBJPASDIR)/sysconst.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/sysconst.pp
+
+#
+# Mac Pascal Model
+#
+
+macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
+        $(COMPILER) $(INC)/macpas.pp $(REDIR)
+
+#
+# Other system-independent RTL Units
+#
+
+x86$(PPUEXT) : $(UNIXINC)/x86.pp $(SYSTEMUNIT)$(PPUEXT)
+
+ifeq ($(ARCH),x86_64)
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT)
+else
+cpu$(PPUEXT) : $(PROCINC)/cpu.pp $(SYSTEMUNIT)$(PPUEXT)
+endif
+
+mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
+
+heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
+        $(COMPILER) -Sg $(INC)/heaptrc.pp
+		
+fpextres$(PPUEXT) : $(INC)/extres.inc $(INC)/fpextres.pp $(SYSTEMUNIT)$(PPUEXT)
+		$(COMPILER) -Sg $(INC)/fpextres.pp
+
+lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT)
+
+lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT)
+
+charset$(PPUEXT) : $(INC)/charset.pp $(SYSTEMUNIT)$(PPUEXT)
+
+ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+#
+# Other system-dependent RTL Units
+#
+
+sockets$(PPUEXT) : $(UNIXINC)/sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
+                   unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+errors$(PPUEXT) : $(UNIXINC)/errors.pp strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+#ipc$(PPUEXT) : $(UNIXINC)/ipc.pp unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+
+terminfo$(PPUEXT) : terminfo.pp unix$(PPUEXT)
+
+callspec$(PPUEXT) : $(INC)/callspec.pp $(SYSTEMUNIT)$(PPUEXT)
+
+cmem$(PPUEXT) : $(INC)/cmem.pp $(SYSTEMUNIT)$(PPUEXT)
+
+cthreads$(PPUEXT) : $(UNIXINC)/cthreads.pp $(SYSTEMUNIT)$(PPUEXT)
+
+strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+                    sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/strutils.pp
+
+convutils$(PPUEXT) : $(OBJPASDIR)/convutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+                    sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/convutils.pp
+
+stdconvs$(PPUEXT) : $(OBJPASDIR)/stdconvs.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
+                    sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/stdconvs.pp
+
+dynlibs$(PPUEXT) : $(INC)/dynlibs.pas $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
+
+ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
+
+variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) math$(PPUEXT)
+        $(COMPILER) -Fi$(INC) $(INC)/variants.pp
+
+cwstring$(PPUEXT) : $(UNIXINC)/cwstring.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) baseunix$(PPUEXT) unix$(PPUEXT) unixtype$(PPUEXT) ctypes$(PPUEXT)
+

+ 61 - 0
rtl/symobi/bunxfunch.inc

@@ -0,0 +1,61 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2002 by Marco van de Voort
+
+    Headerfile  of bunxfunc.inc (which should be calls needed for the
+    Baseunix unit, but not for system)
+
+    Some calls that can be used for both Linux and *BSD will be
+    moved to a /unix/ includedfile later.
+
+    Note: calls named in bunxh.inc aren't listed here.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+//Function  FpSigProcMask(how : cInt; Const nset : TSigSet; var oset : TSigSet): cInt;
+//Function FPKill(Pid:pid_t;Sig:cint):cint;
+//function FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint;
+//Function FPSigPending(var nset: sigset_t):cint;
+//function FPsigsuspend(const sigmask:sigset_t):cint;
+Function SetITimer(Which : Longint;Const value : ItimerVal; var VarOValue:ItimerVal):Longint;
+Function GetITimer(Which : Longint;Var value : ItimerVal):Longint;
+//Function FPalarm(Seconds: cuint):cuint;
+//function sigblock(mask:cuint):cint;
+//function sigpause(sigmask:cint):cint;
+//function FPpause:cint;
+//function FPsleep(seconds:cuint):cuint;
+//function FPuname(var name:utsname):cint;
+//function FPwait(var stat_loc:cint): pid_t;
+//function FPgetpid : pid_t;
+//function FPgetppid : pid_t;
+//function FPgetuid : uid_t;
+//function FPgeteuid : uid_t;
+//function FPgetgid : gid_t;
+//function FPgetegid : gid_t;
+//function FPsetuid(uid : uid_t): cint;
+//function FPsetgid(gid : gid_t): cint;
+//function FPgetgroups(gidsetsize : cint; var grouplist:tgrparr): cint;
+//function FPgetpgrp : pid_t;
+//function FPsetsid : pid_t;
+//Function FPumask(cmask:mode_t):mode_t;
+//Function FPlink(existing:pchar;newone:pchar):cint;
+//Function FPmkfifo(path:pchar;mode:mode_t):cint;
+//Function FPchmod(path:pchar;mode:mode_t):cint;
+//Function FPchown(path:pchar;owner:uid_t;group:gid_t):cint;
+//Function FPUtime(path:pchar;times:putimbuf):cint;
+//Function FPpipe(var fildes : tfildes):cint;
+//function FPfcntl(fildes:cint;Cmd:cint;Arg:cint):cint;
+//function FPfcntl(fildes:cint;Cmd:cint;var Arg:flock):cint;
+//function FPfcntl(fildes:cint;Cmd:cint):cint;
+//function FPexecve(path:pchar;argv:ppchar;envp:ppchar):cint;
+//function FPexecv(path:pchar;argv:ppchar):cint;
+function FPgetrusage(who:cint;var ru : rusage):cint;
+//function FPtimes(var buffer : tms):clock_t;
+

+ 129 - 0
rtl/symobi/clocale.inc

@@ -0,0 +1,129 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by the Free Pascal development team.
+
+    Init rtl formating variables based on BSD like libc locales
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ **********************************************************************}
+
+{ Initial FreeBSD Implementation by Marco van de Voort.
+  Crosschecked with OS X 10.4/ppc headers.
+  To some symbols leading underscores were added. If these values are
+   ever exposed in an interface this has to be reevaluated.
+}
+
+{$IFDEF FPC}
+{$PACKRECORDS C}
+{$ENDIF}
+
+  __LC_ALL          = 0;
+  __LC_COLLATE      = 1;
+  __LC_CTYPE        = 2;
+  __LC_MONETARY     = 3;
+  __LC_NUMERIC      = 4;
+  __LC_TIME         = 5;
+  __LC_MESSAGES     = 6;
+  _LC_LAST         = 7;              { marks end }
+
+
+Type
+     lconv = record
+          currency_symbol   : pchar;
+          decimal_point     : pchar;
+          grouping          : pchar;
+          int_curr_symbol   : pchar;
+          mon_decimal_point : pchar;
+          mon_grouping      : pchar;
+          mon_thousands_sep : pchar;
+          negative_sign     : pchar;
+          positive_sign     : pchar;
+          thousands_sep     : pchar;
+          frac_digits       : char;
+          int_frac_digits   : char;
+          n_cs_precedes     : char;
+          n_sep_by_space    : char;
+          n_sign_posn       : char;
+          p_cs_precedes     : char;
+          p_sep_by_space    : char;
+          p_sign_posn       : char;
+       end;
+     Tlconv = lconv;
+     plconv = ^lconv;
+
+Const
+        CODESET         = 0;     { codeset name }
+        D_T_FMT         = 1;     { string for formatting date and time }
+        D_FMT           = 2;     { date format string }
+        T_FMT           = 3;     { time format string }
+        T_FMT_AMPM      = 4;     { a.m. or p.m. time formatting string }
+        AM_STR          = 5;     { Ante Meridian affix }
+        PM_STR          = 6;     { Post Meridian affix }
+
+{ week day names }
+        DAY_1           = 7;
+        DAY_2           = 8;
+        DAY_3           = 9;
+        DAY_4           = 10;
+        DAY_5           = 11;
+        DAY_6           = 12;
+        DAY_7           = 13;
+
+{ abbreviated week day names }
+        ABDAY_1         = 14;
+        ABDAY_2         = 15;
+        ABDAY_3         = 16;
+        ABDAY_4         = 17;
+        ABDAY_5         = 18;
+        ABDAY_6         = 19;
+        ABDAY_7         = 20;
+
+{ month names }
+        MON_1           = 21;
+        MON_2           = 22;
+        MON_3           = 23;
+        MON_4           = 24;
+        MON_5           = 25;
+        MON_6           = 26;
+        MON_7           = 27;
+        MON_8           = 28;
+        MON_9           = 29;
+        MON_10          = 30;
+        MON_11          = 31;
+        MON_12          = 32;
+
+{ abbreviated month names }
+        ABMON_1         = 33;
+        ABMON_2         = 34;
+        ABMON_3         = 35;
+        ABMON_4         = 36;
+        ABMON_5         = 37;
+        ABMON_6         = 38;
+        ABMON_7         = 39;
+        ABMON_8         = 40;
+        ABMON_9         = 41;
+        ABMON_10        = 42;
+        ABMON_11        = 43;
+        ABMON_12        = 44;
+                        
+        ERA             = 45;      { era description segments }
+        ERA_D_FMT       = 46;      { era date format string }
+        ERA_D_T_FMT     = 47;      { era date and time format string }
+        ERA_T_FMT       = 48;      { era time format string }
+        ALT_DIGITS      = 49;      { alternative symbols for digits }
+        RADIXCHAR       = 50;      { radix char }
+        THOUSEP         = 51;      { separator for thousands }
+
+        YESEXPR         = 52;      { affirmative response expression }
+        NOEXPR          = 53;      { negative response expression }
+        YESSTR          = 54;      { affirmative response for yes/no queries }
+        NOSTR           = 55;      { negative response for yes/no queries }
+        CRNCYSTR        = 56;      { currency symbol }
+        D_MD_ORDER      = 57;      { month/day order (local extension) }
+
+function localeconv:plconv; cdecl; external clib name 'localeconv';

+ 137 - 0
rtl/symobi/errno.inc

@@ -0,0 +1,137 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Michael Van Canneyt,
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+{
+
+  Errno.inc : define all error numbers, kernel version 1.2.13
+
+}
+Const
+
+
+        ESysEPERM               = 1;            { Operation not permitted }
+        ESysENOENT              = 2;            { No such file or directory }
+        ESysESRCH               = 3;            { No such process }
+        ESysEINTR               = 4;            { Interrupted system call }
+        ESysEIO                 = 5;            { Input/output error }
+        ESysENXIO               = 6;            { Device not configured }
+        ESysE2BIG               = 7;            { Argument list too long }
+        ESysENOEXEC             = 8;            { Exec format error }
+        ESysEBADF               = 9;            { Bad file descriptor }
+        ESysECHILD              = 10;           { No child processes }
+        ESysEDEADLK             = 11;           { Resource deadlock avoided }
+                                        { 11 was EAGAIN }
+        ESysENOMEM              = 12;           { Cannot allocate memory }
+        ESysEACCES              = 13;           { Permission denied }
+        ESysEFAULT              = 14;           { Bad address }
+        ESysENOTBLK             = 15;           { Block device required }
+        ESysEBUSY               = 16;           { Device busy }
+        ESysEEXIST              = 17;           { File exists }
+        ESysEXDEV               = 18;           { Cross-device link }
+        ESysENODEV              = 19;           { Operation not supported by device }
+        ESysENOTDIR             = 20;           { Not a directory }
+        ESysEISDIR              = 21;           { Is a directory }
+        ESysEINVAL              = 22;           { Invalid argument }
+        ESysENFILE              = 23;           { Too many open files in system }
+        ESysEMFILE              = 24;           { Too many open files }
+        ESysENOTTY              = 25;           { Inappropriate ioctl for device }
+        ESysETXTBSY             = 26;           { Text file busy. The new process was
+                                      a pure procedure (shared text) file which was
+                                      open for writing by another process, or file
+                                      which was open for writing by another process,
+                                      or while the pure procedure file was being
+                                      executed an open(2) call requested write access
+                                      requested write access.}
+        ESysEFBIG               = 27;           { File too large }
+        ESysENOSPC              = 28;           { No space left on device }
+        ESysESPIPE              = 29;           { Illegal seek }
+        ESysEROFS               = 30;           { Read-only file system }
+        ESysEMLINK              = 31;           { Too many links }
+        ESysEPIPE               = 32;           { Broken pipe }
+
+{ math software }
+        ESysEDOM                = 33;           { Numerical argument out of domain }
+        ESysERANGE              = 34;           { Result too large }
+
+{ non-blocking and interrupt i/o }
+        ESysEAGAIN              = 35;           { Resource temporarily unavailable }
+        ESysEWOULDBLOCK         = ESysEAGAIN;   { Operation would block }
+        ESysEINPROGRESS         = 36;           { Operation now in progress }
+        ESysEALREADY            = 37;           { Operation already in progress }
+
+{ ipc/network software -  - argument errors }
+        ESysENOTSOCK            = 38;           { Socket operation on non-socket }
+        ESysEDESTADDRREQ        = 39;           { Destination address required }
+        ESysEMSGSIZE            = 40;           { Message too long }
+        ESysEPROTOTYPE          = 41;           { Protocol wrong type for socket }
+        ESysENOPROTOOPT         = 42;           { Protocol not available }
+        ESysEPROTONOSUPPORT     = 43;           { Protocol not supported }
+        ESysESOCKTNOSUPPORT     = 44;           { Socket type not supported }
+        ESysEOPNOTSUPP          = 45;           { Operation not supported }
+        ESysENOTSUP             = ESysEOPNOTSUPP;       { Operation not supported }
+        ESysEPFNOSUPPORT        = 46;           { Protocol family not supported }
+        ESysEAFNOSUPPORT        = 47;           { Address family not supported by protocol family }
+        ESysEADDRINUSE          = 48;           { Address already in use }
+        ESysEADDRNOTAVAIL       = 49;           { Can't assign requested address }
+
+{ ipc/network software -  - operational errors }
+        ESysENETDOWN            = 50;           { Network is down }
+        ESysENETUNREACH         = 51;           { Network is unreachable }
+        ESysENETRESET           = 52;           { Network dropped connection on reset }
+        ESysECONNABORTED        = 53;           { Software caused connection abort }
+        ESysECONNRESET          = 54;           { Connection reset by peer }
+        ESysENOBUFS             = 55;           { No buffer space available }
+        ESysEISCONN             = 56;           { Socket is already connected }
+        ESysENOTCONN            = 57;           { Socket is not connected }
+        ESysESHUTDOWN           = 58;           { Can't send after socket shutdown }
+        ESysETOOMANYREFS        = 59;           { Too many references: can't splice }
+        ESysETIMEDOUT           = 60;           { Operation timed out }
+        ESysECONNREFUSED        = 61;           { Connection refused }
+
+        ESysELOOP               = 62;           { Too many levels of symbolic links }
+        ESysENAMETOOLONG        = 63;           { File name too long }
+
+{ should be rearranged }
+        ESysEHOSTDOWN           = 64;           { Host is down }
+        ESysEHOSTUNREACH        = 65;           { No route to host }
+        ESysENOTEMPTY           = 66;           { Directory not empty }
+
+{ quotas & mush }
+        ESysEPROCLIM            = 67;           { Too many processes }
+        ESysEUSERS              = 68;           { Too many users }
+        ESysEDQUOT              = 69;           { Disc quota exceeded }
+
+{ Network File System }
+        ESysESTALE              = 70;           { Stale NFS file handle }
+        ESysEREMOTE             = 71;           { Too many levels of remote in path }
+        ESysEBADRPC             = 72;           { RPC struct is bad }
+        ESysERPCMISMATCH        = 73;           { RPC version wrong }
+        ESysEPROGUNAVAIL        = 74;           { RPC prog. not avail }
+        ESysEPROGMISMATCH       = 75;           { Program version wrong }
+        ESysEPROCUNAVAIL        = 76;           { Bad procedure for program }
+
+        ESysENOLCK              = 77;           { No locks available }
+        ESysENOSYS              = 78;           { Function not implemented }
+
+        ESysEFTYPE              = 79;           { Inappropriate file type or format }
+        ESysEAUTH               = 80;           { Authentication error }
+        ESysENEEDAUTH           = 81;           { Need authenticator }
+        ESysEIDRM               = 82;           { Identifier removed }
+        ESysENOMSG              = 83;           { No message of desired type }
+        ESysEOVERFLOW           = 84;           { Value too large to be stored in data type }
+        ESysECANCELED           = 85;           { Operation canceled }
+        ESysEILSEQ              = 86;           { Illegal byte sequence }
+        ESysELAST               = 86;           { Must be equal largest errno }
+
+
+

+ 122 - 0
rtl/symobi/errnostr.inc

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

+ 82 - 0
rtl/symobi/i386/sighnd.inc

@@ -0,0 +1,82 @@
+{
+   This file is part of the Free Pascal run time library.
+   (c) 2000-2003 by Marco van de Voort
+   member of the Free Pascal development team.
+   (c) 2011 by Sven Barth adjusted for Symobi
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   Signalhandler for Symobi/i386
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+}
+
+CONST FPU_ALL=$7F;
+
+function getfpustate(Sigcontext:psigcontext):longint; {inline;}
+begin
+  getfpustate:=0;
+end;
+procedure SignalToRunerror(Sig: longint;info:psiginfo; SigContext: PSigContext); public name '_FPC_DEFAULTSIGHANDLER'; cdecl;
+
+var
+  res,fpustate : word;
+begin
+  res:=0;
+{$ifdef cpui386}
+  fpustate:=0;
+  asm
+    fnstsw fpustate
+  end;
+{$endif cpui386}
+  case sig of
+    SIGFPE :
+          begin
+    { this is not allways necessary but I don't know yet
+      how to tell if it is or not PM }
+          res:=200;
+          fpustate:=GetFPUState(SigContext);
+
+          if (FpuState and FPU_All) <> 0 then
+            begin
+              { first check the more precise options }
+              if (FpuState and FPU_DivisionByZero)<>0 then
+                res:=200
+              else if (FpuState and FPU_Overflow)<>0 then
+                res:=205
+              else if (FpuState and FPU_Underflow)<>0 then
+                res:=206
+              else if (FpuState and FPU_Denormal)<>0 then
+                res:=216
+              else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
+                res:=207
+              else if (FpuState and FPU_Invalid)<>0 then
+                res:=216
+              else
+                res:=207;  {'Coprocessor Error'}
+            end;
+          SysResetFPU;
+        end;
+    SIGILL,
+    SIGBUS,
+    SIGSEGV :
+        res:=216;
+    SIGINT:
+        res:=217;
+    SIGQUIT:
+        res:=233;
+  end;
+  reenable_signal(sig);
+{ give runtime error at the position where the signal was raised }
+  if res<>0 then
+   begin
+{$ifdef cpui386}
+      HandleErrorAddrFrame(res,pointer(SigContext^.sc_eip),pointer(SigContext^.sc_ebp));
+{$endif}
+   end;
+end;
+
+

+ 25 - 0
rtl/symobi/osdefs.inc

@@ -0,0 +1,25 @@
+{
+    Copyright (c) 2000-2002 by Marco van de Voort
+
+    Target dependent defines used when compileing the baseunix unit
+
+    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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************}
+
+{.$define usedomain}             // Allow uname with "domain" entry.
+                                // (which is a GNU extension)
+{.$define hassysctl}             // Use sysctl unit
+

+ 89 - 0
rtl/symobi/osmacro.inc

@@ -0,0 +1,89 @@
+{
+    Copyright (c) 2000-2002 by Marco van de Voort
+
+    The *BSD POSIX macro's that are used both in the Baseunix unit as the
+    system unit. Not aliased via public names because I want these to be
+    inlined as much as possible in the future.
+
+    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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************}
+
+function FPS_ISDIR(m : TMode): boolean;
+
+begin
+ FPS_ISDIR:=((m and S_IFMT) = S_IFDIR);
+end;
+
+function FPS_ISCHR(m : TMode): boolean;
+begin
+ FPS_ISCHR:=((m and S_IFMT) = S_IFCHR);
+end;
+
+function FPS_ISBLK(m : TMode): boolean;
+begin
+ FPS_ISBLK:=((m and S_IFMT) = S_IFBLK);
+end;
+
+function FPS_ISREG(m : TMode): boolean;
+begin
+ FPS_ISREG:=((m and S_IFMT) = S_IFREG);
+end;
+
+function FPS_ISFIFO(m : TMode): boolean;
+begin
+ FPS_ISFIFO:=((m and S_IFMT) = S_IFIFO);
+end;
+
+Function FPS_ISLNK(m:TMode):boolean;
+
+begin
+ FPS_ISLNK:=((m and S_IFMT) = S_IFLNK);
+end;
+
+Function FPS_ISSOCK(m:TMode):boolean;
+
+begin
+ FPS_ISSOCK:=((m and S_IFMT) = S_IFSOCK);
+end;
+
+function wifexited(status : cint): boolean;
+begin
+ wifexited:=(status AND 127) =0;
+end;
+
+function wexitstatus(status : cint): cint;
+begin
+ wexitstatus:=status shr 8;
+end;
+
+function wstopsig(status : cint): cint;
+begin
+ wstopsig:=status shr 8;
+end;
+
+const wstopped=127;
+
+function wifsignaled(status : cint): boolean;
+begin
+ wifsignaled:=((status and 127)<>wstopped) and ((status and 127)<>0);
+end;
+
+function wtermsig(status : cint):cint;
+
+begin
+ wtermsig:=cint(status and 127);
+end;
+

+ 15 - 0
rtl/symobi/osmain.inc

@@ -0,0 +1,15 @@
+{
+    This file is part of the Free Pascal run time library.
+
+    Main OS dependant body of the system unit, loosely modelled
+    after POSIX.  *BSD version (Linux version is near identical)
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+

+ 557 - 0
rtl/symobi/ossysc.inc

@@ -0,0 +1,557 @@
+{
+    Copyright (c) 2002 by Marco van de Voort
+
+    The base *BSD syscalls required to implement the system unit. These
+    are aliased for use in other units (to avoid poluting the system units
+    interface)
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ ****************************************************************************
+}
+
+
+function Fptime( tloc:ptime): time_t; [public, alias : 'FPC_SYSC_TIME'];
+
+VAR tv     : timeval;
+    tz     : timezone;
+    retval : longint;
+
+begin
+  Retval:=do_syscall(syscall_nr_gettimeofday,TSysParam(@tv),TSysParam(@tz));
+  If retval=-1 then
+   Fptime:=-1
+  else
+   Begin
+   If Assigned(tloc) Then
+     TLoc^:=tv.tv_sec;
+    Fptime:=tv.tv_sec;
+   End;
+End;
+
+{*****************************************************************************
+               --- File:File handling related calls ---
+*****************************************************************************}
+
+function Fpopen(path: pchar; flags : cint; mode: mode_t):cint; [public, alias : 'FPC_SYSC_OPEN'];
+
+Begin
+ Fpopen:=do_syscall(syscall_nr_open,TSysParam(path),TSysParam(flags),TSysParam(mode));
+End;
+
+function Fpclose(fd : cint): cint; [public, alias : 'FPC_SYSC_CLOSE'];
+
+begin
+ Fpclose:=do_syscall(syscall_nr_close,fd);
+end;
+
+{$ifdef netbsd}
+  {$ifdef cpupowerpc}
+    {$define netbsdmacppc}
+  {$endif}
+{$endif}
+
+{$ifdef netbsdmacppc}
+{$i sysofft.inc}                        // odd ball calling convention.
+{$else}
+  // generic versions.
+function Fplseek(fd : cint; offset : off_t; whence : cint): off_t; [public, alias : 'FPC_SYSC_LSEEK'];
+
+{
+this one is special for the return value being 64-bit..
+hi/lo offset not yet tested.
+
+NetBSD: ok, but implicit return value in edx:eax
+FreeBSD: same implementation as NetBSD.
+}
+
+begin
+  {$ifdef CPU64}
+    Fplseek:=do_syscall(syscall_nr___syscall,syscall_nr_lseek,TSysParam(fd),0,Offset,whence);
+  {$else}
+    Fplseek:=do_syscall(syscall_nr___syscall,syscall_nr_lseek,0,TSysParam(fd),0,lo(Offset),{0} hi(offset),Whence);
+  {$endif}
+end;
+
+function Fpftruncate(fd : cint; flength : off_t): cint; [public, alias : 'FPC_SYSC_FTRUNCATE'];
+
+begin
+ {$ifdef CPU64}
+   Fpftruncate:=Do_syscall(syscall_nr___syscall,syscall_nr_ftruncate, fd  ,0   ,flength);
+ {$else}
+   Fpftruncate:=Do_syscall(syscall_nr___syscall,syscall_nr_ftruncate,0,fd,0,lo(flength),hi(flength));
+ {$endif}
+
+end;
+
+
+Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; [public, alias:  'FPC_SYSC_MMAP'];
+
+begin
+ {$ifdef CPU64}
+  Fpmmap:=pointer(ptruint(do_syscall(TSysParam(syscall_nr_mmap),TSysParam(Start),TSysParam(Len),TSysParam(Prot),TSysParam(Flags),TSysParam(fd),0,TSysParam(offst))));
+{$else}
+ Fpmmap:=pointer(ptruint(do_syscall(syscall_nr_mmap,TSysParam(Start),Len,Prot,Flags,fd,0,
+         {$ifdef FPC_BIG_ENDIAN}    hi(offst),lo(offst){$endif}
+         {$ifdef FPC_LITTLE_ENDIAN} lo(offst),hi(offst){$endif}
+         )));
+{$endif}
+end;
+
+{$endif}
+
+
+function Fpread(fd: cint; buf: pchar; nbytes : size_t): ssize_t; [public, alias : 'FPC_SYSC_READ'];
+
+begin
+  Fpread:=do_syscall(syscall_nr_read,Fd,TSysParam(buf),nbytes);
+end;
+
+function Fpwrite(fd: cint;buf:pchar; nbytes : size_t): ssize_t; [public, alias : 'FPC_SYSC_WRITE'];
+
+begin
+ Fpwrite:=do_syscall(syscall_nr_write,Fd,TSysParam(buf),nbytes);
+end;
+
+function Fpunlink(const path: pchar): cint; [public, alias : 'FPC_SYSC_UNLINK'];
+
+begin
+  Fpunlink:=do_syscall(syscall_nr_unlink,TSysParam(path));
+end;
+
+function Fprename(old : pchar; newpath: pchar): cint; [public, alias : 'FPC_SYSC_RENAME'];
+
+begin
+  Fprename:=do_syscall(syscall_nr_rename,TSysParam(old),TSysParam(newpath));
+end;
+
+function Fpstat(const path: pchar; var buf : stat):cint; [public, alias : 'FPC_SYSC_STAT'];
+
+begin
+ Fpstat:=do_syscall(syscall_nr_stat,TSysParam(path),TSysParam(@buf));
+end;
+
+
+{*****************************************************************************
+               --- Directory:Directory related calls ---
+*****************************************************************************}
+
+function Fpchdir(path : pchar): cint; [public, alias : 'FPC_SYSC_CHDIR'];
+
+begin
+ Fpchdir:=do_syscall(syscall_nr_chdir,TSysParam(path));
+end;
+
+function Fpmkdir(path : pchar; mode: mode_t):cint; [public, alias : 'FPC_SYSC_MKDIR'];
+
+begin {Mode is 16-bit on F-BSD 4!}
+  Fpmkdir:=do_syscall(syscall_nr_mkdir,TSysParam(path),mode);
+end;
+
+function Fprmdir(path : pchar): cint;  [public, alias : 'FPC_SYSC_RMDIR'];
+
+begin
+ Fprmdir:=do_syscall(syscall_nr_rmdir,TSysParam(path));
+end;
+
+{$ifndef NewReaddir}
+
+const DIRBLKSIZ=1024;
+
+
+function Fpopendir(dirname : pchar): pdir;  [public, alias : 'FPC_SYSC_OPENDIR'];
+
+var
+  fd:longint;
+  st:stat;
+  ptr:pdir;
+begin
+  Fpopendir:=nil;
+  if Fpstat(dirname,st)<0 then
+   exit;
+{ Is it a dir ? }
+  if not((st.st_mode and $f000)=$4000)then
+   begin
+     errno:=ESysENOTDIR;
+     exit
+   end;
+{ Open it}
+  fd:=Fpopen(dirname,O_RDONLY,438);
+  if fd<0 then
+   Begin
+    Errno:=-1;
+    exit;
+   End;
+  new(ptr);
+  if ptr=nil then
+   Begin
+    Errno:=1;
+    exit;
+   End;
+  Getmem(ptr^.dd_buf,2*DIRBLKSIZ);
+  if ptr^.dd_buf=nil then
+   exit;
+  ptr^.dd_fd:=fd;
+  ptr^.dd_loc:=-1;
+  ptr^.dd_rewind:=ptrint(ptr^.dd_buf);
+  ptr^.dd_size:=0;
+//  ptr^.dd_max:=sizeof(ptr^.dd_buf^);
+  Fpopendir:=ptr;
+end;
+
+function Fpclosedir(dirp : pdir): cint; [public, alias : 'FPC_SYSC_CLOSEDIR'];
+
+begin
+  Fpclosedir:=Fpclose(dirp^.dd_fd);
+  Freemem(dirp^.dd_buf);
+  dispose(dirp);
+end;
+
+function Fpreaddir(dirp : pdir) : pdirent; [public, alias : 'FPC_SYSC_READDIR'];
+
+{Different from Linux, Readdir on BSD is based on Getdents, due to the
+missing of the readdir syscall.
+Getdents requires the buffer to be larger than the blocksize.
+This usually the sectorsize =512 bytes, but maybe tapedrives and harddisks
+with blockmode have this higher?}
+
+function readbuffer:longint;
+
+var retval :longint;
+
+begin
+ Retval:=do_syscall(syscall_nr_getdents,TSysParam(dirp^.dd_fd),TSysParam(@dirp^.dd_buf^),DIRBLKSIZ {sizeof(getdentsbuffer)});
+   dirp^.dd_rewind:=TSysParam(dirp^.dd_buf);
+   if retval=0 then
+    begin
+     dirp^.dd_rewind:=0;
+     dirp^.dd_loc:=0;
+    end
+   else
+    dirP^.dd_loc:=retval;
+   dirP^.dd_size:=retval;
+ readbuffer:=retval;
+end;
+
+var
+    FinalEntry     : pdirent;
+    novalid        : boolean;
+    Reclen         : Longint;
+    CurEntry       : PDirent;
+
+begin
+ if (dirp^.dd_buf=nil) or (dirp^.dd_loc=0) THEN
+  exit(nil);
+ if (dirp^.dd_loc=-1)   OR     {First readdir on this pdir. Initial fill of buffer}
+   (dirp^.dd_rewind>=(ptrint(dirp^.dd_buf)+dirp^.dd_size)) then  {no more entries left?}
+  Begin
+    if readbuffer=0 then        {succesful read?}
+     Exit(NIL);                 {No more data}
+  End;
+ FinalEntry:=NIL;
+ CurEntry:=nil;
+ repeat
+  novalid:=false;
+  CurEntry:=pdirent(dirp^.dd_rewind);
+  RecLen:=CurEntry^.d_reclen;
+  if RecLen<>0 Then
+   begin {valid direntry?}
+    if CurEntry^.d_fileno<>0 then
+     FinalEntry:=CurEntry;
+    inc(dirp^.dd_rewind,Reclen);
+   end
+  else
+   begin {block entirely searched or reclen=0}
+    Novalid:=True;
+    if dirp^.dd_loc<>0 THEN             {blocks left?}
+     if readbuffer()<>0 then        {succesful read?}
+      novalid:=false;
+   end;
+ until (FinalEntry<>nil) or novalid;
+ If novalid then
+  FinalEntry:=nil;
+ FpReadDir:=FinalEntry;
+end;
+{$endif}
+
+{*****************************************************************************
+        --- Process:Process & program handling - related calls ---
+*****************************************************************************}
+
+procedure Fpexit(status : cint); [public, alias : 'FPC_SYSC_EXIT'];
+
+begin
+  do_syscall(syscall_nr_exit,status);
+end;
+
+{
+  Change action of process upon receipt of a signal.
+  Signum specifies the signal (all except SigKill and SigStop).
+  If Act is non-nil, it is used to specify the new action.
+  If OldAct is non-nil the previous action is saved there.
+}
+
+function Fpsigaction(sig: cint; act, oact: psigactionrec): cint; [public, alias : 'FPC_SYSC_SIGACTION'];
+
+{
+  Change action of process upon receipt of a signal.
+  Signum specifies the signal (all except SigKill and SigStop).
+  If Act is non-nil, it is used to specify the new action.
+  If OldAct is non-nil the previous action is saved there.
+}
+
+begin
+  do_syscall(syscall_nr_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact));
+end;
+
+(*=================== MOVED from sysunix.inc ========================*)
+
+
+function Fpfstat(fd : cint; var sb : stat): cint;  [public, alias : 'FPC_SYSC_FSTAT'];
+
+begin
+  fpFStat:=do_SysCall(syscall_nr_fstat,fd,TSysParam(@sb));
+end;
+
+{$ifdef NewReaddir}
+{$I readdir.inc}
+{$endif}
+
+function Fpfork : pid_t;  [public, alias : 'FPC_SYSC_FORK'];
+{
+  This function issues the 'fork' System call. the program is duplicated in memory
+  and Execution continues in parent and child process.
+  In the parent process, fork returns the PID of the child. In the child process,
+  zero is returned.
+  A negative value indicates that an error has occurred, the error is returned in
+  LinuxError.
+}
+
+Begin
+ Fpfork:=Do_syscall(SysCall_nr_fork);
+End;
+
+{
+function Fpexecve(const path : pathstr; const argv : ppchar; const envp: ppchar): cint;
+}
+{
+  Replaces the current program by the program specified in path,
+  arguments in args are passed to Execve.
+  environment specified in ep is passed on.
+}
+
+{
+Begin
+  path:=path+#0;
+  do_syscall(syscall_nr_Execve,TSysParam(@path[1]),TSysParam(Argv),TSysParam(envp));
+End;
+}
+{
+function Fpexecve(const path : pchar; const argv : ppchar; const envp: ppchar): cint;  [public, alias : 'FPC_SYSC_EXECVE'];
+}
+{
+  Replaces the current program by the program specified in path,
+  arguments in args are passed to Execve.
+  environment specified in ep is passed on.
+}
+{
+Begin
+  do_syscall(syscall_nr_Execve,TSysParam(path),TSysParam(Argv),TSysParam(envp));
+End;
+}
+function Fpwaitpid(pid : pid_t; stat_loc : pcint; options: cint): pid_t; [public, alias : 'FPC_SYSC_WAITPID'];
+{
+  Waits until a child with PID Pid exits, or returns if it is exited already.
+  Any resources used by the child are freed.
+  The exit status is reported in the adress referred to by Status. It should
+  be a longint.
+}
+
+begin // actually a wait4() call with 4th arg 0.
+ FpWaitPID:=do_syscall(syscall_nr_WaitPID,PID,TSysParam(Stat_loc),options,0);
+end;
+
+function Fpaccess(const pathname : pchar; amode : cint): cint; [public, alias : 'FPC_SYSC_ACCESS'];
+{
+  Test users access rights on the specified file.
+  Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
+  R,W,X stand for read,write and Execute access, simultaneously.
+  F_OK checks whether the test would be allowed on the file.
+  i.e. It checks the search permissions in all directory components
+  of the path.
+  The test is done with the real user-ID, instead of the effective.
+  If access is denied, or an error occurred, false is returned.
+  If access is granted, true is returned.
+  Errors other than no access,are reported in unixerror.
+}
+
+begin
+ FpAccess:=do_syscall(syscall_nr_access,TSysParam(pathname),amode);
+end;
+{
+function Fpaccess(const pathname : pathstr; amode : cint): cint;
+
+{
+  Test users access rights on the specified file.
+  Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
+  R,W,X stand for read,write and Execute access, simultaneously.
+  F_OK checks whether the test would be allowed on the file.
+  i.e. It checks the search permissions in all directory components
+  of the path.
+  The test is done with the real user-ID, instead of the effective.
+  If access is denied, or an error occurred, false is returned.
+  If access is granted, true is returned.
+  Errors other than no access,are reported in unixerror.
+}
+
+begin
+ pathname:=pathname+#0;
+ Access:=do_syscall(syscall_nr_access, TSysParam(@pathname[1]),mode)=0;
+end;
+}
+
+Function FpDup(fildes:cint):cint; [public, alias : 'FPC_SYSC_DUP'];
+
+begin
+  Fpdup:=Do_syscall(syscall_nr_dup,TSysParam(fildes));
+end;
+
+Function FpDup2(fildes,fildes2:cint):cint; [public, alias : 'FPC_SYSC_DUP2'];
+
+begin
+ Fpdup2:=do_syscall(syscall_nr_dup2,TSysParam(fildes),TSysParam(fildes2));
+end;
+
+
+
+Function Fpmunmap(start:pointer;len:size_t):cint;    [public, alias :'FPC_SYSC_MUNMAP'];
+begin
+  Fpmunmap:=do_syscall(syscall_nr_munmap,TSysParam(start),Len);
+end;
+
+
+{
+  Interface to Unix ioctl call.
+  Performs various operations on the filedescriptor Handle.
+  Ndx describes the operation to perform.
+  Data points to data needed for the Ndx function. The structure of this
+  data is function-dependent.
+}
+
+Function FpIOCtl(Handle:cint;Ndx: TIOCtlRequest;Data: Pointer):cint; [public, alias : 'FPC_SYSC_IOCTL'];
+// This was missing here, instead hardcoded in Do_IsDevice
+begin
+  FpIOCtl:=do_SysCall(syscall_nr_ioctl,handle,Ndx,TSysParam(data));
+end;
+
+
+Function FpGetPid:LongInt;   [public, alias : 'FPC_SYSC_GETPID'];
+{
+  Get Process ID.
+}
+
+begin
+ FpGetPID:=do_syscall(syscall_nr_getpid);
+end;
+
+function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; [public, alias: 'FPC_SYSC_GETTIMEOFDAY'];
+
+begin
+ fpgettimeofday:=do_syscall(syscall_nr_gettimeofday,TSysParam(tp),TSysParam(tzp));
+end;
+
+function FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint; [public, alias : 'FPC_SYSC_SIGPROCMASK'];
+
+{
+  Change the list of currently blocked signals.
+  How determines which signals will be blocked :
+   SigBlock   : Add SSet to the current list of blocked signals
+   SigUnBlock : Remove the signals in SSet from the list of blocked signals.
+   SigSetMask : Set the list of blocked signals to SSet
+  if OldSSet is non-null, the old set will be saved there.
+}
+
+begin
+  FPsigprocmask:=do_syscall(syscall_nr_sigprocmask,tsysparam(how),TSysParam(nset),TSysParam(oset));
+end;
+{$user BLA!}
+Function FpNanoSleep(req : ptimespec;rem : ptimespec) : cint; [public, alias : 'FPC_SYSC_NANOSLEEP'];
+begin
+  FpNanoSleep:=Do_SysCall(syscall_nr_nanosleep,TSysParam(req),TSysParam(rem));
+end;
+
+function Fpgetcwd(pt:pchar; _size:size_t):pchar;[public, alias :'FPC_SYSC_GETCWD'];
+const intpathmax = 1024-4;      // didn't use POSIX data in libc
+                                // implementation.
+var ept,bpt : pchar;
+    c       : char;
+    ret     : cint;
+
+begin
+   if pt=NIL Then
+    begin
+      // POSIX: undefined. (exit(nil) ?)
+      // BSD  : allocate mem for path.
+      getmem(pt,intpathmax);
+      if pt=nil Then
+        exit(nil);
+      ept:=pt+intpathmax;
+    end
+   else
+    Begin
+      if (_size=0) Then
+        Begin
+          seterrno(ESysEINVAL);
+          exit(nil);
+        End;
+      if (_size=1) Then
+        Begin
+          seterrno(ESysERANGE);
+          exit(nil);
+        End;
+      ept:=pt+_size;
+    end;
+
+    ret := do_syscall(syscall_nr___getcwd,TSysParam(pt),TSysParam( ept - pt));
+    If (ret = 0) Then
+      begin
+        If (pt[0] <> '/') Then
+           Begin
+             bpt := pt;
+             ept := pt + strlen(pt) - 1;
+             While (bpt < ept) Do
+               Begin
+                 c := bpt^;
+                 bpt^:=ept^;
+                 inc(bpt);
+                 ept^:=c;
+                 dec(ept);
+               End;
+           End
+      end
+         else
+            pt:=nil;
+ Fpgetcwd:=pt;
+end;
+
+Function fpReadLink(name,linkname:pchar;maxlen:size_t):cint; [public, alias : 'FPC_SYSC_READLINK'];
+
+begin
+  fpreadlink:=do_syscall(syscall_nr_readlink, TSysParam(name),TSysParam(linkname),maxlen);
+end;
+
+function FpGetRLimit(resource:cint;rlim:PRLimit):cint; [public, alias : 'FPC_SYSC_GETRLIMIT'];
+begin
+  fpgetrlimit:=do_syscall(syscall_nr_getrlimit,TSysParam(Resource),TSysParam(rlim));
+end;
+
+function FpSetRLimit(Resource:cint;rlim:PRLimit):cint; [public, alias : 'FPC_SYSC_SETRLIMIT'];
+begin
+  fpsetrlimit:=do_syscall(syscall_nr_setrlimit,TSysParam(Resource),TSysParam(rlim));
+end;
+

+ 334 - 0
rtl/symobi/ostypes.inc

@@ -0,0 +1,334 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2001 by Free Pascal development team
+
+    Types and structures for baseunix unit, also used in system.
+
+    This file implements all the types/constants which must
+    be defined to port FPC to a new POSIX compliant OS.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{***********************************************************************}
+{                         POSIX STRUCTURES                              }
+{***********************************************************************}
+
+{$ifdef FPC_IS_SYSTEM}
+  {$i ptypes.inc}
+{$ENDIF}
+
+{$ifdef cpupowerpc}
+  {$ifdef netbsd}
+    {$define netbsdpowerpc}
+  {$endif}
+{$endif}
+
+{$if defined(darwin) and defined(cpuarm)}
+  {$define darwinarm}
+{$endif}
+
+//      CONST SYS_NMLN=65;
+
+// Can't find these two in Posix and in FreeBSD
+//CONST
+//    _UTSNAME_LENGTH = ;
+//    _UTSNAME_NODENAME_LENGTH = ;
+
+CONST                           // OS specific parameters for general<fd,sig>set behaviour
+   BITSINWORD      = 8*sizeof(longint);
+   FD_MAXFDSET     = 1024;
+   ln2bitsinword   = 5;         { 32bit : ln(32)/ln(2)=5 }
+   ln2bitmask      = 1 shl ln2bitsinword - 1;
+   wordsinfdset    = FD_MAXFDSET DIV BITSINWORD;        // words in fdset_t
+   wordsinsigset   = SIG_MAXSIG  DIV BITSINWORD;
+
+TYPE
+   { system information services }
+   utsname = record
+              sysname : Array[0..SYS_NMLN-1] OF Char;   // Name of this OS
+              nodename: Array[0..SYS_NMLN-1] OF Char;   // Name of this network node.
+              release : Array[0..SYS_NMLN-1] OF Char;   // Release level.
+              version : Array[0..SYS_NMLN-1] OF Char;   // Version level.
+              machine : Array[0..SYS_NMLN-1] OF Char;   // Hardware type.
+             end;
+  TUtsName= utsname;
+  pUtsName= ^utsname;
+
+  { file characteristics services }
+   stat    = packed record { the types are real}
+        st_dev        : dev_t;             // inode's device
+        st_ino        : ino_t;             // inode's number
+        st_mode       : mode_t;            // inode protection mode
+        st_nlink      : nlink_t;           // number of hard links
+        st_uid        : uid_t;             // user ID of the file's owner
+        st_gid        : gid_t;             // group ID of the file's group
+        st_rdev       : dev_t;             // device type
+		st_size       : off_t;             // file size
+{
+		// Symobi normally has this defined
+		st_atim       : timespec;         
+		st_mtim       : timespec;
+		st_ctim       : timespec;
+}
+		// but for compatibility in the Unix RTL this will be used
+        st_atime      : time_t;            // time of last access
+        st_atimensec  : clong;             // nsec of last access
+        st_mtime      : time_t;            // time of last data modification
+        st_mtimensec  : clong;             // nsec of last data modification
+        st_ctime      : time_t;            // time of last file status change
+        st_ctimensec  : clong;             // nsec of last file status change
+		
+        st_blksize    : size_t;           // optimal blocksize for I/O
+        st_blocks     : cuint64;            // blocks allocated for file
+   end;
+   TStat = stat;
+   pStat = ^stat;
+
+  { directory services }
+   dirent  = packed record
+        d_fileno      : ino_t;                        // file number of entry
+        d_reclen      : cuint16;                        // length of this record
+        d_namlen      : cint;                         // length of string in d_name
+        d_type        : cuint8;                         // file type, see below
+        d_name        : array[0..(255 + 1)-1] of char;  // name must be no longer than this
+		d_ino         : ino_t;
+   end;
+   TDirent = dirent;
+   pDirent = ^dirent;
+
+   dir     = packed record
+        dd_fd     : cint;         // file descriptor associated with directory
+        dd_loc    : clong;        // offset in current buffer
+        dd_size   : clong;        // amount of data returned by getdirentries
+        dd_buf    : pchar;        // data buffer
+        dd_len    : cint;         // size of data buffer
+{$ifdef netbsdpowerpc}
+        dd_pad1   : cint;
+        dd_seek   : cint64;        // magic cookie returned by getdirentries
+{$else}
+        dd_seek   : clong;        // magic cookie returned by getdirentries
+{$endif}
+        dd_rewind : clong;        // magic cookie for rewinding
+        dd_flags  : cint;         // flags for readdir
+{$ifdef darwin}
+        __dd_lock : pthread_mutex_t; // for thread locking
+        __dd_td : pointer;        // telldir position recording
+{$endif}
+   end;
+   TDir    = dir;
+   pDir    = ^dir;
+
+   utimbuf  = record
+                actime  : time_t;
+                modtime : time_t;
+                end;
+   TUtimBuf = utimbuf;
+   putimbuf = ^utimbuf;
+
+   flock    = record
+                l_type  : cshort;       { lock type: read/write, etc. }
+                l_whence: cshort;       { type of l_start }
+                l_start : off_t;        { starting offset }
+                l_len   : off_t;        { len = 0 means until end of file }
+                l_pid   : pid_t;        { lock owner }
+                end;
+   TFlock   = flock;
+   pFlock   = ^flock;
+
+ tms = packed record
+         tms_utime  : clock_t;  { User CPU time }
+         tms_stime  : clock_t;  { System CPU time }
+         tms_cutime : clock_t;  { User CPU time of terminated child procs }
+         tms_cstime : clock_t;  { System CPU time of terminated child procs }
+         end;
+ TTms= tms;
+ pTms= ^tms;
+
+ TFDSet    = ARRAY[0..(FD_MAXFDSET div 32)-1] of Cardinal;
+ pFDSet    = ^TFDSet;
+
+{***********************************************************************}
+{                  POSIX CONSTANT ROUTINE DEFINITIONS                   }
+{***********************************************************************}
+CONST
+    { access routine - these maybe OR'ed together }
+    F_OK        =     0;        { test for existence of file }
+    R_OK        =     4;        { test for read permission on file }
+    W_OK        =     2;        { test for write permission on file }
+    X_OK        =     1;        { test for execute or search permission }
+    { seek routine }
+    SEEK_SET    =     0;        { seek from beginning of file }
+    SEEK_CUR    =     1;        { seek from current position  }
+    SEEK_END    =     2;        { seek from end of file       }
+    { open routine                                 }
+    { File access modes for `open' and `fcntl'.    }
+    O_RDONLY    =     0;        { Open read-only.  }
+    O_WRONLY    =     1;        { Open write-only. }
+    O_RDWR      =     2;        { Open read/write. }
+    { Bits OR'd into the second argument to open.  }
+    O_CREAT     =  $200;        { Create file if it doesn't exist.  }
+    O_EXCL      =  $800;        { Fail if file already exists.      }
+    O_TRUNC     =  $400;        { Truncate file to zero length.     }
+    O_NOCTTY    = $8000;        { Don't assign a controlling terminal. }
+    { File status flags for `open' and `fcntl'.  }
+    O_APPEND    =     8;        { Writes append to the file.        }
+    O_NONBLOCK  =     4;        { Non-blocking I/O.                 }
+
+    { mode_t possible values                                 }
+    S_IRUSR =  %0100000000;     { Read permission for owner   }
+    S_IWUSR =  %0010000000;     { Write permission for owner  }
+    S_IXUSR =  %0001000000;     { Exec  permission for owner  }
+    S_IRGRP =  %0000100000;     { Read permission for group   }
+    S_IWGRP =  %0000010000;     { Write permission for group  }
+    S_IXGRP =  %0000001000;     { Exec permission for group   }
+    S_IROTH =  %0000000100;     { Read permission for world   }
+    S_IWOTH =  %0000000010;     { Write permission for world  }
+    S_IXOTH =  %0000000001;     { Exec permission for world   }
+
+    { Used for waitpid }
+    WNOHANG   =          1;     { don't block waiting               }
+    WUNTRACED =          2;     { report status of stopped children }
+
+
+  { For File control mechanism }
+  F_GetFd  = 1;
+  F_SetFd  = 2;
+  F_GetFl  = 3;
+  F_SetFl  = 4;
+  F_GetLk  = 5;
+  F_SetLk  = 6;
+  F_SetLkW = 7;
+  F_SetOwn = 8;
+  F_GetOwn = 9;
+{$ifdef darwin}
+  F_CHKCLEAN       = 41;          { Used for regression test }
+  F_PREALLOCATE    = 42;          { Preallocate storage }
+  F_SETSIZE        = 43;          { Truncate a file without zeroing space }     
+  F_RDADVISE       = 44;          { Issue an advisory read async with no copy to user }
+  F_RDAHEAD        = 45;          { turn read ahead off/on }
+  F_READBOOTSTRAP  = 46;          { Read bootstrap from disk }
+  F_WRITEBOOTSTRAP = 47;          { Write bootstrap on disk }
+  F_NOCACHE        = 48;          { turning data caching off/on }
+  F_LOG2PHYS       = 49;          { file offset to device offset }
+  F_GETPATH        = 50;          { return the full path of the fd }
+  F_FULLFSYNC      = 51;          { fsync + ask the drive to flush to the media }
+  F_PATHPKG_CHECK  = 52;          { find which component (if any) is a package }
+  F_FREEZE_FS      = 53;          { "freeze" all fs operations }
+  F_THAW_FS        = 54;          { "thaw" all fs operations }
+  F_GLOBAL_NOCACHE = 55;          { turn data caching off/on (globally) for this file }
+{$endif}
+
+
+type
+  timezone = packed record
+    tz_minuteswest,
+    tz_dsttime  : cint;
+  end;
+  ptimezone =^timezone;
+  TTimeZone = timezone;
+
+  rusage = packed record
+        ru_utime    : timeval;          { user time used }
+        ru_stime    : timeval;          { system time used }
+        end;
+// #define      ru_last         ru_nivcsw
+// #define      ru_first        ru_ixrss
+
+
+Const
+  S_IFMT   = $F000;   	(* Mask for filetypes *)
+  S_IFIFO  = $1000;   	(* FIFO or pipe *)
+  S_IFCHR  = $2000;   	(* Char special device *)
+  S_IFDIR  = $4000;   	(* Directory *)
+  S_IFBLK  = $6000;   	(* Block special devive *)
+  S_IFREG  = $8000;   	(* Regular file *)
+  S_IFLNK  = $A000;   	(* Symbolic link *)
+  S_IFSOCK = $C000;      (* Socket *)
+  S_IFWHT  = $E000;      (* Whiteout object, unused *)
+
+{
+ * Resource limits from FreeBSD5. To be checked for the others.
+}
+  RLIMIT_CPU      = 0;              { cpu time in milliseconds }
+  RLIMIT_FSIZE    = 1;              { maximum file size }
+  RLIMIT_DATA     = 2;              { data size }
+  RLIMIT_STACK    = 3;              { stack size }
+  RLIMIT_CORE     = 4;              { core file size }
+  RLIMIT_RSS      = 5;              { resident set size }
+  RLIMIT_MEMLOCK  = 6;              { locked-in-memory address space }
+  RLIMIT_NPROC    = 7;              { number of processes }
+  RLIMIT_NOFILE   = 8;              { number of open files }
+{$IFDEF FreeBSD}
+  RLIMIT_SBSIZE   = 9;              { maximum size of all socket buffers }
+  RLIMIT_VMEM     =10;              { virtual process size (inclusive of mmap) }
+  RLIMIT_AS       = RLIMIT_VMEM;    
+{$ELSE}
+  RLIMIT_AS       = 5;    	    { address space= resident set size}
+{$ENDIF}
+
+  {$ifdef FreeBSD}
+  RLIM_NLIMITS    =11;              { number of resource limits }
+  {$endif}
+
+  {$ifdef Darwin}   // OS X 10.3
+  RLIM_NLIMITS    =9;              { number of resource limits }
+  {$endif}
+
+Type 
+        TRLimit  = record
+                     rlim_cur,               { current (soft) limit }
+          	     rlim_max : TRLim;     { maximum value for rlim_cur }
+		    end;	
+        PRLimit  = ^TRLimit;
+      
+  iovec = record
+            iov_base : pointer;
+	    iov_len  : size_t;
+	   end;
+  tiovec=iovec;
+  piovec=^tiovec;		
+ 
+CONST
+ { Constansts for MMAP }
+{$ifdef FPC_IS_SYSTEM}
+  MAP_PRIVATE   =2;
+{$endif}
+  MAP_ANONYMOUS =$1000;
+
+const
+  POLLIN      = $0001;
+  POLLPRI     = $0002;
+  POLLOUT     = $0004;
+  POLLERR     = $0008;
+  POLLHUP     = $0010;
+  POLLNVAL    = $0020;
+
+  { XOpen, XPG 4.2 }
+  POLLRDNORM  = $0040;
+  POLLRDBAND  = $0080;
+  POLLWRNORM  = POLLOUT;
+  POLLWRBAND  = $0100;
+
+type
+  pollfd = record
+    fd: cint;
+    events: cshort;
+    revents: cshort;
+  end;
+  tpollfd = pollfd;
+  ppollfd = ^pollfd;
+
+    {*************************************************************************}
+    {                               SIGNALS                                   }
+    {*************************************************************************}
+
+{$i signal.inc}
+
+

+ 87 - 0
rtl/symobi/pthread.inc

@@ -0,0 +1,87 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Peter Vreman
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This file contains a pthread.h headerconversion,
+    and should contain an interface to the threading library to be
+    used by systhrd, preferably in a somewhat compatible notation
+    (compared to the other OSes).
+
+    As a start, I simply used libc_r
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+CONST PTHREAD_EXPLICIT_SCHED       = 0;
+      PTHREAD_CREATE_DETACHED      = 1;
+      PTHREAD_SCOPE_PROCESS        = 0;
+	  
+	  
+ TYPE
+    ppthread_t      = ^pthread_t;
+    ppthread_key_t  = ^pthread_key_t;
+    ppthread_mutex_t= ^pthread_mutex_t;
+    ppthread_attr_t = ^pthread_attr_t;
+    ppthread_cond_t            = ^pthread_cond_t;
+    ppthread_condattr_t        = ^pthread_condattr_t;
+
+    __destr_func_t  = procedure (p :pointer);cdecl;
+    __startroutine_t= function (p :pointer):pointer;cdecl;
+    ppthread_mutexattr_t = ^pthread_mutexattr_t;
+    ppthread_mutex_attr_t = ^pthread_mutexattr_t;
+
+    sem_t           = cint;
+    psem_t          = ^sem_t;
+    TSemaphore         = sem_t;
+    PSemaphore         = ^TSemaphore;
+
+function  pthread_getspecific      (t : pthread_key_t):pointer; cdecl; external libc;
+function  pthread_setspecific      (t : pthread_key_t;p:pointer):cint; cdecl; external libc;
+function  pthread_key_create       (p : ppthread_key_t;f: __destr_func_t):cint; cdecl;external libc;
+function  pthread_attr_init           (p : ppthread_attr_t):cint; cdecl; external libc;
+function  pthread_attr_setinheritsched(p : ppthread_attr_t;i:cint):cint; cdecl; external libc;
+function  pthread_attr_setscope      (p : ppthread_attr_t;i:cint):cint;cdecl;external libc;
+function  pthread_attr_setdetachstate (p : ppthread_attr_t;i:cint):cint;cdecl;external libc;
+function  pthread_attr_setstacksize(p: ppthread_attr_t; stacksize: size_t):cint;cdecl;external libc;
+function  pthread_create ( p: ppthread_t;attr : ppthread_attr_t;f:__startroutine_t;arg:pointer):cint;cdecl;external libc;
+procedure pthread_exit  ( p: pointer); cdecl;external libc;
+function  pthread_self:pthread_t; cdecl;external libc;
+function  pthread_mutex_init (p:ppthread_mutex_t;o:ppthread_mutex_attr_t):cint; cdecl;external libc;
+function  pthread_mutex_destroy (p:ppthread_mutex_attr_t):cint; cdecl;external libc;
+function  pthread_mutex_lock    (p:ppthread_mutex_attr_t):cint; cdecl;external libc;
+function  pthread_mutex_trylock    (p:ppthread_mutex_attr_t):cint; cdecl;external libc;
+function  pthread_mutex_unlock  (p:ppthread_mutex_attr_t):cint; cdecl;external libc;
+function  pthread_cancel(_para1:pthread_t):cint;cdecl;external libc;
+function  pthread_detach(_para1:pthread_t):cint;cdecl;external libc;
+function  pthread_join(_para1:pthread_t; _para2:Ppointer):cint;cdecl;external libc;
+function pthread_cond_destroy(_para1:Ppthread_cond_t):cint;cdecl;external libc;
+function pthread_cond_init(_para1:Ppthread_cond_t;_para2:Ppthread_condattr_t):cint;cdecl;external libc;
+function pthread_cond_signal(_para1:Ppthread_cond_t):cint;cdecl;external libc;
+function pthread_cond_broadcast(_para1:Ppthread_cond_t):cint;cdecl;external libc;
+function pthread_cond_wait(_para1:Ppthread_cond_t;_para2:Ppthread_mutex_t):cint;cdecl;external libc;
+function pthread_kill(__thread:pthread_t; __signo:cint):cint;cdecl;external libc;
+function pthread_sigmask(how: cint; nset: psigset; oset: psigset): cint; cdecl; external libc;
+
+function sem_init(__sem:Psem_t; __pshared:cint;__value:dword):cint;cdecl; external libc;
+function sem_destroy(__sem:Psem_t):cint;cdecl;external libc;
+function sem_close(__sem:Psem_t):cint;cdecl;external libc;
+function sem_unlink(__name:Pchar):cint;cdecl;external libc;
+function sem_wait(__sem:Psem_t):cint;cdecl;external libc;
+function sem_trywait(__sem:Psem_t):cint;cdecl;external libc;
+function sem_post(__sem:Psem_t):cint;cdecl;external libc;
+function sem_getvalue(__sem:Psem_t; __sval:Pcint):cint;cdecl;external libc;
+function pthread_mutexattr_init(_para1:Ppthread_mutexattr_t):cint;cdecl;external libc;
+function pthread_mutexattr_destroy(_para1:Ppthread_mutexattr_t):cint;cdecl;external libc;
+function pthread_mutexattr_gettype(_para1:Ppthread_mutexattr_t; _para2:Pcint):cint;cdecl;external libc;
+function pthread_mutexattr_settype(_para1:Ppthread_mutexattr_t; _para2:cint):cint;cdecl;external libc;
+function pthread_cond_timedwait(__cond:ppthread_cond_t; __mutex:ppthread_mutex_t; __abstime:ptimespec):longint;cdecl;external libc;
+
+
+

+ 299 - 0
rtl/symobi/ptypes.inc

@@ -0,0 +1,299 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2001 by Free Pascal development team
+
+    This file implements all the base types and limits required
+    for a minimal POSIX compliant subset required to port the compiler
+    to a new OS.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{***********************************************************************}
+{                       POSIX TYPE DEFINITIONS                          }
+{***********************************************************************}
+
+{$I ctypes.inc}
+{$packrecords c}
+
+type
+
+    dev_t    = cuint64;         { used for device numbers      }
+    TDev     = dev_t;
+    pDev     = ^dev_t;
+
+    gid_t    = cuint32;         { used for group IDs           }
+    TGid     = gid_t;
+    pGid     = ^gid_t;
+    TIOCtlRequest = cuLong;
+
+    ino_t    = cint32;           { used for file serial numbers }
+    TIno     = ino_t;
+    pIno     = ^ino_t;
+
+    mode_t   = cint32;         { used for file attributes     }
+    TMode    = mode_t;
+    pMode    = ^mode_t;
+
+    nlink_t  = cint32;         { used for link counts         }
+    TnLink   = nlink_t;
+    pnLink   = ^nlink_t;
+
+    off_t    = cint64;          { used for file sizes          }
+    TOff     = off_t;
+    pOff     = ^off_t;
+
+    pid_t    = cint32;          { used as process identifier   }
+    TPid     = pid_t;
+    pPid     = ^pid_t;
+
+{$ifdef CPU64}
+    size_t   = cuint64;
+{$else}
+    size_t   = cuint32;         { as definied in the C standard}
+{$endif}
+    TSize    = size_t;
+    pSize    = ^size_t;
+    pSize_t  = ^size_t;
+
+{$ifdef CPU64}
+    ssize_t  = cint64;          { used by function for returning number of bytes }
+{$else}
+    ssize_t  = cint32;          { used by function for returning number of bytes}
+{$endif}
+
+    TsSize   = ssize_t;
+    psSize   = ^ssize_t;
+
+    uid_t    = cuint32;         { used for user ID type        }
+    TUid     = Uid_t;
+    pUid     = ^Uid_t;
+
+    wint_t    = cint32;
+    wchar_t   = cint32;
+    pwchar_t  = ^wchar_t;
+
+
+{$ifdef CPU64}
+    clock_t  = cuint32;         // 32-bit even on Athlon64
+{$else}
+    clock_t  = culong;
+{$endif}
+    TClock   = clock_t;
+    pClock   = ^clock_t;
+
+    time_t   = cint64;           { used for returning the time, clong
+                                        is 64-bit on AMD64}
+
+    // TTime    = time_t;    // Not allowed in system unit, -> unixtype
+
+    pTime    = ^time_t;
+    ptime_t =  ^time_t;
+
+    socklen_t= cuint32;
+    TSocklen = socklen_t;
+    pSocklen = ^socklen_t;
+	
+	suseconds_t = cint32;
+
+  timeval  = packed record
+    tv_sec:time_t;
+	tv_usec:suseconds_t;
+  end;
+  ptimeval = ^timeval;
+  TTimeVal = timeval;
+
+  timespec = packed record
+    tv_sec   : time_t;                  // should be time_t, bug compability
+    tv_nsec  : clong;
+  end;
+  ptimespec= ^timespec;
+  Ttimespec= timespec;
+
+   pthread_t_rec        = record end;
+   pthread_attr_t_rec   = record end;
+//   pthread_mutex_t_rec   = record end;
+   pthread_mutexattr_t_rec   = record end;
+   pthread_cond_t_rec   = record end;
+   pthread_condattr_t_rec   = record end;
+   pthread_rwlock_t_rec   = record end;
+   pthread_rwlockattr_t_rec   = record end;
+
+   pthread_t            = ^pthread_t_rec;
+   pthread_attr_t       = ^pthread_attr_t_rec;
+   pthread_mutex_t      = pointer;
+   pthread_mutexattr_t  = ^pthread_mutexattr_t_rec;
+   pthread_cond_t       = ^pthread_cond_t_rec;
+   pthread_condattr_t   = ^pthread_condattr_t_rec;
+   pthread_key_t        = cint;
+   pthread_rwlock_t     = ^pthread_rwlock_t_rec;
+   pthread_rwlockattr_t = ^pthread_rwlockattr_t_rec;
+
+   sem_t_rec		= record end;
+   sem_t                = ^sem_t_rec;
+   rlim_t		= cuint;
+   TRlim		= rlim_t;
+  {
+     Mutex types (Single UNIX Specification, Version 2, 1997).
+
+     Note that a mutex attribute with one of the following types:
+
+     PTHREAD_MUTEX_NORMAL
+     PTHREAD_MUTEX_RECURSIVE
+     MUTEX_TYPE_FAST (deprecated)
+     MUTEX_TYPE_COUNTING_FAST (deprecated)
+
+       will deviate from POSIX specified semantics.
+      }
+
+  pthread_mutextype = (
+    { Default POSIX mutex  }
+    _PTHREAD_MUTEX_ERRORCHECK := 1,
+    { Recursive mutex  }
+    _PTHREAD_MUTEX_RECURSIVE := 2,
+    { No error checking  }
+    _PTHREAD_MUTEX_NORMAL    := 3,
+    _MUTEX_TYPE_MAX
+  );
+
+type
+  fsid_t  = array[0..1] of cint32;
+
+Const
+     MNAMELEN   = 88;
+     MFSNamELen = 16;	
+     STATFS_VERSION = $20030518;
+     OMNAMLEN   = 88-2*sizeof(clong); // slightly machine specific.
+     OMFSNamLen = 16;	
+
+// fieldnames start with f_ in headers. Probably 1.0.x simplification that somehow
+// managed to escape the unix rewrite. Make an union+ deprecate after newstatfs is stable.
+
+Type TStatFS =  {?} Record
+       case boolean of
+       0 : ( // current FreeBSD
+        version     : cuint32;        { structure version number }
+        ftype       : cuint32;        { type of filesystem }
+        fflags      : cuint64;        { copy of mount exported flags }
+        bsize       : cuint64;        { filesystem fragment size }
+        iosize      : cuint64;        { optimal transfer block size }
+        blocks      : cuint64;        { total data blocks in filesystem }
+        bfree       : cuint64;        { free blocks in filesystem }
+        bavail      : cint64;         { free blocks avail to non-superuser }
+        files       : cuint64;        { total file nodes in filesystem }
+        ffree       : cint64;         { free nodes avail to non-superuser }
+        fsyncwrites  : cuint64;        { count of sync writes since mount }
+        fasyncwrites : cuint64;        { count of async writes since mount }
+        fsyncreads   : cuint64;        { count of sync reads since mount }
+        fasyncreads  : cuint64;        { count of async reads since mount }
+        spare       : array[0..9] of cuint64;  { unused spare }
+        namemax     : cuint32;        { maximum filename length }
+        owner       : tuid;           { user that mounted the filesystem }
+        fsid        : fsid_t;                            { filesystem id }
+        charspare   : array[0..80-1] of ansichar;         { spare string space }
+        fstypename  : array[0..MFSNAMELEN-1] of ansichar; { filesystem type name }
+        mnfromname  : array[0..MNAMELEN-1]   of ansichar; { mounted filesystem }
+        mountpoint  : array[0..MNAMELEN-1]   of ansichar; { directory on which mounted }
+        );
+        1:( // union for old fieldname's sake.
+        f_version     : cuint32;        { structure version number }
+        f_type        : cuint32;        { type of filesystem }
+        f_flags       : cuint64;        { copy of mount exported flags }
+        f_bsize       : cuint64;        { filesystem fragment size }
+        f_iosize      : cuint64;        { optimal transfer block size }
+        f_blocks      : cuint64;        { total data blocks in filesystem }
+        f_bfree       : cuint64;        { free blocks in filesystem }
+        f_bavail      : cint64;         { free blocks avail to non-superuser }
+        f_files       : cuint64;        { total file nodes in filesystem }
+        f_ffree       : cint64;         { free nodes avail to non-superuser }
+        f_syncwrites  : cuint64;        { count of sync writes since mount }
+        f_asyncwrites : cuint64;        { count of async writes since mount }
+        f_syncreads   : cuint64;        { count of sync reads since mount }
+        f_asyncreads  : cuint64;        { count of async reads since mount }
+        f_spare       : array[0..9] of cuint64;  { unused spare }
+        f_namemax     : cuint32;        { maximum filename length }
+        f_owner       : tuid;           { user that mounted the filesystem }
+        f_fsid        : fsid_t;                            { filesystem id }
+        f_charspare   : array[0..80-1] of ansichar;         { spare string space }
+        f_fstypename  : array[0..MFSNAMELEN-1] of ansichar; { filesystem type name }
+        f_mntfromname : array[0..MNAMELEN-1]   of ansichar; { mounted filesystem }
+        f_mntonname   : array[0..MNAMELEN-1]   of ansichar; { directory on which mounted }
+          );
+	end;
+ 
+     PStatFS=^TStatFS;
+
+
+   TStatFS4 = packed record
+    spare2,            { place holder}
+    bsize,             { fundamental block size}
+    iosize,            { optimal block size }
+    blocks,            {  total blocks}
+    bfree,             { blocks free}
+    bavail,            { block available for mortal users}
+    files,             { Total file nodes}
+    ffree          : clong ;    { file nodes free}
+    fsid           : fsid_t;
+    fowner         : tuid; {mounter uid}
+    ftype          : cint;
+    fflags         : cint; {copy of mount flags}
+    fsyncwrites,
+    fasyncwrites   : clong;
+    fstypename     : array[0..OMFSNamLen-1] of char;
+    mountpoint     : array[0..OMNAMLEN-1] of char;
+    fsyncreads,            { count of sync reads since mount }
+    fasyncreads    : clong;
+    fspares1       : cshort;
+    mnfromname     : array[0..OMNAMLEN-1] of char;
+    fspares2       : cshort;
+    fspare3        : array[0..1] of clong;
+  end;
+ 
+  PStatFS4=^TStatFs4;
+
+  mbstate_t = record
+      case byte of
+        0: (__mbstate8: array[0..127] of char);
+        1: (_mbstateL: cint64); { for alignment }
+    end;
+    pmbstate_t = ^mbstate_t;
+
+  ITimerVal= Record
+              It_Interval,
+              It_Value      : TimeVal;
+             end;
+
+const
+  _PTHREAD_MUTEX_DEFAULT     = _PTHREAD_MUTEX_ERRORCHECK;
+  _MUTEX_TYPE_FAST          = _PTHREAD_MUTEX_NORMAL;
+  _MUTEX_TYPE_COUNTING_FAST = _PTHREAD_MUTEX_RECURSIVE;
+
+  _PTHREAD_KEYS_MAX              = 256;
+  _PTHREAD_STACK_MIN             = 1024;
+
+   { System limits, POSIX value in parentheses, used for buffer and stack allocation }
+{$ifdef CPU64}
+    ARG_MAX  = 262144;   {4096}  { Maximum number of argument size     }
+{$else}
+    ARG_MAX  = 65536;   {4096}  { Maximum number of argument size     }
+{$endif}
+
+    NAME_MAX = 255;     {14}    { Maximum number of bytes in filename }
+    PATH_MAX = 1024;    {255}   { Maximum number of bytes in pathname }
+    SYS_NMLN = 32;              {BSD utsname struct limit, kernel mode}
+
+    SIG_MAXSIG      = 128;      // highest signal version
+//  wordsinsigset   = 4;               // words in sigset_t
+
+
+  { For getting/setting priority }
+   Prio_Process = 0;
+   Prio_PGrp    = 1;
+   Prio_User    = 2;
+

+ 205 - 0
rtl/symobi/signal.inc

@@ -0,0 +1,205 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Jonas Maebe,
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+
+Const   { For sending a signal }
+
+  SA_NOCLDSTOP = 8;
+  SA_ONSTACK   = $001; { take signal on signal stack }
+  SA_RESTART   = $002; { restart system call on signal return }
+  SA_RESETHAND = $004; { reset to SIG_DFL when taking signal }
+  SA_NODEFER   = $010; { don't mask the signal we're delivering }
+  SA_NOCLDWAIT = $020; { don't keep zombies around }
+  SA_SIGINFO   = $040; { signal handler with SA_SIGINFO args }
+  SA_USERTRAMP = $100; { SUNOS compat: Do not bounce off kernel's sigtramp }
+
+  SIG_BLOCK   = 1;
+  SIG_UNBLOCK = 2;
+  SIG_SETMASK = 3;
+
+{BSD Checked}
+  SIG_DFL = 0 ;
+  SIG_IGN = 1 ;
+  SIG_ERR = -1 ;
+
+  SIGHUP     = 1;
+  SIGINT     = 2;
+  SIGQUIT    = 3;
+  SIGILL     = 4;
+  SIGTRAP    = 5;
+  SIGABRT    = 6;
+  SIGIOT     = 6;
+  SIGEMT     = 7;
+  SIGFPE     = 8;
+  SIGKILL    = 9;
+  SIGBUS     = 10;
+  SIGSEGV    = 11;
+  SIGSYS     = 12;
+  SIGPIPE    = 13;
+  SIGALRM    = 14;
+  SIGTERM    = 15;
+  SIGURG     = 16;
+  SIGSTOP    = 17;
+  SIGTSTP    = 18;
+  SIGCONT    = 19;
+  SIGCHLD   = 20;
+  SIGTTIN    = 21;
+  SIGTTOU    = 22;
+  SIGIO      = 23;
+  SIGXCPU    = 24;
+  SIGXFSZ    = 25;
+  SIGVTALRM  = 26;
+  SIGPROF    = 27;
+  SIGWINCH   = 28;
+  SIGINFO    = 29;
+  SIGUSR1    = 30;
+  SIGUSR2    = 31;
+
+
+{$packrecords C}
+const
+  SI_PAD_SIZE   = ((128/sizeof(longint)) - 3);
+
+{
+ * The sequence of the fields/registers in struct sigcontext should match
+ * those in mcontext_t.
+ }
+
+type sigset_t = array[0..3] of Longint;
+
+    psigcontext = ^sigcontextrec;
+    PSigContextRec = ^SigContextRec;
+    SigContextRec = record
+       sc_mask      : sigset_t;          { signal mask to restore }
+       sc_onstack   : longint;              { sigstack state to restore }
+
+       sc_gs        : longint;              { machine state (struct trapframe): }
+       sc_fs        : longint;
+       sc_es        : longint;
+       sc_ds        : longint;
+       sc_edi       : longint;
+       sc_esi       : longint;
+       sc_ebp       : longint;
+       sc_isp       : longint;
+       sc_ebx       : longint;
+       sc_edx       : longint;
+       sc_ecx       : longint;
+       sc_eax       : longint;
+       sc_trapno    : longint;
+       sc_err       : longint;
+       sc_eip       : longint;
+       sc_cs        : longint;
+       sc_efl       : longint;
+       sc_esp       : longint;
+       sc_ss        : longint;
+        {
+         * XXX FPU state is 27 * 4 bytes h/w, 1 * 4 bytes s/w (probably not
+         * needed here), or that + 16 * 4 bytes for emulators (probably all
+         * needed here).  The "spare" bytes are mostly not spare.
+         }
+       en_cw        : cardinal;     { control word (16bits used) }
+       en_sw        : cardinal;     { status word (16bits) }
+       en_tw        : cardinal;     { tag word (16bits) }
+       en_fip       : cardinal;     { floating point instruction pointer }
+       en_fcs       : word;         { floating code segment selector }
+       en_opcode    : word;         { opcode last executed (11 bits ) }
+       en_foo       : cardinal;     { floating operand offset }
+       en_fos       : cardinal;     { floating operand segment selector }
+       fpr_acc      : array[0..79] of char;
+       fpr_ex_sw    : cardinal;
+       fpr_pad      : array[0..63] of char;
+       end;
+
+
+
+  Sigval = Record
+            Case Boolean OF
+        { Members as suggested by Annex C of POSIX 1003.1b. }
+                false : (sigval_int : Longint);
+                True  : (sigval_ptr : Pointer);
+            End;
+
+
+  PSigInfo   = ^SigInfo_t;
+  PSigInfo_t = ^SigInfo_t;
+  SigInfo_t = record
+                si_signo,                       { signal number }
+        {
+         * Cause of signal, one of the SI_ macros or signal-specific
+         * values, i.e. one of the FPE_... values for SIGFPE. This
+         * value is equivalent to the second argument to an old-style
+         * FreeBSD signal handler.
+         }
+                si_code,                        { signal code }
+                si_status       : cint;      { exit value }
+                si_pid          : pid_t;      { sending process }
+                si_addr         : Pointer;      { faulting instruction }
+                si_uid          : uid_t;     { sender's ruid }
+                end;
+  TSigInfo = SigInfo_t;
+  TSigInfo_t = TSigInfo;
+
+
+
+  SignalHandler   = Procedure(Sig : Longint);cdecl;
+  TSignalHandler   = Procedure(Sig : Longint);cdecl;
+  PSignalHandler  = ^SignalHandler;
+  SignalRestorer  = Procedure;cdecl;
+  PSignalRestorer = ^SignalRestorer;
+  sigActionHandler = procedure(Sig: Longint; sininfo:psiginfo; SigContext: PSigContext);cdecl;
+
+  TSigset=sigset_t;
+  sigset=tsigset;
+  PSigSet = ^TSigSet;
+
+  SigActionRec = packed record
+{     Handler  : record
+      case byte of
+        0: (Sh: SignalHandler);
+        1: (Sa: TSigAction);
+      end;}
+    sa_handler  : sigActionHandler;
+    Sa_Flags    : Longint;
+    Sa_Mask     : TSigSet;
+  end;
+  PSigActionRec = ^SigActionRec;
+  
+
+  pstack_t = ^stack_t;
+  stack_t = record
+    ss_sp: pChar;                       {* signal stack base *}
+    ss_size: size_t;                    {* signal stack length *}
+    ss_flags: cInt;                     {* SS_DISABLE and/or SS_ONSTACK *}
+  end;
+  TStack = stack_t;
+  PStack = pstack_t;
+
+{
+  Change action of process upon receipt of a signal.
+  Signum specifies the signal (all except SigKill and SigStop).
+  If Act is non-nil, it is used to specify the new action.
+  If OldAct is non-nil the previous action is saved there.
+}
+const
+       FPE_INTOVF      =1;     { integer overflow }
+        FPE_INTDIV      =2;     { integer divide by zero }
+        FPE_FLTDIV      =3;     { floating point divide by zero }
+        FPE_FLTOVF      =4;     { floating point overflow }
+        FPE_FLTUND      =5;     { floating point underflow }
+        FPE_FLTRES      =6;     { floating point inexact result }
+        FPE_FLTINV      =7;     { invalid floating point operation }
+        FPE_FLTSUB      =8;     { subscript out of range }
+
+
+

+ 80 - 0
rtl/symobi/suuid.inc

@@ -0,0 +1,80 @@
+{
+    $Id: sysutils.pp,v 1.59 2005/03/25 22:53:39 jonas Exp $
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Florian Klaempfl
+    member of the Free Pascal development team
+
+    Sysutils unit for linux
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{$IF DEFINED(FREEBSD) AND NOT DEFINED(FREEBSD4)} 
+{$IFDEF FPC_USE_LIBC}
+
+function cuuidgen(p:PGUID;x:cint):cint; external clib name 'uuidgen';
+
+{$ELSE}
+
+function cuuidgen(p:pguid;x:cint):cint;
+
+begin
+  result:=do_syscall(syscall_nr_uuidgen,tsysparam(p),tsysparam(x));
+end;
+{$ENDIF}
+
+Function SysCreateGUID(out GUID : TGUID) : Integer;
+
+begin
+ result:=0;
+ if cuuidgen(@guid,1)=-1 then
+    GetRandomBytes(GUID,SizeOf(Guid));  
+end;
+
+{$ELSE}
+
+Const 
+  RandomDevice  = '/dev/urandom';
+
+
+Function GetURandomBytes(Var Buf; NBytes : Integer) : Boolean;
+
+Var
+  fd,I : Integer;
+  P : PByte;
+  
+begin
+  P:=@Buf;
+  fd:=FileOpen(RandomDevice,fmOpenRead);
+  Result:=(fd>=0);
+  if Result then
+    Try
+      While (NBytes>0) do
+        begin
+        I:=FileRead(fd,P^,nbytes);
+        If I>0 then
+          begin
+          Inc(P,I);
+          Dec(NBytes,I);
+          end;
+        end;  
+    Finally
+      FileClose(Fd);
+    end;
+end;
+
+
+Function SysCreateGUID(out GUID : TGUID) : Integer;
+
+begin
+  if not GetUrandomBytes(Guid,SizeOf(GUID)) then
+    GetRandomBytes(GUID,SizeOf(Guid));  
+  Result:=0;    
+end;
+{$ENDIF}

+ 130 - 0
rtl/symobi/sysos.inc

@@ -0,0 +1,130 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2001 by Free Pascal development team
+
+    This file implements all the base types and limits required
+    for a minimal POSIX compliant subset required to port the compiler
+    to a new OS.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+var
+  initialstkptr: pointer; public name '__stkptr';
+  operatingsystem_parameter_envp: ppchar; public name 'operatingsystem_parameter_envp';
+  operatingsystem_parameter_argc: ptruint; public name 'operatingsystem_parameter_argc';
+  operatingsystem_parameter_argv: ppchar; public name 'operatingsystem_parameter_argv';
+
+const clib = 'c';
+
+type libcint=longint;
+     plibcint=^libcint;
+
+function geterrnolocation: Plibcint; cdecl;external stdclib name 'getThdErrno';
+
+function geterrno:libcint; [public, alias: 'FPC_SYS_GETERRNO'];
+
+begin
+ geterrno:=geterrnolocation^;
+end;
+
+procedure seterrno(err:libcint); [public, alias: 'FPC_SYS_SETERRNO'];
+begin
+  geterrnolocation^:=err;
+end;
+
+{ OS dependant parts  }
+
+{$I errno.inc}                          // error numbers
+{$I ostypes.inc}                        // c-types, unix base types, unix base structures
+{$I osmacro.inc}
+
+{$i oscdeclh.inc}
+{$i oscdecl.inc}
+
+// used in sysheap.inc
+function FpMalloc(size: size_t): pointer; cdecl; external clib name 'malloc';
+procedure FpFree(p: pointer); cdecl; external clib name 'free';
+
+
+{*****************************************************************************
+                            Error conversion
+*****************************************************************************}
+
+{
+  The lowlevel file functions should take care of setting the InOutRes to the
+  correct value if an error has occured, else leave it untouched
+}
+
+Function PosixToRunError  (PosixErrno : longint) : longint;
+{
+  Convert ErrNo error to the correct Inoutres value
+}
+
+begin
+  if PosixErrNo=0 then { Else it will go through all the cases }
+   exit(0);
+  case PosixErrNo of
+   ESysENFILE,
+   ESysEMFILE : Inoutres:=4;
+   ESysENOENT : Inoutres:=2;
+    ESysEBADF : Inoutres:=6;
+   ESysENOMEM,
+   ESysEFAULT : Inoutres:=217;
+   ESysEINVAL : Inoutres:=218;
+    ESysEPIPE,
+    ESysEINTR,
+      ESysEIO,
+   ESysEAGAIN,
+   ESysENOSPC : Inoutres:=101;
+ ESysENAMETOOLONG : Inoutres := 3;
+    ESysEROFS,
+   ESysEEXIST,
+   ESysENOTEMPTY,
+   ESysEACCES : Inoutres:=5;
+   ESysEISDIR : InOutRes:=5;
+  else
+    begin
+       InOutRes := Integer(PosixErrno);
+    end;
+  end;
+ PosixToRunError:=InOutRes;
+end;
+
+Function Errno2InoutRes : longint;
+
+begin
+  Errno2InoutRes:=PosixToRunError(getErrno);
+  InoutRes:=Errno2InoutRes;
+end;
+
+
+{*****************************************************************************
+                          Low Level File Routines
+*****************************************************************************}
+
+Function Do_IsDevice(Handle:Longint):boolean;
+{
+  Interface to Unix ioctl call.
+  Performs various operations on the filedescriptor Handle.
+  Ndx describes the operation to perform.
+  Data points to data needed for the Ndx function. The structure of this
+  data is function-dependent.
+}
+CONST
+  IOCtl_TCGETS=$40000000+$2C7400+ 19;
+var
+  Data : array[0..255] of byte; {Large enough for termios info}
+begin
+  Do_IsDevice:=(Fpioctl(handle,IOCTL_TCGETS,@data)<>-1);
+end;
+
+
+
+

+ 30 - 0
rtl/symobi/sysosh.inc

@@ -0,0 +1,30 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2001 by Free Pascal development team
+
+    This file implements all the base types and limits required
+    for a minimal POSIX compliant subset required to port the compiler
+    to a new OS.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+{Platform specific information}
+type
+  { fd are int in C also for 64bit targets (x86_64) }
+  THandle = Longint;
+  TThreadRec = record end;
+  TThreadID  = ^TThreadRec;
+  
+  { pthread_mutex_t }
+  PRTLCriticalSection = ^TRTLCriticalSection;
+  TRTLCriticalSection = pointer;
+
+
+

+ 335 - 0
rtl/symobi/system.pp

@@ -0,0 +1,335 @@
+{
+    This file is part of the Free Pascal run time library.
+	Copyright (c) 2011 by Sven Barth (adjustments for Symobi)
+    Copyright (c) 2000 by Marco van de Voort
+    member of the Free Pascal development team.
+
+    System unit for Symobi.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+Unit System;
+
+Interface
+
+{$define FPC_USE_LIBC}
+
+{$define FPC_USE_SIGPROCMASK}
+{$define FPC_USE_SIGALTSTACK}
+
+{$define FPC_IS_SYSTEM}
+
+{$I sysunixh.inc}
+
+CONST SIGSTKSZ = 40960;
+
+{$if defined(CPUARM)}
+
+{$define fpc_softfpu_interface}
+{$i softfpu.pp}
+{$undef fpc_softfpu_interface}
+
+{$endif defined(CPUARM)}
+
+
+Implementation
+
+{$if defined(CPUARM) or defined(CPUM68K)}
+
+{$define fpc_softfpu_implementation}
+{$i softfpu.pp}
+{$undef fpc_softfpu_implementation}
+
+{ we get these functions and types from the softfpu code }
+{$define FPC_SYSTEM_HAS_float64}
+{$define FPC_SYSTEM_HAS_float32}
+{$define FPC_SYSTEM_HAS_flag}
+{$define FPC_SYSTEM_HAS_extractFloat64Frac0}
+{$define FPC_SYSTEM_HAS_extractFloat64Frac1}
+{$define FPC_SYSTEM_HAS_extractFloat64Exp}
+{$define FPC_SYSTEM_HAS_extractFloat64Sign}
+{$define FPC_SYSTEM_HAS_ExtractFloat32Frac}
+{$define FPC_SYSTEM_HAS_extractFloat32Exp}
+{$define FPC_SYSTEM_HAS_extractFloat32Sign}
+
+{$endif defined(CPUARM) or defined(CPUM68K)}
+
+
+{$I system.inc}
+
+{*****************************************************************************
+                       Misc. System Dependent Functions
+*****************************************************************************}
+
+{ this is located in lib.base.ansic.dyn.dll }
+procedure normalexit(status: cint); cdecl; external name 'exit';
+
+procedure System_exit;
+begin
+   Fpexit(cint(ExitCode));
+   normalexit(cint(ExitCode));
+end;
+
+
+Function ParamCount: Longint;
+Begin
+  Paramcount:=argc-1
+End;
+
+
+function BackPos(c:char; const s: shortstring): integer;
+var
+ i: integer;
+Begin
+  for i:=length(s) downto 0 do
+    if s[i] = c then break;
+  if i=0 then
+    BackPos := 0
+  else
+    BackPos := i;
+end;
+
+
+ { variable where full path and filename and executable is stored }
+ { is setup by the startup of the system unit.                    }
+//var
+// execpathstr : shortstring;
+
+function paramstr(l: longint) : string;
+ begin
+   { stricly conforming POSIX applications  }
+   { have the executing filename as argv[0] }
+//   if l=0 then
+//     begin
+//       paramstr := execpathstr;
+//     end
+//   else
+     if (l < argc) then
+       paramstr:=strpas(argv[l])
+     else
+       paramstr:='';
+ end;
+
+Procedure Randomize;
+Begin
+  randseed:=longint(Fptime(nil));
+End;
+
+
+{*****************************************************************************
+                         System Unit Initialization
+*****************************************************************************}
+
+function  reenable_signal(sig : longint) : boolean;
+var
+  e,oe : TSigSet;
+  i,j : byte;
+  olderrno: cint;
+begin
+  fillchar(e,sizeof(e),#0);
+  fillchar(oe,sizeof(oe),#0);
+  { set is 1 based PM }
+  dec(sig);
+  i:=sig mod 32;
+  j:=sig div 32;
+  e[j]:=1 shl i;
+  { this routine is called from a signal handler, so must not change errno }
+  olderrno:=geterrno;
+  fpsigprocmask(SIG_UNBLOCK,@e,@oe);
+  reenable_signal:=geterrno=0;
+  seterrno(olderrno);
+end;
+
+{$i sighnd.inc}
+
+procedure InstallDefaultSignalHandler(signum: longint; out oldact: SigActionRec); public name '_FPC_INSTALLDEFAULTSIGHANDLER';
+var
+  act: SigActionRec;
+begin
+  { Initialize the sigaction structure }
+  { all flags and information set to zero }
+  FillChar(act,sizeof(SigActionRec),0);
+  { initialize handler                    }
+  act.sa_handler:=@SignalToRunError;
+{$if defined(darwin) and defined(cpu64)}
+  act.sa_flags:=SA_SIGINFO or SA_64REGSET;
+{$else}
+  act.sa_flags:=SA_SIGINFO;
+{$endif}
+  FpSigAction(signum,@act,@oldact);
+end;
+
+var
+  oldsigfpe: SigActionRec; public name '_FPC_OLDSIGFPE';
+  oldsigsegv: SigActionRec; public name '_FPC_OLDSIGSEGV';
+  oldsigbus: SigActionRec; public name '_FPC_OLDSIGBUS';
+  oldsigill: SigActionRec; public name '_FPC_OLDSIGILL';
+
+Procedure InstallSignals;
+begin
+  InstallDefaultSignalHandler(SIGFPE,oldsigfpe);
+  InstallDefaultSignalHandler(SIGSEGV,oldsigsegv);
+  InstallDefaultSignalHandler(SIGBUS,oldsigbus);
+  InstallDefaultSignalHandler(SIGILL,oldsigill);
+end;
+
+Procedure RestoreOldSignalHandlers;
+begin
+  FpSigAction(SIGFPE,@oldsigfpe,nil);
+  FpSigAction(SIGSEGV,@oldsigsegv,nil);
+  FpSigAction(SIGBUS,@oldsigbus,nil);
+  FpSigAction(SIGILL,@oldsigill,nil);
+end;
+
+
+procedure SetupCmdLine;
+var
+  bufsize,
+  len,j,
+  size,i : longint;
+  found  : boolean;
+  buf    : pchar;
+
+  procedure AddBuf;
+  begin
+    reallocmem(cmdline,size+bufsize);
+    move(buf^,cmdline[size],bufsize);
+    inc(size,bufsize);
+    bufsize:=0;
+  end;
+
+begin
+  GetMem(buf,ARG_MAX);
+  size:=0;
+  bufsize:=0;
+  i:=0;
+  while (i<argc) do
+   begin
+     len:=strlen(argv[i]);
+     if len>ARG_MAX-2 then
+      len:=ARG_MAX-2;
+     found:=false;
+     for j:=1 to len do
+      if argv[i][j]=' ' then
+       begin
+         found:=true;
+         break;
+       end;
+     if bufsize+len>=ARG_MAX-2 then
+      AddBuf;
+     if found then
+      begin
+        buf[bufsize]:='"';
+        inc(bufsize);
+      end;
+     move(argv[i]^,buf[bufsize],len);
+     inc(bufsize,len);
+     if found then
+      begin
+        buf[bufsize]:='"';
+        inc(bufsize);
+      end;
+     if i<argc then
+      buf[bufsize]:=' '
+     else
+      buf[bufsize]:=#0;
+     inc(bufsize);
+     inc(i);
+   end;
+  AddBuf;
+  FreeMem(buf,ARG_MAX);
+end;
+
+procedure SysInitStdIO;
+begin
+  OpenStdIO(Input,fmInput,StdInputHandle);
+  OpenStdIO(Output,fmOutput,StdOutputHandle);
+  OpenStdIO(ErrOutput,fmOutput,StdErrorHandle);
+  OpenStdIO(StdOut,fmOutput,StdOutputHandle);
+  OpenStdIO(StdErr,fmOutput,StdErrorHandle);
+end;
+
+
+{ in Symobi the startup for a POSIX application is located inside a DLL named "lib.base.ansic.dyn.dll";
+  we load this startup which in turn will call the callback function defined below which then finally
+  calls PascalMain }
+
+type
+  TSymobiCallback = function(argcparam: LongInt; argvparam: PPChar; envpparam: PPChar): LongInt; cdecl;
+
+procedure SymobiMain(callback: TSymobiCallback); cdecl; external 'lib.base.ansic.dyn.dll' name 'mainCRTStartup';
+procedure pascalmain;external name 'PASCALMAIN';
+
+function SymobiCallback(argcparam: Longint; argvparam: PPChar; envpparam: PPChar):longint; cdecl;
+begin
+  argc := argcparam;
+  argv := argvparam;
+  envp := envpparam;
+{$ifdef cpui386}
+  Set8087CW(Default8087CW);  
+{$endif cpui386}
+  pascalmain;  {run the pascal main program}
+  //system_exit;
+  Result := ExitCode;
+end;
+
+{ FPC_SYSTEMMAIN has an automatic alias named 'main', but not '_main' }
+procedure FPC_SYSTEMMAIN; cdecl; [public];
+begin
+  { call the wrapper for Symobi }
+  SymobiMain(@SymobiCallback);
+end;
+
+function GetProcessID: SizeUInt;
+begin
+ GetProcessID := SizeUInt (fpGetPID);
+end;
+
+function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
+begin
+  result := stklen;
+end;
+
+Begin
+  IsConsole := TRUE;
+//  StackLength := CheckInitialStkLen(InitialStkLen);
+//  StackBottom := Sptr - StackLength;
+  { Set up signals handlers (may be needed by init code to test cpu features) }
+  InstallSignals;
+ 
+  SysResetFPU;
+  if not(IsLibrary) then
+    SysInitFPU;
+
+{$if defined(cpui386) or defined(cpuarm)}
+  fpc_cpucodeinit;
+{$endif cpui386}
+  { Setup heap }
+  InitHeap;
+  SysInitExceptions;
+  { Setup stdin, stdout and stderr }
+  SysInitStdIO;
+  { Reset IO Error }
+  InOutRes:=0;
+  { Arguments }
+  // This does not work and I don't know why (yet)
+//  SetupCmdLine;
+  { threading }
+  InitSystemThreads;
+  initvariantmanager;
+{$ifdef VER2_2}
+  initwidestringmanager;
+{$else VER2_2}
+  initunicodestringmanager;
+{$endif VER2_2}
+  { restore original signal handlers in case this is a library }
+  if IsLibrary then
+    RestoreOldSignalHandlers;
+End.

+ 41 - 0
rtl/symobi/termio.pp

@@ -0,0 +1,41 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Peter Vreman
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This file contains the termios interface.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+unit termio;
+
+interface
+{$inline on}
+Uses BaseUnix;          // load base unix typing
+
+// load types + consts
+
+{$i termios.inc}
+
+// load default prototypes from unix dir.
+
+{$i termiosh.inc}
+
+implementation
+
+{$i textrec.inc}
+
+// load implementation for prototypes from current dir.
+{$i termiosproc.inc}
+
+// load ttyname from unix dir.
+{$i ttyname.inc}
+
+end.

+ 371 - 0
rtl/symobi/termios.inc

@@ -0,0 +1,371 @@
+{
+   This file is part of the Free Pascal run time library.
+   (c) 2000-2003 by Marco van de Voort
+   member of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   Termios header for FreeBSD
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+}
+
+CONST
+
+{
+ * Special Control Characters
+ *
+ * Index into c_cc[] character array.
+ *
+ *      Name         Subscript  Enabled by
+ }
+ VEOF           =0;
+ VEOL           =1;
+ VEOL2          =2;
+ VERASE         =3;
+ VWERASE        =4;
+ VKILL          =5;
+ VREPRINT       =6;
+{               =7;        spare 1 }
+ VINTR          =8;
+ VQUIT          =9;
+ VSUSP          =10;
+ VDSUSP         =11;
+ VSTART         =12;
+ VSTOP          =13;
+ VLNEXT         =14;
+ VDISCARD       =15;
+ VMIN           =16;
+ VTIME          =17;
+ VSTATUS        =18;
+{               =19        spare 2 }
+ NCCS           =20;
+
+Type
+  winsize = packed record
+    ws_row,
+    ws_col,
+    ws_xpixel,
+    ws_ypixel : word;
+  end;
+  TWinSize=winsize;
+
+
+type
+  Termios = packed record
+    c_iflag,
+    c_oflag,
+    c_cflag,
+    c_lflag  : cuint;
+//    c_line   : char;
+    c_cc     : array[0..NCCS-1] of byte;
+    c_ispeed,
+    c_ospeed : cuint;
+  end;
+  TTermios=Termios;
+
+CONST
+
+
+ POSIX_VDISABLE=Chr($ff);
+{
+
+#define CCEQ(val, c)    ((c) == (val) ? (val) != _POSIX_VDISABLE : 0)
+}
+
+{ * Input flags - software input processing}
+
+        IGNBRK          =       $1;     { ignore BREAK condition }
+        BRKINT          =       $2;     { map BREAK to SIGINTR }
+        IGNPAR          =       $4;     { ignore (discard) parity errors }
+        PARMRK          =       $8;     { mark parity and framing errors }
+        INPCK           =      $10;     { enable checking of parity errors }
+        ISTRIP          =      $20;     { strip 8th bit off chars }
+        INLCR           =      $40;     { map NL into CR }
+        IGNCR           =      $80;     { ignore CR }
+        ICRNL           =     $100;     { map CR to NL (ala CRMOD) }
+        IXON            =     $200;     { enable output flow control }
+        IXOFF           =     $400;     { enable input flow control }
+        IXANY           =     $800;     { any char will restart after stop }
+        IMAXBEL         =    $2000;     { ring bell on input queue full }
+
+{
+ * Output flags - software output processing
+}
+        OPOST           =       $1;     { enable following output processing }
+        ONLCR           =       $2;     { map NL to CR-NL (ala CRMOD) }
+        OXTABS          =       $4;     { expand tabs to spaces }
+        ONOEOT          =       $8;     { discard EOT's (^D) on output) }
+
+{
+ * Control flags - hardware control of terminal
+}
+        CIGNORE         =       $1;     { ignore control flags }
+        CSIZE           =     $300;     { character size mask }
+        CS5             =       $0;         { 5 bits (pseudo) }
+        CS6             =     $100;         { 6 bits }
+        CS7             =     $200;         { 7 bits }
+        CS8             =     $300;         { 8 bits }
+        CSTOPB          =     $400;     { send 2 stop bits }
+        CREAD           =     $800;     { enable receiver }
+        PARENB          =    $1000;     { parity enable }
+        PARODD          =    $2000;     { odd parity, else even }
+        HUPCL           =    $4000;     { hang up on last close }
+        CLOCAL          =    $8000;     { ignore modem status lines }
+        CCTS_OFLOW      =   $10000;     { CTS flow control of output }
+        CRTS_IFLOW      =   $20000;     { RTS flow control of input }
+        CRTSCTS         =   (CCTS_OFLOW or CRTS_IFLOW);
+        CDTR_IFLOW      =   $40000;     { DTR flow control of input }
+        CDSR_OFLOW      =   $80000;     { DSR flow control of output }
+        CCAR_OFLOW      =  $100000;     { DCD flow control of output }
+        MDMBUF          =  $100000;     { old name for CCAR_OFLOW }
+
+{
+ * "Local" flags - dumping ground for other state
+ *
+ * Warning: some flags in this structure begin with
+ * the letter "I" and look like they belong in the
+ * input flag.
+ }
+
+        ECHOKE          =       $1;     { visual erase for line kill }
+        ECHOE           =       $2;     { visually erase chars }
+        ECHOK           =       $4;     { echo NL after line kill }
+        ECHO            =       $8;     { enable echoing }
+        ECHONL          =      $10;     { echo NL even if ECHO is off }
+        ECHOPRT         =      $20;     { visual erase mode for hardcopy }
+        ECHOCTL         =      $40;     { echo control chars as ^(Char) }
+        ISIG            =      $80;     { enable signals INTR, QUIT, [D]SUSP }
+        ICANON          =     $100;     { canonicalize input lines }
+        ALTWERASE       =     $200;     { use alternate WERASE algorithm }
+        IEXTEN          =     $400;     { enable DISCARD and LNEXT }
+        EXTPROC         =     $800;      { external processing }
+        TOSTOP          =  $400000;     { stop background jobs from output }
+        FLUSHO          =  $800000;     { output being flushed (state) }
+        NOKERNINFO      = $2000000;     { no kernel output from VSTATUS }
+        PENDIN          =$20000000;     { XXX retype pending input (state) }
+        NOFLSH          =$80000000;     { don't flush after interrupt }
+
+
+
+{
+ * Commands passed to tcsetattr() for setting the termios structure.
+}
+
+CONST
+
+        TCSANOW         =0;             { make change immediate }
+        TCSADRAIN       =1;             { drain output, then change }
+        TCSAFLUSH       =2;             { drain output, flush input }
+        TCSASOFT        =$10;           { flag - don't alter h.w. state }
+
+{
+ * Standard speeds
+}
+        B0      =     0;
+        B50     =    50;
+        B75     =    75;
+        B110    =   110;
+        B134    =   134;
+        B150    =   150;
+        B200    =   200;
+        B300    =   300;
+        B600    =   600;
+        B1200   =  1200;
+        B1800   =  1800;
+        B2400   =  2400;
+        B4800   =  4800;
+        B9600   =  9600;
+        B19200  = 19200;
+        B38400  = 38400;
+        B7200   =  7200;
+        B14400  = 14400;
+        B28800  = 28800;
+        B57600  = 57600;
+        B76800  = 76800;
+        B115200 =115200;
+        B230400 =230400;
+        EXTA    = 19200;
+        EXTB    = 38400;
+
+        TCIFLUSH        =1;
+        TCOFLUSH        =2;
+        TCIOFLUSH       =3;
+        TCOOFF          =1;
+        TCOON           =2;
+        TCIOFF          =3;
+        TCION           =4;
+
+{
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+speed_t cfgetispeed __P((const struct termios *));
+speed_t cfgetospeed __P((const struct termios *));
+int     cfsetispeed __P((struct termios *, speed_t));
+int     cfsetospeed __P((struct termios *, speed_t));
+int     tcgetattr __P((int, struct termios *));
+int     tcsetattr __P((int, int, const struct termios *));
+int     tcdrain __P((int));
+int     tcflow __P((int, int));
+int     tcflush __P((int, int));
+int     tcsendbreak __P((int, int));
+
+#ifndef _POSIX_SOURCE
+void    cfmakeraw __P((struct termios *));
+int     cfsetspeed __P((struct termios *, speed_t));
+#endif { !_POSIX_SOURCE }
+__END_DECLS
+
+#endif { !_KERNEL }
+
+
+
+struct winsize {
+        unsigned short  ws_row;         { rows, in characters }
+        unsigned short  ws_col;         { columns, in characters }
+        unsigned short  ws_xpixel;      { horizontal size, pixels }
+        unsigned short  ws_ypixel;      { vertical size, pixels }
+};
+
+}
+       IOCTLREAD        = $40000000;
+       IOCTLWRITE       = $80000000;
+       IOCTLVOID        = $20000000;
+
+        TIOCMODG        = IOCTLREAD+$47400+ 3;  { get modem control state }
+        TIOCMODS        = IOCTLWRITE+$47400+ 4; { set modem control state }
+                TIOCM_LE        =$0001;         { line enable }
+                TIOCM_DTR       =$0002;         { data terminal ready }
+                TIOCM_RTS       =$0004;         { request to send }
+                TIOCM_ST        =$0010;         { secondary transmit }
+                TIOCM_SR        =$0020;         { secondary receive }
+                TIOCM_CTS       =$0040;         { clear to send }
+                TIOCM_CAR       =$0100;         { carrier detect }
+                TIOCM_CD        =TIOCM_CAR;
+                TIOCM_RNG       =$0200;         { ring }
+                TIOCM_RI        =TIOCM_RNG;
+                TIOCM_DSR       =$0400;         { data set ready }
+                                                { 8-10 compat }
+        TIOCEXCL         =IOCTLVOID+$7400+ 13;          { set exclusive use of tty }
+        TIOCNXCL         =IOCTLVOID+$7400+ 14;          { reset exclusive use of tty }
+                                                { 15 unused }
+        TIOCFLUSH        =IOCTLWRITE+$47400+ 16;        { flush buffers }
+                                                { 17-18 compat }
+        TIOCGETA         =IOCTLREAD+$2C7400+ 19; { get termios struct }
+        TIOCSETA         =IOCTLWRITE+$2C7400+ 20; { set termios struct }
+        TIOCSETAW        =IOCTLWRITE+$2C7400+ 21; { drain output, set }
+        TIOCSETAF        =IOCTLWRITE+$2C7400+ 22; { drn out, fls in, set }
+        TIOCGETD         =IOCTLREAD+$47400+ 26; { get line discipline }
+        TIOCSETD         =IOCTLWRITE+$47400+ 27;        { set line discipline }
+                                                { 127-124 compat }
+        TIOCSBRK         =IOCTLVOID+$7400+ 123;         { set break bit }
+        TIOCCBRK         =IOCTLVOID+$7400+ 122;         { clear break bit }
+        TIOCSDTR         =IOCTLVOID+$7400+ 121;         { set data terminal ready }
+        TIOCCDTR         =IOCTLVOID+$7400+ 120;         { clear data terminal ready }
+        TIOCGPGRP        =IOCTLREAD+$47400+ 119;        { get pgrp of tty }
+        TIOCSPGRP        =IOCTLWRITE+$47400+ 118;       { set pgrp of tty }
+                                                { 117-116 compat }
+        TIOCOUTQ         =IOCTLREAD+$47400+ 115;        { output queue size }
+        TIOCSTI          =IOCTLWRITE+$17400+ 114;       { simulate terminal input }
+        TIOCNOTTY        =IOCTLVOID+$7400+ 113;         { void tty association }
+        TIOCPKT          =IOCTLWRITE+$47400+ 112;       { pty: set/clear packet mode }
+                TIOCPKT_DATA            =$00;   { data packet }
+                TIOCPKT_FLUSHREAD       =$01;   { flush packet }
+                TIOCPKT_FLUSHWRITE      =$02;   { flush packet }
+                TIOCPKT_STOP            =$04;   { stop output }
+                TIOCPKT_START           =$08;   { start output }
+                TIOCPKT_NOSTOP          =$10;   { no more ^S, ^Q }
+                TIOCPKT_DOSTOP          =$20;   { now do ^S ^Q }
+                TIOCPKT_IOCTL           =$40;   { state change of pty driver }
+        TIOCSTOP         =IOCTLVOID+$7400+ 111;         { stop output, like ^S }
+        TIOCSTART        =IOCTLVOID+$7400+ 110;         { start output, like ^Q }
+        TIOCMSET         =IOCTLWRITE+$47400+ 109;       { set all modem bits }
+        TIOCMBIS         =IOCTLWRITE+$47400+ 108;       { bis modem bits }
+        TIOCMBIC         =IOCTLWRITE+$47400+ 107;       { bic modem bits }
+        TIOCMGET         =IOCTLREAD+$47400+ 106;        { get all modem bits }
+        TIOCREMOTE       =IOCTLWRITE+$47400+ 105;       { remote input editing }
+        TIOCGWINSZ       =IOCTLREAD+$87400+ 104;        { get window size }
+        TIOCSWINSZ       =IOCTLWRITE+$87400+ 103;       { set window size }
+        TIOCUCNTL        =IOCTLWRITE+$47400+ 102;       { pty: set/clr usr cntl mode }
+        TIOCSTAT         =IOCTLVOID+$7400+ 101;         { simulate ^T status message }
+  //                       UIOCCMD(n)   _IO('u', n)     { usr cntl op "n" }
+        TIOCCONS         =IOCTLWRITE+$47400+ 98;        { become virtual console }
+        TIOCSCTTY        =IOCTLVOID+$7400+ 97;          { become controlling tty }
+        TIOCEXT          =IOCTLWRITE+$47400+ 96;        { pty: external processing }
+        TIOCSIG          =IOCTLVOID+$7400+ 95;          { pty: generate signal }
+        TIOCDRAIN        =IOCTLVOID+$7400+ 94;          { wait till output drained }
+        TIOCMSDTRWAIT    =IOCTLWRITE+$47400+ 91;        { modem: set wait on close }
+        TIOCMGDTRWAIT    =IOCTLREAD+$47400+ 90; { modem: get wait on close }
+        TIOCTIMESTAMP    =IOCTLREAD+$87400+ 89;         { enable/get timestamp
+                                                 * of last input event }
+        TIOCDCDTIMESTAMP =IOCTLREAD+$87400+ 88; { enable/get timestamp
+                                                 * of last DCd rise }
+        TIOCSDRAINWAIT   =IOCTLWRITE+$47400+ 87;        { set ttywait timeout }
+        TIOCGDRAINWAIT   =IOCTLREAD+$47400+ 86; { get ttywait timeout }
+
+        TTYDISC          = 0;            { termios tty line discipline }
+        SLIPDISC         = 4;            { serial IP discipline }
+        PPPDISC          = 5;            { PPP discipline }
+        NETGRAPHDISC     = 6;            { Netgraph tty node discipline }
+
+	FIOCLEX          = IOCTLVOID +$6600+ 1;        { set close on exec on fd }
+ 	FIONCLEX         = IOCTLVOID +$6600+ 2;        { remove close on exec }
+ 	FIONREAD         = IOCTLREAD +$46600+127;     { get # bytes to read }
+ 	FIONBIO          = IOCTLWRITE+$46600+126;     { set/clear non-blocking i/o }
+ 	FIOASYNC         = IOCTLWRITE+$46600+125;     { set/clear async i/o }
+ 	FIOSETOWN        = IOCTLWRITE+$46600+124;     { set owner }
+ 	FIOGETOWN        = IOCTLREAD +$46600+123;     { get owner }  
+ 	FIODTYPE         = IOCTLREAD +$46600+122;     { get d_flags type part }         
+ 	FIOGETLBA        = IOCTLREAD +$46600+121;     { get start blk # }                 
+
+{
+ * Defaults on "first" open.
+ }
+        TTYDEF_IFLAG     =(BRKINT       or ICRNL        or IMAXBEL or IXON or IXANY);
+       TTYDEF_OFLAG      =(OPOST or ONLCR);
+       TTYDEF_LFLAG      =(ECHO or ICANON or ISIG or IEXTEN or ECHOE or ECHOKE or ECHOCTL);
+        TTYDEF_CFLAG     =(CREAD or CS8 or HUPCL);
+       TTYDEF_SPEED      =(B9600);
+
+
+
+{
+ * Control Character Defaults
+ }
+        CtrlMask        = $1f;  {\037}
+        CEOF            =chr( ORD('d') and CtrlMask);
+        CEOL            =chr( $ff and CtrlMask);{ XXX avoid _POSIX_VDISABLE }
+        CERASE          =chr( $7F and CtrlMask);
+        CINTR           =chr(ORD('c') and CtrlMask);
+        CSTATUS         =chr(ORD('t') and CtrlMask);
+        CKILL           =chr(ORD('u') and CtrlMask);
+        CMIN            =chr(1);
+        CQUIT           =chr(034  and CtrlMask);        { FS, ^\ }
+        CSUSP           =chr(ORD('z') and CtrlMask);
+        CTIME           =chr(0);
+        CDSUSP          =chr(ORD('y') and CtrlMask);
+        CSTART          =chr(ORD('q') and CtrlMask);
+        CSTOP           =chr(ORD('s') and CtrlMask);
+        CLNEXT          =chr(ORD('v') and CtrlMask);
+        CDISCARD        =chr(ORD('o') and CtrlMask);
+        CWERASE         =chr(ORD('w') and CtrlMask);
+        CREPRINT        =chr(ORD('r') and CtrlMask);
+        CEOT            =CEOF;
+{ compat }
+        CBRK            =CEOL;
+        CRPRNT          =CREPRINT;
+        CFLUSH          =CDISCARD;
+
+
+{
+ *        TTYDEFCHARS to include an array of default control characters.
+}
+    ttydefchars : array[0..NCCS-1] OF char =(
+        CEOF,   CEOL,   CEOL,   CERASE, CWERASE, CKILL, CREPRINT,
+        POSIX_VDISABLE, CINTR,  CQUIT,  CSUSP,  CDSUSP, CSTART, CSTOP,  CLNEXT,
+        CDISCARD, CMIN, CTIME,  CSTATUS, POSIX_VDISABLE);
+

+ 138 - 0
rtl/symobi/termiosproc.inc

@@ -0,0 +1,138 @@
+{
+   This file is part of the Free Pascal run time library.
+   (c) 2000-2003 by Marco van de Voort
+   member of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   Termios implementation for FreeBSD
+
+   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.
+}
+
+
+{******************************************************************************
+                         IOCtl and Termios calls
+******************************************************************************}
+
+Function TCGetAttr(fd:cint;var tios:TermIOS):cint; {$ifdef VER2_0}inline;{$endif}
+begin
+  TCGETAttr:=fpIoCtl(Fd,TIOCGETA,@tios);
+end;
+
+
+Function TCSetAttr(fd:cint;OptAct:cint;const tios:TermIOS):cint;
+var
+  nr:cint;
+begin
+  case OptAct of
+  {the three constants TIOCSETA, TIOCSETAW and TIOCSETAF are
+   unsigned values above $80000000, so that they give range check errors
+   on 32-bit systems }
+   TCSANOW   : nr:=cint(TIOCSETA);
+   TCSADRAIN : nr:=cint(TIOCSETAW);
+   TCSAFLUSH : nr:=cint(TIOCSETAF);
+  else
+   begin
+     fpsetErrNo(ESysEINVAL);
+     TCSetAttr:=-1;
+     exit;
+   end;
+  end;
+  TCSetAttr:=fpIOCtl(fd,nr,@Tios);
+end;
+
+
+Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
+begin
+  tios.c_ispeed:=speed; {Probably the Bxxxx speed constants}
+end;
+
+
+Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal); {$ifdef VER2_0}inline;{$endif}
+begin
+   tios.c_ospeed:=speed;
+end;
+
+
+
+Procedure CFMakeRaw(var tios:TermIOS);
+begin
+  with tios do
+   begin
+     c_iflag:=c_iflag and (not (IMAXBEL or IXOFF or INPCK or BRKINT or
+                PARMRK or ISTRIP or INLCR or IGNCR or ICRNL or IXON or
+                IGNPAR));
+     c_iflag:=c_iflag OR IGNBRK;
+     c_oflag:=c_oflag and (not OPOST);
+     c_lflag:=c_lflag and (not (ECHO or ECHOE or ECHOK or ECHONL or ICANON or
+                                ISIG or IEXTEN or NOFLSH or TOSTOP or PENDIN));
+     c_cflag:=(c_cflag and (not (CSIZE or PARENB))) or (CS8 OR cread);
+     c_cc[VMIN]:=1;
+     c_cc[VTIME]:=0;
+   end;
+end;
+
+Function TCSendBreak(fd,duration:cint):cint; {$ifdef VER2_0}inline;{$endif}
+begin
+  TCSendBreak:=fpIOCtl(fd,TIOCSBRK,nil);
+end;
+
+
+Function TCSetPGrp(fd,id:cint):cint; {$ifdef VER2_0}inline;{$endif}
+begin
+  TCSetPGrp:=fpIOCtl(fd,TIOCSPGRP,pointer(id));
+end;
+
+
+Function TCGetPGrp(fd:cint;var id:cint):cint; {$ifdef VER2_0}inline;{$endif}
+begin
+  TCGetPGrp:=fpIOCtl(fd,TIOCGPGRP,@id);
+end;
+
+Function TCDrain(fd:cint):cint; {$ifdef VER2_0}inline;{$endif}
+begin
+  TCDrain:=fpIOCtl(fd,TIOCDRAIN,nil); {Should set timeout to 1 first?}
+end;
+
+
+Function TCFlow(fd,act:cint):cint; {$ifdef VER2_0}inline;{$endif}
+begin
+    case act OF
+     TCOOFF :  TCFlow:=fpIoctl(fd,TIOCSTOP,nil);
+     TCOOn  :  TCFlow:=fpIOctl(Fd,TIOCStart,nil);
+     TCIOFF :  {N/I}
+    end;
+end;
+
+Function TCFlush(fd,qsel:cint):cint; {$ifdef VER2_0}inline;{$endif}
+begin
+  TCFlush:=fpIOCtl(fd,TIOCFLUSH,pointer(qsel));
+end;
+
+Function IsATTY (Handle:cint):cint;
+{
+  Check if the filehandle described by 'handle' is a TTY (Terminal)
+}
+var
+  t : Termios;
+begin
+  if Handle in [0, 1, 2] then
+    IsATTY:=1
+  else
+    IsATTY:=0;
+ //IsAtty:=ord(TCGetAttr(Handle,t) <> -1);
+end;
+
+
+Function IsATTY(var f: text):cint; {$ifdef VER2_0}inline;{$endif}
+{
+  Idem as previous, only now for text variables.
+}
+begin
+  IsATTY:=IsaTTY(textrec(f).handle);
+end;
+

+ 112 - 0
rtl/symobi/unxconst.inc

@@ -0,0 +1,112 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Michael Van Canneyt,
+    member of the Free Pascal development team.
+
+    Constants for Unix unit.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+
+
+const
+
+  { Things for LSEEK call}
+  Seek_set = 0;
+  Seek_Cur = 1;
+  Seek_End = 2;
+
+  { Things for OPEN call - after include/sys/fcntl.h,
+   BSD specifies these constants in hex }
+  Open_Accmode  = 3;
+  Open_RdOnly   = 0;
+  Open_WrOnly   = 1;
+  Open_RdWr     = 2;
+  Open_NonBlock = 4;
+  Open_Append   = 8;
+  Open_ShLock   = $10;
+  Open_ExLock   = $20;
+  Open_ASync    = $40;
+  Open_FSync    = $80;
+  Open_NoFollow = $100;
+  Open_Create   = $200;       {BSD convention}
+  Open_Creat    = $200;       {Linux convention}
+  Open_Trunc    = $400;
+  Open_Excl     = $800;
+  Open_NoCTTY   = $8000;
+
+  { The waitpid uses the following options:}
+  Wait_NoHang   = 1;
+  Wait_UnTraced = 2;
+  Wait_Any      = -1;
+  Wait_MyPGRP   = 0;
+
+
+  { Constants to check stat.mode -  checked all STAT constants with BSD}
+  STAT_IFMT   = $f000; {00170000 }
+  STAT_IFSOCK = $c000; {0140000 }
+  STAT_IFLNK  = $a000; {0120000 }
+  STAT_IFREG  = $8000; {0100000 }
+  STAT_IFBLK  = $6000; {0060000 }
+  STAT_IFDIR  = $4000; {0040000 }
+  STAT_IFCHR  = $2000; {0020000 }
+  STAT_IFIFO  = $1000; {0010000 }
+  STAT_ISUID  = $0800; {0004000 }
+  STAT_ISGID  = $0400; {0002000 }
+  STAT_ISVTX  = $0200; {0001000}
+  { Constants to check permissions all }
+  STAT_IRWXO = $7;
+  STAT_IROTH = $4;
+  STAT_IWOTH = $2;
+  STAT_IXOTH = $1;
+
+  STAT_IRWXG = STAT_IRWXO shl 3;
+  STAT_IRGRP = STAT_IROTH shl 3;
+  STAT_IWGRP = STAT_IWOTH shl 3;
+  STAT_IXGRP = STAT_IXOTH shl 3;
+
+  STAT_IRWXU = STAT_IRWXO shl 6;
+  STAT_IRUSR = STAT_IROTH shl 6;
+  STAT_IWUSR = STAT_IWOTH shl 6;
+  STAT_IXUSR = STAT_IXOTH shl 6;
+
+  { Constants to test the type of filesystem }
+  fs_old_ext2 = $ef51;
+  fs_ext2     = $ef53;
+  fs_ext      = $137d;
+  fs_iso      = $9660;
+  fs_minix    = $137f;
+  fs_minix_30 = $138f;
+  fs_minux_V2 = $2468;
+  fs_msdos    = $4d44;
+  fs_nfs      = $6969;
+  fs_proc     = $9fa0;
+  fs_xia      = $012FD16D;
+
+  {Constansts Termios/Ioctl (used in Do_IsDevice) }
+  IOCtl_TCGETS= $40000000+$2C7400+ 19; // TCGETS is also in termios.inc, but the sysunix needs only this
+
+  ITimer_Real    =0;
+  ITimer_Virtual =1;
+  ITimer_Prof    =2;
+
+{
+  {Checked for BSD using Linuxthreads port}
+  { cloning flags }
+  CSIGNAL       = $000000ff; // signal mask to be sent at exit
+  CLONE_VM      = $00000100; // set if VM shared between processes
+  CLONE_FS      = $00000200; // set if fs info shared between processes
+  CLONE_FILES   = $00000400; // set if open files shared between processes
+  CLONE_SIGHAND = $00000800; // set if signal handlers shared
+  CLONE_PID     = $00001000; // set if pid shared
+
+type
+ TCloneFunc=function(args:pointer):longint;cdecl;
+}
+

+ 102 - 0
rtl/symobi/unxfunc.inc

@@ -0,0 +1,102 @@
+{
+   This file is part of the Free Pascal run time library.
+   Copyright (c) 2000 by Marco van de Voort
+     member of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+**********************************************************************}
+
+{$ifndef HAS_LIBC_PIPING}
+Function PClose(Var F:file) : cint;
+var
+  pl : ^cint;
+  res : cint;
+
+begin
+  fpclose(filerec(F).Handle);
+{ closed our side, Now wait for the other - this appears to be needed ?? }
+  pl:=@(filerec(f).userdata[2]);
+  fpwaitpid(pl^,@res,0);
+  pclose:=res shr 8;
+end;
+
+Function PClose(Var F:text) :cint;
+var
+  pl  : ^longint;
+  res : longint;
+
+begin
+  fpclose(Textrec(F).Handle);
+{ closed our side, Now wait for the other - this appears to be needed ?? }
+  pl:=@(textrec(f).userdata[2]);
+  fpwaitpid(pl^,@res,0);
+  pclose:=res shr 8;
+end;
+{$ENDIF}
+
+
+Function AssignPipe(var pipe_in,pipe_out:cint):cint; [public, alias : 'FPC_SYSC_ASSIGNPIPE'];
+{
+  Sets up a pair of file variables, which act as a pipe. The first one can
+  be read from, the second one can be written to.
+  If the operation was unsuccesful, errno is set.
+}
+var
+  pip  : tfildes;
+begin
+  assignPipe:=fppipe(pip);
+  pipe_in:=pip[0];
+  pipe_out:=pip[1];
+end;
+
+{ should probably be defined in ostypes.inc for all OSes }
+const
+  F_RDLCK =        01;      (* Read lock *)
+  F_WRLCK =        02;      (* Write lock *)
+  F_UNLCK =        03;      (* Remove lock(s) *)
+
+
+Function fpFlock (fd,mode : longint) : cint;
+  var
+    fl : flock;
+    cmd : cint;
+  begin
+	  { initialize the flock struct to set lock on entire file }
+    fillchar(fl,sizeof(fl),0);
+
+		{ In non-blocking lock, use F_SETLK for cmd, F_SETLKW otherwise }
+		if (mode and LOCK_NB)<>0 then
+		  begin
+			  cmd:=F_SETLK;
+			  { turn off this bit }
+			  mode:=mode and not(LOCK_NB);	
+			end
+		else
+			cmd:=F_SETLKW;
+	
+		case mode of
+		  LOCK_UN:
+			  fl.l_type:=fl.l_type or F_UNLCK;
+  		LOCK_SH:
+			  fl.l_type:=fl.l_type or F_RDLCK;
+		  LOCK_EX:
+			  fl.l_type:=fl.l_type or F_WRLCK;
+		  else
+		    begin
+			    errno:=ESysEINVAL;
+			    fpFlock:=-1;
+			    exit;
+			  end;
+		end;
+	
+		fpFlock:=fpFcntl(fd,cmd,fl);
+	
+		if (fpFlock=-1) and (errno=ESysEACCES) then
+			errno:=ESysEWOULDBLOCK;
+  end;

+ 365 - 0
rtl/symobi/unxsockh.inc

@@ -0,0 +1,365 @@
+{
+   This file is part of the Free Pascal run time library.
+   (c) 2000-2003 by Marco van de Voort
+   member of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   OS dependant part of the header.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+}
+
+Const
+{*
+ * Address families.
+ *}
+  AF_UNSPEC        = 0;		{ unspecified }
+  AF_UNIX          = 1;		{ standardized name for AF_LOCAL }
+  AF_LOCAL         = AF_UNIX;	{ local to host (pipes, portals) }
+  AF_INET          = 2;		{ internetwork: UDP, TCP, etc. }
+  AF_IMPLINK       = 3;		{ arpanet imp addresses }
+  AF_PUP           = 4;		{ pup protocols: e.g. BSP }
+  AF_CHAOS         = 5;		{ mit CHAOS protocols }
+  AF_NETBIOS       = 6;		{ SMB protocols }
+  AF_ISO           = 7;		{ ISO protocols }
+  AF_OSI           = AF_ISO;
+  AF_ECMA          = 8;		{ European computer manufacturers }
+  AF_DATAKIT       = 9;		{ datakit protocols }
+  AF_CCITT         = 10;	{ CCITT protocols, X.25 etc }
+  AF_SNA           = 11;	{ IBM SNA }
+  AF_DECnet        = 12;	{ DECnet }
+  AF_DLI           = 13;	{ DEC Direct data link interface }
+  AF_LAT           = 14;	{ LAT }
+  AF_HYLINK        = 15;	{ NSC Hyperchannel }
+  AF_APPLETALK     = 16;	{ Apple Talk }
+  AF_ROUTE         = 17;	{ Internal Routing Protocol }
+  AF_LINK          = 18;	{ Link layer interface }
+  pseudo_AF_XTP    = 19;	{ eXpress Transfer Protocol (no AF) }
+  AF_COIP          = 20;	{ connection-oriented IP, aka ST II }
+  AF_CNT           = 21;	{ Computer Network Technology }
+  pseudo_AF_RTIP   = 22;	{ Help Identify RTIP packets }
+  AF_IPX           = 23;	{ Novell Internet Protocol }
+  AF_SIP           = 24;	{ Simple Internet Protocol }
+  pseudo_AF_PIP    = 25;	{ Help Identify PIP packets }
+  AF_ISDN          = 26;	{ Integrated Services Digital Network}
+  AF_E164          = AF_ISDN;	{ CCITT E.164 recommendation }
+  pseudo_AF_KEY    = 27;	{ Internal key-management function }
+  AF_INET6         = 28;	{ IPv6 }
+  AF_NATM          = 29;	{ native ATM access }
+  AF_ATM           = 30;	{ ATM }
+  pseudo_AF_HDRCMPLT = 31;	{ Used by BPF to not rewrite headers
+					 * in interface output routine
+                                         }
+  AF_NETGRAPH      = 32;	{ Netgraph sockets }
+  AF_SLOW          = 33;	{ 802.3ad slow protocol }
+  AF_SCLUSTER      = 34;	{ Sitara cluster protocol }
+  AF_ARP           = 35;
+  AF_BLUETOOTH     = 36;	{ Bluetooth sockets }
+  AF_IEEE80211     = 37;	{ IEEE 802.11 protocol }
+  AF_MAX           = 38;
+  
+  {
+   * Protocol families, same as address families for now.
+    }
+
+  const
+     PF_UNSPEC = AF_UNSPEC;
+     PF_LOCAL = AF_LOCAL;
+  { backward compatibility  }
+     PF_UNIX = PF_LOCAL;
+     PF_INET = AF_INET;
+     PF_IMPLINK = AF_IMPLINK;
+     PF_PUP = AF_PUP;
+     PF_CHAOS = AF_CHAOS;
+     PF_NETBIOS = AF_NETBIOS;
+     PF_ISO = AF_ISO;
+     PF_OSI = AF_ISO;
+     PF_ECMA = AF_ECMA;
+     PF_DATAKIT = AF_DATAKIT;
+     PF_CCITT = AF_CCITT;
+     PF_SNA = AF_SNA;
+     PF_DECnet = AF_DECnet;
+     PF_DLI = AF_DLI;
+     PF_LAT = AF_LAT;
+     PF_HYLINK = AF_HYLINK;
+     PF_APPLETALK = AF_APPLETALK;
+     PF_ROUTE = AF_ROUTE;
+     PF_LINK = AF_LINK;
+  { really just proto family, no AF  }
+     PF_XTP = pseudo_AF_XTP;
+     PF_COIP = AF_COIP;
+     PF_CNT = AF_CNT;
+     PF_SIP = AF_SIP;
+     PF_IPX = AF_IPX;
+  { same format as AF_INET  }
+     PF_RTIP = pseudo_AF_RTIP;
+     PF_PIP = pseudo_AF_PIP;
+     PF_ISDN = AF_ISDN;
+     PF_KEY = pseudo_AF_KEY;
+     PF_INET6 = AF_INET6;
+     PF_NATM = AF_NATM;
+     PF_ATM = AF_ATM;
+     PF_NETGRAPH = AF_NETGRAPH;
+     PF_SLOW = AF_SLOW;
+     PF_SCLUSTER = AF_SCLUSTER;
+     PF_ARP = AF_ARP;
+     PF_BLUETOOTH = AF_BLUETOOTH;
+     PF_MAX = AF_MAX;
+
+
+  SOCK_PACKET     = 10;
+
+
+{ Maximum queue length specifiable by listen.  }
+  SOMAXCONN     = 128;
+
+        SOL_SOCKET 	 = $FFFF;
+        SO_DEBUG         = $0001;        { turn on debugging info recording }
+        SO_ACCEPTCONN    = $0002;        { socket has had listen() }
+        SO_REUSEADDR     = $0004;        { allow local address reuse }
+        SO_KEEPALIVE     = $0008;        { keep connections alive }
+        SO_DONTROUTE     = $0010;        { just use interface addresses }
+        SO_BROADCAST     = $0020;        { permit sending of broadcast msgs }
+        SO_USELOOPBACK   = $0040;        { bypass hardware when possible }
+        SO_LINGER        = $0080;        { linger on close if data present }
+        SO_OOBINLINE     = $0100;        { leave received OOB data in line }
+        SO_REUSEPORT     = $0200;        { allow local address & port reuse }
+        SO_TIMESTAMP     = $0400;        { timestamp received dgram traffic }
+
+{
+ * Additional options, not kept in so_options.
+ }
+        SO_SNDBUF        =$1001;        { send buffer size }
+        SO_RCVBUF        =$1002;        { receive buffer size }
+        SO_SNDLOWAT      =$1003;        { send low-water mark }
+        SO_RCVLOWAT      =$1004;        { receive low-water mark }
+        SO_SNDTIMEO      =$1005;        { send timeout }
+        SO_RCVTIMEO      =$1006;        { receive timeout }
+        SO_ERROR         =$1007;        { get error status and clear }
+        SO_TYPE          =$1008;        { get socket type }
+
+
+        SHUT_RD         =0;             { shut down the reading side }
+        SHUT_WR         =1;             { shut down the writing side }
+        SHUT_RDWR       =2;             { shut down both sides }
+
+	IPPROTO_IP              = 0;               { dummy for IP }
+	IPPROTO_ICMP            = 1;               { control message protocol }
+	IPPROTO_TCP             = 6;               { tcp }
+	IPPROTO_UDP             = 17;              { user datagram protocol }
+
+
+	IPPROTO_HOPOPTS		= 0 ; 		{ IP6 hop-by-hop options }
+	IPPROTO_IGMP		= 2 ; 		{ group mgmt protocol }
+	IPPROTO_GGP		= 3 ; 		{ gateway^2 (deprecated) }
+	IPPROTO_IPV4		= 4 ; 		{ IPv4 encapsulation }
+	IPPROTO_IPIP		= IPPROTO_IPV4;	{ for compatibility }
+	IPPROTO_ST		= 7 ; 		{ Stream protocol II }
+	IPPROTO_EGP		= 8 ; 		{ exterior gateway protocol }
+	IPPROTO_PIGP		= 9 ; 		{ private interior gateway }
+	IPPROTO_RCCMON		= 10; 		{ BBN RCC Monitoring }
+	IPPROTO_NVPII		= 11; 		{ network voice protocol}
+	IPPROTO_PUP		= 12; 		{ pup }
+	IPPROTO_ARGUS		= 13; 		{ Argus }
+	IPPROTO_EMCON		= 14; 		{ EMCON }
+	IPPROTO_XNET		= 15; 		{ Cross Net Debugger }
+	IPPROTO_CHAOS		= 16; 		{ Chaos}
+	IPPROTO_MUX		= 18; 		{ Multiplexing }
+	IPPROTO_MEAS		= 19; 		{ DCN Measurement Subsystems }
+	IPPROTO_HMP		= 20; 		{ Host Monitoring }
+	IPPROTO_PRM		= 21; 		{ Packet Radio Measurement }
+	IPPROTO_IDP		= 22; 		{ xns idp }
+	IPPROTO_TRUNK1		= 23; 		{ Trunk-1 }
+	IPPROTO_TRUNK2		= 24; 		{ Trunk-2 }
+	IPPROTO_LEAF1		= 25; 		{ Leaf-1 }
+	IPPROTO_LEAF2		= 26; 		{ Leaf-2 }
+	IPPROTO_RDP		= 27; 		{ Reliable Data }
+	IPPROTO_IRTP		= 28; 		{ Reliable Transaction }
+	IPPROTO_TP		= 29; 		{ tp-4 w/ class negotiation }
+	IPPROTO_BLT		= 30; 		{ Bulk Data Transfer }
+	IPPROTO_NSP		= 31; 		{ Network Services }
+	IPPROTO_INP		= 32; 		{ Merit Internodal }
+	IPPROTO_SEP		= 33; 		{ Sequential Exchange }
+	IPPROTO_3PC		= 34; 		{ Third Party Connect }
+	IPPROTO_IDPR		= 35; 		{ InterDomain Policy Routing }
+	IPPROTO_XTP		= 36; 		{ XTP }
+	IPPROTO_DDP		= 37; 		{ Datagram Delivery }
+	IPPROTO_CMTP		= 38; 		{ Control Message Transport }
+	IPPROTO_TPXX		= 39; 		{ TP++ Transport }
+	IPPROTO_IL		= 40; 		{ IL transport protocol }
+	IPPROTO_IPV6		= 41; 		{ IP6 header }
+	IPPROTO_SDRP		= 42; 		{ Source Demand Routing }
+	IPPROTO_ROUTING		= 43; 		{ IP6 routing header }
+	IPPROTO_FRAGMENT	= 44; 		{ IP6 fragmentation header }
+	IPPROTO_IDRP		= 45; 		{ InterDomain Routing}
+	IPPROTO_RSVP		= 46; 		{ resource reservation }
+	IPPROTO_GRE		= 47; 		{ General Routing Encap. }
+	IPPROTO_MHRP		= 48; 		{ Mobile Host Routing }
+	IPPROTO_BHA		= 49; 		{ BHA }
+	IPPROTO_ESP		= 50; 		{ IP6 Encap Sec. Payload }
+	IPPROTO_AH		= 51; 		{ IP6 Auth Header }
+	IPPROTO_INLSP		= 52; 		{ Integ. Net Layer Security }
+	IPPROTO_SWIPE		= 53; 		{ IP with encryption }
+	IPPROTO_NHRP		= 54; 		{ Next Hop Resolution }
+	IPPROTO_MOBILE		= 55; 		{ IP Mobility }
+	IPPROTO_TLSP		= 56; 		{ Transport Layer Security }
+	IPPROTO_SKIP		= 57; 		{ SKIP }
+	IPPROTO_ICMPV6		= 58; 		{ ICMP6 }
+	IPPROTO_NONE		= 59; 		{ IP6 no next header }
+	IPPROTO_DSTOPTS		= 60; 		{ IP6 destination option }
+	IPPROTO_AHIP		= 61; 		{ any host internal protocol }
+	IPPROTO_CFTP		= 62; 		{ CFTP }
+	IPPROTO_HELLO		= 63; 		{ "hello" routing protocol }
+	IPPROTO_SATEXPAK	= 64; 		{ SATNET/Backroom EXPAK }
+	IPPROTO_KRYPTOLAN	= 65; 		{ Kryptolan }
+	IPPROTO_RVD		= 66; 		{ Remote Virtual Disk }
+	IPPROTO_IPPC		= 67; 		{ Pluribus Packet Core }
+	IPPROTO_ADFS		= 68; 		{ Any distributed FS }
+	IPPROTO_SATMON		= 69; 		{ Satnet Monitoring }
+	IPPROTO_VISA		= 70; 		{ VISA Protocol }
+	IPPROTO_IPCV		= 71; 		{ Packet Core Utility }
+	IPPROTO_CPNX		= 72; 		{ Comp. Prot. Net. Executive }
+	IPPROTO_CPHB		= 73; 		{ Comp. Prot. HeartBeat }
+	IPPROTO_WSN		= 74; 		{ Wang Span Network }
+	IPPROTO_PVP		= 75; 		{ Packet Video Protocol }
+	IPPROTO_BRSATMON	= 76; 		{ BackRoom SATNET Monitoring }
+	IPPROTO_ND		= 77; 		{ Sun net disk proto (temp.) }
+	IPPROTO_WBMON		= 78; 		{ WIDEBAND Monitoring }
+	IPPROTO_WBEXPAK		= 79; 		{ WIDEBAND EXPAK }
+	IPPROTO_EON		= 80; 		{ ISO cnlp }
+	IPPROTO_VMTP		= 81; 		{ VMTP }
+	IPPROTO_SVMTP		= 82; 		{ Secure VMTP }
+	IPPROTO_VINES		= 83; 		{ Banyon VINES }
+	IPPROTO_TTP		= 84; 		{ TTP }
+	IPPROTO_IGP		= 85; 		{ NSFNET-IGP }
+	IPPROTO_DGP		= 86; 		{ dissimilar gateway prot. }
+	IPPROTO_TCF		= 87; 		{ TCF }
+	IPPROTO_IGRP		= 88; 		{ Cisco/GXS IGRP }
+	IPPROTO_OSPFIGP		= 89; 		{ OSPFIGP }
+	IPPROTO_SRPC		= 90; 		{ Strite RPC protocol }
+	IPPROTO_LARP		= 91; 		{ Locus Address Resoloution }
+	IPPROTO_MTP		= 92; 		{ Multicast Transport }
+	IPPROTO_AX25		= 93; 		{ AX.25 Frames }
+	IPPROTO_IPEIP		= 94; 		{ IP encapsulated in IP }
+	IPPROTO_MICP		= 95; 		{ Mobile Int.ing control }
+	IPPROTO_SCCSP		= 96; 		{ Semaphore Comm. security }
+	IPPROTO_ETHERIP		= 97; 		{ Ethernet IP encapsulation }
+	IPPROTO_ENCAP		= 98; 		{ encapsulation header }
+	IPPROTO_APES		= 99; 		{ any private encr. scheme }
+	IPPROTO_GMTP		= 100;		{ GMTP}
+	IPPROTO_IPCOMP		= 108;		{ payload compression (IPComp) }
+{ 101-254: Partly Unassigned }
+	IPPROTO_PIM		= 103;		{ Protocol Independent Mcast }
+	IPPROTO_CARP		= 112;		{ CARP }
+	IPPROTO_PGM		= 113;		{ PGM }
+	IPPROTO_PFSYNC		= 240;		{ PFSYNC }
+
+{ last return value of *_input(), meaning "all job for this pkt is done".  }
+	IPPROTO_RAW             = 255;
+	IPPROTO_MAX		= 256;
+	IPPROTO_DONE		= 257;
+
+{
+ * Options for use with [gs]etsockopt at the IP level.
+ * First word of comment is data type; bool is stored in int.
+ }
+	IP_OPTIONS		= 1 ;   { buf/ip_opts; set/get IP options }
+	IP_HDRINCL		= 2 ;   { int; header is included with data }
+	IP_TOS			= 3 ;   { int; IP type of service and preced. }
+	IP_TTL			= 4 ;   { int; IP time to live }
+	IP_RECVOPTS		= 5 ;   { bool; receive all IP opts w/dgram }
+	IP_RECVRETOPTS		= 6 ;   { bool; receive IP opts for response }
+	IP_RECVDSTADDR		= 7 ;   { bool; receive IP dst addr w/dgram }
+	IP_SENDSRCADDR		= IP_RECVDSTADDR; { cmsg_type to set src addr }
+	IP_RETOPTS		= 8 ;   { ip_opts; set/get IP options }
+	IP_MULTICAST_IF		= 9 ;   { u_char; set/get IP multicast i/f  }
+	IP_MULTICAST_TTL	= 10;   { u_char; set/get IP multicast ttl }
+	IP_MULTICAST_LOOP	= 11;   { u_char; set/get IP multicast loopback }
+	IP_ADD_MEMBERSHIP	= 12;   { ip_mreq; add an IP group membership }
+	IP_DROP_MEMBERSHIP	= 13;   { ip_mreq; drop an IP group membership }
+	IP_MULTICAST_VIF	= 14;   { set/get IP mcast virt. iface }
+	IP_RSVP_ON		= 15;   { enable RSVP in kernel }
+	IP_RSVP_OFF		= 16;   { disable RSVP in kernel }
+	IP_RSVP_VIF_ON		= 17;   { set RSVP per-vif socket }
+	IP_RSVP_VIF_OFF		= 18;   { unset RSVP per-vif socket }
+	IP_PORTRANGE		= 19;   { int; range to choose for unspec port }
+	IP_RECVIF		= 20;   { bool; receive reception if w/dgram }
+
+{ for IPSEC }
+	IP_IPSEC_POLICY		= 21;   { int; set/get security policy }
+	IP_FAITH		= 22;   { bool; accept FAITH'ed connections }
+
+	IP_ONESBCAST		= 23;   { bool: send all-ones broadcast }
+                                
+	IP_FW_TABLE_ADD		= 40;   { add entry }
+	IP_FW_TABLE_DEL		= 41;   { delete entry }
+	IP_FW_TABLE_FLUSH	= 42;   { flush table }
+	IP_FW_TABLE_GETSIZE	= 43;   { get table size }
+	IP_FW_TABLE_LIST	= 44;   { list table contents }
+
+	IP_FW_ADD		= 50;   { add a firewall rule to chain }
+	IP_FW_DEL		= 51;   { delete a firewall rule from chain }
+	IP_FW_FLUSH		= 52;   { flush firewall rule chain }
+	IP_FW_ZERO		= 53;   { clear single/all firewall counter(s) }
+	IP_FW_GET		= 54;   { get entire firewall rule chain }
+	IP_FW_RESETLOG		= 55;   { reset logging counters }
+
+	IP_DUMMYNET_CONFIGURE	= 60;   { add/configure a dummynet pipe }
+	IP_DUMMYNET_DEL		= 61;   { delete a dummynet pipe from chain }
+	IP_DUMMYNET_FLUSH	= 62;   { flush dummynet }
+	IP_DUMMYNET_GET		= 64;   { get entire dummynet pipes }
+
+	IP_RECVTTL		= 65;   { bool; receive IP TTL w/dgram }
+
+	IPV6_SOCKOPT_RESERVED1	= 3 ; { reserved for future use }
+	IPV6_UNICAST_HOPS	= 4 ; { int; IP6 hops }
+	IPV6_MULTICAST_IF	= 9 ; { u_int; setget IP6 multicast if  }
+	IPV6_MULTICAST_HOPS	= 10; { int; setget IP6 multicast hops }
+	IPV6_MULTICAST_LOOP	= 11; { u_int; setget IP6 multicast loopback }
+	IPV6_JOIN_GROUP		= 12; { ip6_mreq; join a group membership }
+	IPV6_LEAVE_GROUP	= 13; { ip6_mreq; leave a group membership }
+	IPV6_PORTRANGE		= 14; { int; range to choose for unspec port }
+
+	IPV6_PKTINFO            = 46; { in6_pktinfo; send if, src addr }	
+ 	IPV6_HOPLIMIT           = 47; { int; send hop limit }
+ 	IPV6_NEXTHOP            = 48; { sockaddr; next hop addr }
+ 	IPV6_HOPOPTS            = 49; { ip6_hbh; send hop-by-hop option }
+ 	IPV6_DSTOPTS            = 50; { ip6_dest; send dst option befor rthdr }
+ 	IPV6_RTHDR              = 51; { ip6_rthdr; send routing header }
+ 	IPV6_PKTOPTIONS         = 52; { buf/cmsghdr; set/get IPv6 options }
+  
+  { Flags for send, recv etc. }
+  MSG_OOB       = $0001;              { Process out-of-band data}
+  MSG_PEEK      = $0002;              { Peek at incoming messages }
+  MSG_DONTROUTE = $0004;              { Don't use local routing }
+  MSG_EOR       = $0008;              { End of record }
+  MSG_TRUNC     = $0010;
+  MSG_CTRUNC    = $0020;              { Control data lost before delivery }
+  MSG_WAITALL   = $0040;              { Wait for a full request }
+  MSG_DONTWAIT  = $0080;              { Non-blocking I/O }
+  MSG_EOF       = $0100;
+  MSG_NBIO      = $4000;
+  MSG_COMPAT    = $8000;
+  MSG_SOCALLBCK = $10000;
+  MSG_NOSIGNAL  = $20000;              { Do not generate SIGPIPE }
+  
+  INVALID_SOCKET = -1;
+  SOCKET_ERROR = -1;
+  
+     TCP_NODELAY = $01;
+  { set maximum segment size  }
+     TCP_MAXSEG = $02;
+  { don't push last block of write  }
+     TCP_NOPUSH = $04;
+  { don't use TCP options  }
+     TCP_NOOPT = $08;
+  { use MD5 digests (RFC2385)  }
+     TCP_MD5SIG = $10;
+  { retrieve tcp_info structure  }
+     TCP_INFO = $20;
+
+

+ 22 - 0
rtl/symobi/unxsysch.inc

@@ -0,0 +1,22 @@
+{
+   This file is part of the Free Pascal run time library.
+   Copyright (c) 2003 Marco van de Voort
+   member of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+**********************************************************************}
+
+function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; external name 'FPC_SYSC_GETTIMEOFDAY';
+
+function  fpfStatFS (Fd: cint; Info:pstatfs):cint;
+function  fpStatFS  (Path:pchar; Info:pstatfs):cint;
+function  fpfsync (fd : cint) : cint;
+Function  fpFlock   (fd,mode : cint)   : cint ;
+
+

+ 3 - 1
rtl/unix/clocale.pp

@@ -37,7 +37,9 @@ var OrgFormatSettings : TOrgFormatSettings;
 
 implementation
 
-{$linklib c}
+{$ifndef symobi}
+  {$linklib c}
+{$endif}
 
 Uses
   SysUtils, unixtype, initc;

+ 66 - 16
rtl/unix/cwstring.pp

@@ -24,14 +24,18 @@ procedure SetCWidestringManager;
 
 implementation
 
-{$linklib c}
+{$ifndef symobi}
+  {$linklib c}
+{$endif}
 
 {$if not defined(linux) and not defined(solaris)}  // Linux (and maybe glibc platforms in general), have iconv in glibc.
- {$if defined(haiku)}
-   {$linklib textencoding}
-   {$linklib locale}
- {$else}
-   {$linklib iconv}
+ {$if not defined(symobi}
+   {$if defined(haiku)}
+     {$linklib textencoding}
+     {$linklib locale}
+   {$else}
+     {$linklib iconv}
+   {$endif}
  {$endif}
  {$define useiconv}
 {$endif linux}
@@ -45,12 +49,16 @@ Uses
 
 Const
 {$ifndef useiconv}
-    libiconvname='c';  // is in libc under Linux.
+      libiconvname='c';  // is in libc under Linux.
 {$else}
   {$ifdef haiku}
-    libiconvname='textencoding';  // is in libtextencoding under Haiku
+      libiconvname='textencoding';  // is in libtextencoding under Haiku
   {$else}
-    libiconvname='iconv';
+    {$ifdef symobi}
+      libiconvname='citrus';
+	{$else}
+      libiconvname='iconv';
+	{$endif}
   {$endif}
 {$endif}
 
@@ -58,18 +66,26 @@ Const
 function towlower(__wc:wint_t):wint_t;cdecl;external clib name 'towlower';
 function towupper(__wc:wint_t):wint_t;cdecl;external clib name 'towupper';
 
+{$ifndef symobi}
 function wcscoll (__s1:pwchar_t; __s2:pwchar_t):cint;cdecl;external clib name 'wcscoll';
+{$endif}
 function strcoll (__s1:pchar; __s2:pchar):cint;cdecl;external clib name 'strcoll';
 function setlocale(category: cint; locale: pchar): pchar; cdecl; external clib name 'setlocale';
-{$ifndef beos}
+{$ifdef symobi}
+function mbrtowc(pwc: pwchar_t; const s: pchar; n: size_t; ps: pmbstate_t): size_t; cdecl; external libiconvname name 'mbrtowc';
+function wcrtomb(s: pchar; wc: wchar_t; ps: pmbstate_t): size_t; cdecl; external libiconvname name 'wcrtomb';
+function mbrlen(const s: pchar; n: size_t; ps: pmbstate_t): size_t; cdecl; external libiconvname name 'mbrlen';
+{$else}
+  {$ifndef beos}
 function mbrtowc(pwc: pwchar_t; const s: pchar; n: size_t; ps: pmbstate_t): size_t; cdecl; external clib name 'mbrtowc';
 function wcrtomb(s: pchar; wc: wchar_t; ps: pmbstate_t): size_t; cdecl; external clib name 'wcrtomb';
 function mbrlen(const s: pchar; n: size_t; ps: pmbstate_t): size_t; cdecl; external clib name 'mbrlen';
-{$else beos}
+  {$else beos}
 function mbtowc(pwc: pwchar_t; const s: pchar; n: size_t): size_t; cdecl; external clib name 'mbtowc';
 function wctomb(s: pchar; wc: wchar_t): size_t; cdecl; external clib name 'wctomb';
 function mblen(const s: pchar; n: size_t): size_t; cdecl; external clib name 'mblen';
-{$endif beos}
+  {$endif beos}
+{$endif}
 
 
 const
@@ -105,8 +121,13 @@ const
   {$endif}
   ESysEILSEQ = EILSEQ;
 {$else}
+{$ifdef symobi}
+  CODESET = 51;
+  LC_ALL = 0;
+{$else}
 {$error lookup the value of CODESET in /usr/include/langinfo.h, and the value of LC_ALL in /usr/include/locale.h for your OS }
 // and while doing it, check if iconv is in libc, and if the symbols are prefixed with iconv_ or libiconv_
+{$endif symobi}
 {$endif beos}
 {$endif solaris}
 {$endif FreeBSD}
@@ -135,14 +156,18 @@ type
   nl_item = cint;
 
 {$ifdef haiku}
-  function nl_langinfo(__item:nl_item):pchar;cdecl;external 'locale' name 'nl_langinfo';
+      function nl_langinfo(__item:nl_item):pchar;cdecl;external 'locale' name 'nl_langinfo';
 {$else}
   {$ifndef beos}
-  function nl_langinfo(__item:nl_item):pchar;cdecl;external libiconvname name 'nl_langinfo';
+    {$ifndef symobi}
+      function nl_langinfo(__item:nl_item):pchar;cdecl;external libiconvname name 'nl_langinfo';
+	{$else}
+      function nl_langinfo(__item:nl_item):pchar;cdecl;external libc name 'nl_langinfo';
+	{$endif}
   {$endif}
 {$endif}
 
-{$if (not defined(bsd) and not defined(beos)) or (defined(darwin) and not defined(cpupowerpc32))}
+{$if (not defined(bsd) and not defined(beos)) or (defined(darwin) and not defined(cpupowerpc32)) or defined(symobi)}
 function iconv_open(__tocode:pchar; __fromcode:pchar):iconv_t;cdecl;external libiconvname name 'iconv_open';
 function iconv(__cd:iconv_t; __inbuf:ppchar; __inbytesleft:psize_t; __outbuf:ppchar; __outbytesleft:psize_t):size_t;cdecl;external libiconvname name 'iconv';
 function iconv_close(__cd:iconv_t):cint;cdecl;external libiconvname name 'iconv_close';
@@ -551,9 +576,34 @@ function CompareWideString(const s1, s2 : WideString) : PtrInt;
 
 
 function CompareTextWideString(const s1, s2 : WideString): PtrInt;
+{$ifdef symobi}
+  // Symobi doesn't currently define wcscoll(), so we do a simple comparison
+  // taken from GenericAnsiCompareStr in objpas/sysutils/sysstr.inc
+  Var
+    I,L1,L2 : SizeInt;
+  begin
+    Result:=0;
+    L1:=Length(S1);
+    L2:=Length(S2);
+    I:=1;
+    While (Result=0) and ((I<=L1) and (I<=L2)) do
+      begin
+      Result:=Ord(S1[I])-Ord(S2[I]); //!! Must be replaced by ansi characters !!
+      Inc(I);
+      end;
+    If Result=0 Then
+      Result:=L1-L2;
+  end;
+{$else}
+  var
+    hs1,hs2 : UCS4String;
   begin
-    result:=CompareWideString(UpperWideString(s1),UpperWideString(s2));
+    { wcscoll interprets null chars as end-of-string -> filter out }
+    hs1:=WideStringToUCS4StringNoNulls(s1);
+    hs2:=WideStringToUCS4StringNoNulls(s2);
+    result:=wcscoll(pwchar_t(hs1),pwchar_t(hs2));
   end;
+{$endif}
 
 
 function CharLengthPChar(const Str: PChar): PtrInt;

+ 6 - 0
rtl/unix/dl.pp

@@ -61,7 +61,9 @@ function dlerror() : Pchar; cdecl; external libdl;
 { overloaded for compatibility with hmodule }
 function dlsym(Lib : PtrInt; Name : Pchar) : Pointer; cdecl; external Libdl;
 function dlclose(Lib : PtrInt) : Longint; cdecl; external libdl;
+{$ifndef SYMOBI}
 function dladdr(Lib: pointer; info: Pdl_info): Longint; cdecl; external;
+{$endif}
 
 implementation
 
@@ -82,6 +84,7 @@ implementation
     end;
       
 
+{$ifndef SYMOBI}	  
   procedure UnixGetModuleByAddr(addr: pointer; var baseaddr: pointer; var filename: openstring);
     var
       dlinfo: dl_info;
@@ -94,7 +97,10 @@ implementation
       if SimpleExtractFilename(filename)=SimpleExtractFilename(ParamStr(0)) then
         baseaddr:=nil;
     end;
+{$endif}
 
 begin
+{$ifndef SYMOBI}
   UnixGetModuleByAddrHook:=@UnixGetModuleByAddr;
+{$endif}
 end.

+ 7 - 1
rtl/unix/initc.pp

@@ -17,7 +17,9 @@ unit initc;
 interface
 uses
   ctypes;
-{$linklib c}
+{$ifndef Symobi}
+  {$linklib c}
+{$endif}
 
 function fpgetCerrno:cint;
 procedure fpsetCerrno(err:cint);
@@ -76,6 +78,10 @@ function geterrnolocation: pcint; cdecl;external clib name '___errno';
 function geterrnolocation: pcint; cdecl;external 'root' name '_errnop';
 {$endif}
 
+{$ifdef Symobi}
+function geterrnolocation: pcint; cdecl;external clib name 'getThdErrno';
+{$endif}
+
 function fpgetCerrno:cint;
 
 begin

+ 15 - 0
rtl/unix/oscdecl.inc

@@ -52,3 +52,18 @@ begin
   FpFcntl:=real_FpFcntl(fildes, cmd, @arg);
 end;
 
+{$ifdef symobi}
+
+{ ********************************************************************* }
+{ fpsettimeofday                                                        }
+{ ********************************************************************* }
+
+function FpSetTimeOfDay(tp:ptimeval;tzp:ptimezone):cint;
+begin
+  // dummy implementation, so dos.pp does not need an adjustment
+  FpSetTimeOfDay:=0;
+end;
+
+
+{$endif}
+

+ 14 - 3
rtl/unix/oscdeclh.inc

@@ -41,7 +41,9 @@ const
     function  FpDup2    (oldd:cint;newd:cint):cint; cdecl; external clib name 'dup2';
     function  FpExecve  (path : pchar; argv : ppchar; envp: ppchar): cint; cdecl; external clib name 'execve';
     function  FpFork  : TPid; cdecl; external clib name 'fork';
+{$ifndef symobi}
     function  FpvFork  : TPid; cdecl; external clib name 'vfork';
+{$endif}
     function  FpFtruncate(fd : cint; flength : TOff): cint; cdecl; external clib name 'ftruncate'+suffix64bit;
     function  FpLseek   (fd : cint; offset : TOff; whence : cint): TOff; cdecl; external clib name 'lseek'+suffix64bit;
     function  FpMkdir   (path : pchar; mode: TMode):cint; cdecl; external clib name 'mkdir';
@@ -65,7 +67,7 @@ const
     Function  FpGetcwd  (path:pChar; siz:TSize):pChar; cdecl;  external clib name 'getcwd';
     function  FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint;cdecl; external clib name 'sigprocmask';
     function  FPSigProcMask(how:cint;const nset : sigset;var oset : sigset):cint;cdecl; external clib name 'sigprocmask';
-{$if not defined(darwin) and not defined(haiku)}
+{$if not defined(darwin) and not defined(haiku) and not defined(symobi)}
     Function  FpSigTimedWait (Const sigset : TSigSet; info : Psiginfo; timeout:Ptimespec): cInt; cdecl; external clib name 'sigtimedwait';
     Function  FpSigTimedWait (Const sigset : TSigSet; info : Psiginfo; var timeout:Ttimespec): cInt; cdecl; external clib name 'sigtimedwait';
 {$endif}
@@ -76,7 +78,11 @@ const
     function  FpUnlink  (path: pchar): cint; cdecl; external clib name 'unlink';
     function  FpWaitpid (pid : TPid; stat_loc : pcint; options: cint): TPid; cdecl; external clib name 'waitpid';
     function  FpWrite   (fd: cint;buf:pchar; nbytes : TSize): TSSize; cdecl; external clib name 'write';
+{$ifdef symobi}
+    procedure FpExit    (status : cint); cdecl; external clib name 'exit';
+{$else}
     procedure FpExit    (status : cint); cdecl; external clib name '_exit';
+{$endif}
     function  fpmmap    (addr:pointer;len:size_t;prot:cint;flags:cint;fd:cint;ofs:off_t):pointer; cdecl; external clib name 'mmap'+suffix64bit;
     function  fpmunmap  (addr:pointer;len:size_t):cint; cdecl; external clib name 'munmap';
     { The libc version has "..." as third parameter -> wrap for }
@@ -126,16 +132,21 @@ const
 {$else}
 {$endif}
 {$endif solaris}
+{$ifndef symobi}
     function  fpNice       (N:cint):cint; cdecl; external clib name 'nice';
+{$endif}
     Function  fpGetPriority (Which,Who:cint):cint;      cdecl; external clib name 'getpriority';
     Function  fpSetPriority (Which,Who,What:cint):cint; cdecl; external clib name 'setpriority';
     Function  fpSymlink    (oldname,newname:pchar):cint;   cdecl; external clib name 'symlink';
     Function  fpReadLink           (name,linkname:pchar;maxlen:size_t):cint;  cdecl; external clib name 'readlink';
     Function  FpUmask       (cmask : TMode): TMode; cdecl; external clib name 'umask';
-{$ifndef beos}    
+{$if not defined(beos) and not defined(symobi)}    
     function  fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'settimeofday';
 {$else}
-//    function  fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
+  {$ifdef symobi}
+    { implemented as a dummy that returns 0 }
+    function  fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
+  {$endif}
 {$endif}
     function FpGetRLimit(resource : cInt; rlim : PRLimit) : cInt; cdecl; external clib name 'getrlimit';
 

+ 8 - 0
rtl/unix/sysheap.inc

@@ -17,7 +17,11 @@
 
 function SysOSAlloc(size: ptruint): pointer;
 begin
+{$ifdef symobi}
+  result:=FpMalloc(Size);
+{$else}
   result:=Fpmmap(nil,Size,3,MAP_PRIVATE+MAP_ANONYMOUS,-1,0);
+{$endif}
   if result=pointer(-1) then
     result:=nil
   else
@@ -28,7 +32,11 @@ end;
 
 procedure SysOSFree(p: pointer; size: ptruint);
 begin
+{$ifdef symobi}
+  FpFree(p);
+{$else}
   fpmunmap(p, size);
+{$endif}
 end;
 
 

+ 1 - 1
rtl/unix/sysutils.pp

@@ -21,7 +21,7 @@ interface
 { force ansistrings }
 {$H+}
 
-{$if (defined(BSD) or defined(SUNOS)) and defined(FPC_USE_LIBC)}
+{$if (defined(BSD) or defined(SUNOS)) and defined(FPC_USE_LIBC) and not defined(SYMOBI)}
 {$define USE_VFORK}
 {$endif}
 

+ 4 - 2
rtl/unix/terminfo.pp

@@ -17,8 +17,10 @@ unit TermInfo;
 
 interface
 
-{$linklib ncurses}
-{$linklib c}
+{$ifndef symobi}
+  {$linklib ncurses}
+  {$linklib c}
+{$endif}
 {$packrecords c}
 
 const curseslib = 'ncurses';

+ 2 - 2
rtl/unix/unix.pp

@@ -17,7 +17,7 @@ Interface
 
 Uses BaseUnix,UnixType;
 
-{$if (defined(BSD) or defined(SUNOS)) and defined(FPC_USE_LIBC)}
+{$if (defined(BSD) or defined(SUNOS)) and defined(FPC_USE_LIBC) and not defined(SYMOBI)}
 {$define USE_VFORK}
 {$endif}
 
@@ -1195,7 +1195,7 @@ Function GetDomainName:String;
   end;
 {$endif sunos}
 
-{$ifdef BSD}
+{$if defined(BSD) and not defined(SYMOBI)}
 
 function intGetDomainName(Name:PChar; NameLen:Cint):cint;
 {$ifndef FPC_USE_LIBC}

+ 5 - 5
rtl/unix/unxdeclh.inc

@@ -15,15 +15,15 @@
 
 type filedesarray=array[0..1] of cint;
 
-{$ifdef solaris}
+{$if defined(solaris) or defined(symobi)}
 Function fpFlock (fd,mode : longint) : cint;{$ifdef IN_SYSTEM}forward;{$endif IN_SYSTEM}
-{$else solaris}
+{$else solaris or symobi}
 {$ifndef beos}
 Function fpFlock (fd,mode : longint) : cint; cdecl; external clib name 'flock';
 {$endif beos}
-{$endif solaris}
+{$endif solaris or symobi}
 
-{$if defined(beos) or defined(solaris) }
+{$if defined(beos) or defined(solaris) or defined(symobi)}
 Function fpfStatFS(Fd:Longint; Info:pstatfs):cint; cdecl; external clib name 'fstatvfs';
 {$else beos or solaris }
 Function fpfStatFS(Fd:Longint; Info:pstatfs):cint; cdecl; external clib name 'fstatfs';
@@ -31,7 +31,7 @@ Function fpfStatFS(Fd:Longint; Info:pstatfs):cint; cdecl; external clib name 'fs
 
 Function fpfsync (fd : cint) : cint; cdecl; external clib name 'fsync';
 
-{$if defined(beos) or defined(solaris) }
+{$if defined(beos) or defined(solaris) or defined(symobi) }
 Function fpStatFS  (Path:pchar; Info:pstatfs):cint; cdecl; external clib name 'statvfs';
 {$else beos or solaris }
 Function fpStatFS  (Path:pchar; Info:pstatfs):cint; cdecl; external clib name 'statfs';