Browse Source

Merged revisions 6873,6882-6883,6889,6891,6893-6894,6896,6898,6901-6903,6908,6916,6921-6922,6924-6925,6927-6928,6930,6943-6946,6952,6954,6956,6974,6976,6996-6997,7002,7007,7016,7020-7021,7033,7037,7040,7042,7045,7068-7069,7075-7079,7087,7094,7098-7099,7101,7103,7109,7115-7119,7128,7136-7137,7139,7150,7160-7162,7175,7179,7190-7195,7198,7202,7205-7206,7208-7217,7220-7222,7225-7228,7230,7233,7239-7241,7244,7246,7263,7275,7277,7279-7281,7285,7288-7289,7291-7293,7296,7300,7303,7310,7318,7340-7341,7343,7345,7372-7373,7375-7376,7379,7381,7383-7388,7391-7392,7400,7404-7406,7411,7422,7425,7436,7441-7442,7444-7445,7450,7456,7463,7467,7475,7479,7486,7504,7506-7509,7522,7527,7534-7536,7558-7559,7563-7565,7567,7570-7571,7573-7576,7586,7589,7592-7594,7607,7612,7615,7619-7620,7622-7623,7626,7628,7631,7633,7646,7663,7677,7681-7683,7689,7697,7704-7712,7725,7736,7738,7740,7744-7746,7751,7753,7764,7767,7769-7770,7776-7777,7788,7830,7836-7839,7846,7849,7862,7864-7865,7869,7872,7877,7882,7927-7929,7953,7961,7967,7971,7986-7987,7990-7994,7998-8000,8004-8006,8008-8012,8016,8027,8034,8036-8037,8039,8044,8046,8048,8051,8060,8071,8075-8076,8082-8083,8087-8089,8095-8096,8099-8100,8136,8149,8151 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r6873 | karoly | 2007-03-15 19:01:49 +0100 (Thu, 15 Mar 2007) | 2 lines

+ added keymap.library interface unit, which will be required by the updated keyboard unit
........
r8149 | karoly | 2007-07-23 12:29:28 +0200 (Mon, 23 Jul 2007) | 3 lines

+ added MorphOS specific sockets.pp (WIP, but already works at some level)
+ added sockets unit to Makefile.fpc (i have no recent fpcmake ATM to regenerate Makefile)
........
r8151 | karoly | 2007-07-23 17:06:25 +0200 (Mon, 23 Jul 2007) | 1 line

+ regenerated Makefile with recent fpcmake
........

git-svn-id: branches/fixes_2_2@8479 -

peter 18 years ago
parent
commit
0eb0c12d45
5 changed files with 533 additions and 56 deletions
  1. 2 0
      .gitattributes
  2. 71 53
      rtl/morphos/Makefile
  3. 8 3
      rtl/morphos/Makefile.fpc
  4. 141 0
      rtl/morphos/keymap.pas
  5. 311 0
      rtl/morphos/sockets.pp

+ 2 - 0
.gitattributes

@@ -4884,12 +4884,14 @@ rtl/morphos/hardware.pas svneol=native#text/plain
 rtl/morphos/inputevent.pas svneol=native#text/plain
 rtl/morphos/intuition.pas svneol=native#text/plain
 rtl/morphos/keyboard.pp svneol=native#text/plain
+rtl/morphos/keymap.pas svneol=native#text/plain
 rtl/morphos/kvm.pp svneol=native#text/plain
 rtl/morphos/layers.pas svneol=native#text/plain
 rtl/morphos/mouse.pp svneol=native#text/plain
 rtl/morphos/mui.pas -text
 rtl/morphos/muihelper.pas -text
 rtl/morphos/prt0.as svneol=native#text/plain
+rtl/morphos/sockets.pp svneol=native#text/plain
 rtl/morphos/sysdir.inc svneol=native#text/plain
 rtl/morphos/sysfile.inc svneol=native#text/plain
 rtl/morphos/sysheap.inc svneol=native#text/plain

+ 71 - 53
rtl/morphos/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/08/29]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/09/13]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-embedded
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -246,157 +246,160 @@ endif
 OBJPASDIR=$(RTL)/objpas
 GRAPHDIR=$(INC)/graph
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent graphics layers intuition aboxlib mui kvm video keyboard mouse clipboard datatypes asl ahi tinygl get9 muihelper
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas macpas strings dos heaptrc ctypes sysutils classes fgl strutils math typinfo varutils charset ucomplex getopts matrix fmtbcd variants types rtlconsts sysconst dateutil objects exec timer doslib utility hardware inputevent keymap graphics layers intuition aboxlib mui kvm video keyboard mouse sockets clipboard datatypes asl ahi tinygl get9 muihelper
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt0
@@ -548,6 +551,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_LOADERS+=prt0
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_LOADERS+=prt0
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_LOADERS+=prt0
 endif
@@ -701,6 +707,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_RSTS+=math rtlconsts varutils typinfo variants classes sysconst dateutil
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_RSTS+=math rtlconsts varutils typinfo variants classes sysconst dateutil
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_RSTS+=math rtlconsts varutils typinfo variants classes sysconst dateutil
 endif
@@ -855,6 +864,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
@@ -1008,6 +1020,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
@@ -2365,3 +2380,6 @@ kvm$(PPUEXT) : kvm.pp
 video$(PPUEXT) : video.pp 
 mouse$(PPUEXT) : mouse.pp 
 keyboard$(PPUEXT) : keyboard.pp 
+ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
+sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
+		   ctypes$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)

+ 8 - 3
rtl/morphos/Makefile.fpc

@@ -8,14 +8,14 @@ main=rtl
 [target]
 loaders=prt0
 units=$(SYSTEMUNIT) objpas macpas strings \
-      dos heaptrc \
+      dos heaptrc ctypes \
       sysutils classes fgl strutils math typinfo varutils \
       charset ucomplex getopts matrix fmtbcd \
       variants types rtlconsts sysconst dateutil objects \
-      exec timer doslib utility hardware inputevent graphics layers \
+      exec timer doslib utility hardware inputevent keymap graphics layers \
       intuition aboxlib mui \
 # these units are here, because they depend on system interface units above
-      kvm video keyboard mouse \
+      kvm video keyboard mouse sockets \
 # these can be moved to packages later
       clipboard datatypes asl ahi tinygl get9 muihelper
 rsts=math rtlconsts varutils typinfo variants classes sysconst dateutil
@@ -237,3 +237,8 @@ mouse$(PPUEXT) : mouse.pp
 
 keyboard$(PPUEXT) : keyboard.pp 
 #windows$(PPUEXT) dos$(PPUEXT) winevent$(PPUEXT)
+
+ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
+
+sockets$(PPUEXT) : sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
+                   ctypes$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)

+ 141 - 0
rtl/morphos/keymap.pas

@@ -0,0 +1,141 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2007 by Karoly Balogh
+
+    keymap.library interface unit for MorphOS/PowerPC
+    Based on the Commodore Amiga/68k port by Nils Sjoholm
+
+    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.
+
+ **********************************************************************}
+{$PACKRECORDS 2}
+unit keymap;
+
+INTERFACE
+
+uses exec, inputevent;
+
+Type
+
+    pKeyMap = ^tKeyMap;
+    tKeyMap = record
+        km_LoKeyMapTypes        : Pointer;
+        km_LoKeyMap             : Pointer;
+        km_LoCapsable           : Pointer;
+        km_LoRepeatable         : Pointer;
+        km_HiKeyMapTypes        : Pointer;
+        km_HiKeyMap             : Pointer;
+        km_HiCapsable           : Pointer;
+        km_HiRepeatable         : Pointer;
+    end;
+
+
+    pKeymapNode = ^tKeyMapNode;
+    tKeyMapNode = record
+        kn_Node         : tNode;         { including name of keymap }
+        kn_KeyMap       : tKeyMap;
+    end;
+
+{ the structure of keymap.resource }
+
+    pKeyMapResource = ^tKeyMapResource;
+    tKeyMapResource = record
+        kr_Node         : tNode;
+        kr_List         : tList;         { a list of KeyMapNodes }
+    end;
+
+
+Const
+
+{ Key Map Types }
+
+    KC_NOQUAL           = 0;
+    KC_VANILLA          = 7;    { note that SHIFT+ALT+CTRL is VANILLA }
+    KCB_SHIFT           = 0;
+    KCF_SHIFT           = $01;
+    KCB_ALT             = 1;
+    KCF_ALT             = $02;
+    KCB_CONTROL         = 2;
+    KCF_CONTROL         = $04;
+    KCB_DOWNUP          = 3;
+    KCF_DOWNUP          = $08;
+
+    KCB_DEAD            = 5;    { may be dead or modified by dead key:  }
+    KCF_DEAD            = $20;  {   use dead prefix bytes               }
+
+    KCB_STRING          = 6;
+    KCF_STRING          = $40;
+
+    KCB_NOP             = 7;
+    KCF_NOP             = $80;
+
+
+{ Dead Prefix Bytes }
+
+    DPB_MOD             = 0;
+    DPF_MOD             = $01;
+    DPB_DEAD            = 3;
+    DPF_DEAD            = $08;
+
+    DP_2DINDEXMASK      = $0f;  { mask for index for 1st of two dead keys }
+    DP_2DFACSHIFT       = 4;    { shift for factor for 1st of two dead keys }
+
+var 
+  KeymapBase : pLibrary;
+
+const
+    KEYMAPNAME : PChar = 'keymap.library';
+
+procedure SetKeyMapDefault(CONST keyMap : pKeyMap location 'a0'); 
+SysCall KeymapBase 030;
+
+function AskKeyMapDefault : pKeyMap;
+SysCall KeymapBase 036;
+
+function MapRawKey(CONST event : pInputEvent location 'a0'; buffer : pSHORTINT location 'a1'; length : longint location 'd1'; CONST keyMap : pKeyMap location 'a2') : INTEGER;
+SysCall KeymapBase 042;
+
+function MapANSI(CONST strg : pSHORTINT location 'a0'; count : longint location 'd0'; buffer : pSHORTINT location 'a1'; length : longint location 'd1'; CONST keyMap : pKeyMap location 'a2') : longint;
+SysCall KeymapBase 048;
+
+{ Helper calls }
+function InitKeymapLibrary : boolean;
+
+implementation
+
+const
+  { Change VERSION and LIBVERSION to proper values }
+  VERSION : string[2] = '50';
+  LIBVERSION : longword = 50;
+
+var
+  keymap_exit : Pointer;
+
+procedure CloseKeymapLibrary;
+begin
+  ExitProc := keymap_exit;
+  if KeymapBase <> nil then begin
+    CloseLibrary(PLibrary(KeymapBase));
+    KeymapBase := nil;
+  end;
+end;
+
+function InitKeymapLibrary : boolean;
+begin
+  KeymapBase := nil;
+  KeymapBase := OpenLibrary(KEYMAPNAME,LIBVERSION);
+  if KeymapBase <> nil then begin
+    keymap_exit := ExitProc;
+    ExitProc := @CloseKeymapLibrary;
+    InitKeymapLibrary:=True;
+  end else begin
+    InitKeymapLibrary:=False;
+  end;
+end;
+
+end.

+ 311 - 0
rtl/morphos/sockets.pp

@@ -0,0 +1,311 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2007 by 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.
+
+ **********************************************************************}
+{$PACKRECORDS 2}
+unit Sockets;
+Interface
+
+Uses ctypes,exec;
+
+type
+    size_t   = cuint32;         { as definied in the C standard}
+    ssize_t  = cint32;          { used by function for returning number of bytes}
+
+    socklen_t= cuint32;
+    TSocklen = socklen_t;
+    pSocklen = ^socklen_t;
+
+
+//{ $i unxsockh.inc}
+{$define BSD}
+{$define SOCK_HAS_SINLEN}
+{$i socketsh.inc}
+
+type
+  TUnixSockAddr = packed Record
+                  sa_len     : cuchar;
+                  family       : sa_family_t;
+                  path:array[0..107] of char;    //104 total for freebsd.
+                  end;
+
+type
+  hostent = record
+    h_name     : PChar;
+    h_aliases  : PPChar;
+    h_addrtype : LongInt;
+    h_Length   : LongInt;
+    h_addr_list: ^PDWord;
+  end;
+  THostEnt = hostent;
+  PHostEnt = ^THostEnt;
+
+
+const
+  AF_UNSPEC      = 0;               {* unspecified *}
+  AF_LOCAL       = 1;               {* local to host (pipes, portals) *}
+  AF_UNIX        = AF_LOCAL;        {* backward compatibility *}
+  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_NS          = 6;               {* XEROX NS 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_MAX         = 26;
+
+
+const
+  EsockEINTR            = 4; // EsysEINTR;   
+  EsockEBADF            = 9; // EsysEBADF;
+  EsockEFAULT           = 14; // EsysEFAULT;
+  EsockEINVAL           = 22; //EsysEINVAL;
+  EsockEACCESS          = 13; //ESysEAcces;
+  EsockEMFILE           = 24; //ESysEmfile;
+  EsockENOBUFS          = 55; //ESysENoBufs;
+  EsockENOTCONN         = 57; //ESysENotConn;
+  EsockEPROTONOSUPPORT  = 43; //ESysEProtoNoSupport;
+  EsockEWOULDBLOCK      = 35; //ESysEWouldBlock; // same as eagain on morphos
+
+{ unix socket specific functions }
+{*
+Procedure Str2UnixSockAddr(const addr:string;var t:TUnixSockAddr;var len:longint); deprecated;
+Function Bind(Sock:longint;const addr:string):boolean; deprecated;
+Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:text):Boolean; deprecated;
+Function Connect(Sock:longint;const addr:string;var SockIn,SockOut:file):Boolean; deprecated;
+Function Accept(Sock:longint;var addr:string;var SockIn,SockOut:text):Boolean;    deprecated;
+Function Accept(Sock:longint;var addr:string;var SockIn,SockOut:File):Boolean;    deprecated;
+*}
+//function  fpaccept      (s:cint; addrx : psockaddr; addrlen : psocklen):cint; maybelibc
+//function  fpbind      (s:cint; addrx : psockaddr; addrlen : tsocklen):cint;  maybelibc
+//function  fpconnect     (s:cint; name  : psockaddr; namelen : tsocklen):cint;  maybelibc
+
+var SocketBase : pLibrary;
+
+function bsd_socket(domain : LongInt location 'd0'; type_ : LongInt location 'd1'; protocol : LongInt location 'd2') : LongInt; syscall legacy SocketBase 030;
+function bsd_bind(s : LongInt location 'd0'; const name : psockaddr location 'a0'; namelen : LongInt location 'd1') : LongInt; syscall legacy SocketBase 036;
+function bsd_listen(s : LongInt location 'd0'; backlog : LongInt location 'd1') : LongInt; syscall legacy SocketBase 042;
+function bsd_accept(s : LongInt location 'd0'; addr : psockaddr location 'a0'; var addrlen : LongInt location 'a1') : LongInt; syscall legacy SocketBase 048;
+function bsd_connect(s : LongInt location 'd0'; const name : psockaddr location 'a0'; namelen : LongInt location 'd1') : LongInt; syscall legacy SocketBase 054;
+function bsd_sendto(s : LongInt location 'd0'; const msg : pChar location 'a0'; len : LongInt location 'd1'; flags : LongInt location 'd2'; const to_ : psockaddr location 'a1'; tolen : LongInt location 'd3') : LongInt; syscall legacy SocketBase 060;
+function bsd_send(s : LongInt location 'd0'; const msg : pChar location 'a0'; len : LongInt location 'd1'; flags : LongInt location 'd2') : LongInt; syscall legacy SocketBase 066;
+function bsd_recvfrom(s : LongInt location 'd0'; buf : pChar location 'a0'; len : LongInt location 'd1'; flags : LongInt location 'd2'; from : psockaddr location 'a1'; var fromlen : LongInt location 'a2') : LongInt; syscall legacy SocketBase 072;
+function bsd_recv(s : LongInt location 'd0'; buf : pChar location 'a0'; len : LongInt location 'd1'; flags : LongInt location 'd2') : LongInt; syscall legacy SocketBase 078;
+function bsd_shutdown(s : LongInt location 'd0'; how : LongInt location 'd1') : LongInt; syscall legacy SocketBase 084;
+function bsd_closesocket(d : LongInt location 'd0') : LongInt; syscall legacy SocketBase 120;
+function bsd_inet_ntoa(in_ : DWord location 'd0') : pChar; syscall legacy SocketBase 174;
+function bsd_inet_addr(const cp : pChar location 'a0') : DWord; syscall legacy SocketBase 180;
+function bsd_gethostbyname(const name : pChar location 'a0') : phostent; syscall legacy SocketBase 210;
+function bsd_gethostbyaddr(const addr : pChar location 'a0'; len : LongInt location 'd0'; type_ : LongInt location 'd1') : phostent; syscall legacy SocketBase 216;
+
+
+Implementation
+
+//Uses {$ifndef FPC_USE_LIBC}SysCall{$else}initc{$endif};
+
+threadvar internal_socketerror : cint;
+
+{ Include filerec and textrec structures }
+{$i filerec.inc}
+{$i textrec.inc}
+{******************************************************************************
+                          Kernel Socket Callings
+******************************************************************************}
+
+function socketerror:cint;
+
+begin
+  socketerror:=internal_socketerror;
+end;
+
+//{$define uselibc:=cdecl; external;}
+
+//const libname='c';
+{
+function cfpaccept      (s:cint; addrx : psockaddr; addrlen : psocklen):cint; cdecl; external libname name 'accept';
+function cfpbind        (s:cint; addrx : psockaddr; addrlen : tsocklen):cint;  cdecl; external libname name 'bind';
+function cfpconnect     (s:cint; name  : psockaddr; namelen : tsocklen):cint;  cdecl; external libname name 'connect';
+function cfpgetpeername (s:cint; name  : psockaddr; namelen : psocklen):cint; cdecl; external libname name 'getpeername';
+function cfpgetsockname (s:cint; name  : psockaddr; namelen : psocklen):cint; cdecl; external libname name 'getsockname';
+function cfpgetsockopt  (s:cint; level:cint; optname:cint; optval:pointer; optlen : psocklen):cint; cdecl; external libname name 'getsockopt';
+function cfplisten      (s:cint; backlog : cint):cint;                          cdecl; external libname name 'listen';
+function cfprecv        (s:cint; buf: pointer; len: size_t; flags: cint):ssize_t; cdecl; external libname name 'recv';
+function cfprecvfrom    (s:cint; buf: pointer; len: size_t; flags: cint; from : psockaddr; fromlen : psocklen):ssize_t; cdecl; external libname name 'recvfrom';
+//function cfprecvmsg     (s:cint; msg: pmsghdr; flags:cint):ssize_t; cdecl; external libname name '';
+function cfpsend        (s:cint; msg:pointer; len:size_t; flags:cint):ssize_t; cdecl; external libname name 'send';
+function cfpsendto      (s:cint; msg:pointer; len:size_t; flags:cint; tox :psockaddr; tolen: tsocklen):ssize_t; cdecl; external libname name 'sendto';
+//function cfpsendmsg   (s:cint; hdr: pmsghdr; flags:cint):ssize; cdecl; external libname name '';
+function cfpsetsockopt  (s:cint; level:cint; optname:cint; optval:pointer; optlen :tsocklen):cint; cdecl; external libname name 'setsockopt';
+function cfpshutdown    (s:cint; how:cint):cint; cdecl; external libname name 'shutdown';
+function cfpsocket      (domain:cint; xtype:cint; protocol: cint):cint; cdecl; external libname name 'socket';
+function cfpsocketpair  (d:cint; xtype:cint; protocol:cint; sv:pcint):cint; cdecl; external libname name 'socketpair';
+}
+
+function cfpaccept(s : LongInt location 'd0'; addr : psockaddr location 'a0';  addrlen : pSocklen location 'a1') : LongInt; syscall legacy SocketBase 048;
+function cfpbind(s : LongInt location 'd0'; const name : psockaddr location 'a0'; namelen : LongInt location 'd1') : LongInt; syscall legacy SocketBase 036;
+function cfpconnect(s : LongInt location 'd0'; const name : psockaddr location 'a0'; namelen : LongInt location 'd1') : LongInt; syscall legacy SocketBase 054;
+function cfpsendto(s : LongInt location 'd0'; const msg : pChar location 'a0'; len : LongInt location 'd1'; flags : LongInt location 'd2'; const to_ : psockaddr location 'a1'; tolen : LongInt location 'd3') : LongInt; syscall legacy SocketBase 060;
+function cfpsend(s : LongInt location 'd0'; const msg : pChar location 'a0'; len : LongInt location 'd1'; flags : LongInt location 'd2') : LongInt; syscall legacy SocketBase 066;
+function cfprecvfrom(s : LongInt location 'd0'; buf : pChar location 'a0'; len : LongInt location 'd1'; flags : LongInt location 'd2'; from : psockaddr location 'a1'; fromlen : pSockLen location 'a2') : LongInt; syscall legacy SocketBase 072;
+function cfprecv(s : LongInt location 'd0'; buf : pChar location 'a0'; len : LongInt location 'd1'; flags : LongInt location 'd2') : LongInt; syscall legacy SocketBase 078;
+function cfpgetsockopt(s : LongInt location 'd0'; level : LongInt location 'd1'; optname : LongInt location 'd2'; optval : Pointer location 'a0'; optlen : pSockLen location 'a1') : LongInt; syscall legacy SocketBase 096;
+function cfpgetsockname(s : LongInt location 'd0'; hostname : psockaddr location 'a0'; namelen : pSockLen location 'a1') : LongInt; syscall legacy SocketBase 102;
+function cfpgetpeername(s : LongInt location 'd0'; hostname : psockaddr location 'a0'; namelen : pSockLen location 'a1') : LongInt; syscall legacy SocketBase 108;
+function cfpsetsockopt(s : LongInt location 'd0'; level : LongInt location 'd1'; optname : LongInt location 'd2'; const optval : Pointer location 'a0'; optlen : LongInt location 'd3') : LongInt; syscall legacy SocketBase 090;
+function cfplisten(s : LongInt location 'd0'; backlog : LongInt location 'd1') : LongInt; syscall legacy SocketBase 042;
+function cfpsocket(domain : LongInt location 'd0'; type_ : LongInt location 'd1'; protocol : LongInt location 'd2') : LongInt; syscall legacy SocketBase 030;
+function cfpshutdown(s : LongInt location 'd0'; how : LongInt location 'd1') : LongInt; syscall legacy SocketBase 084;
+function cfpCloseSocket(d : LongInt location 'd0') : LongInt; syscall legacy SocketBase 120;
+
+function cfpErrno : LongInt; syscall legacy SocketBase 162;
+
+function fpgeterrno: longint; inline;
+begin
+  fpgeterrno:=cfpErrno;
+end;
+
+function fpClose(d: LongInt): LongInt; inline;
+begin
+  fpClose:=cfpCloseSocket(d);
+end;
+
+function fpaccept      (s:cint; addrx : psockaddr; addrlen : psocklen):cint;
+
+begin
+ fpaccept:=cfpaccept(s,addrx,addrlen);
+ internal_socketerror:=fpgeterrno; 
+end;
+
+function fpbind (s:cint; addrx : psockaddr; addrlen : tsocklen):cint;
+begin
+  fpbind:=cfpbind (s,addrx,addrlen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fpconnect     (s:cint; name  : psockaddr; namelen : tsocklen):cint;
+begin
+  fpconnect:=cfpconnect (s,name,namelen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fpgetpeername (s:cint; name  : psockaddr; namelen : psocklen):cint;
+begin
+  fpgetpeername:=cfpgetpeername (s,name,namelen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fpgetsockname (s:cint; name  : psockaddr; namelen : psocklen):cint;
+begin
+  fpgetsockname:=cfpgetsockname(s,name,namelen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fpgetsockopt  (s:cint; level:cint; optname:cint; optval:pointer; optlen : psocklen):cint;
+begin
+  fpgetsockopt:=cfpgetsockopt(s,level,optname,optval,optlen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fplisten      (s:cint; backlog : cint):cint;
+begin
+  fplisten:=cfplisten(s,backlog);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fprecv         (s:cint; buf: pointer; len: size_t; flags:cint):ssize_t;
+begin
+  fprecv:= cfprecv      (s,buf,len,flags);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fprecvfrom    (s:cint; buf: pointer; len: size_t; flags: cint; from : psockaddr; fromlen : psocklen):ssize_t;
+begin
+  fprecvfrom:= cfprecvfrom (s,buf,len,flags,from,fromlen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fpsend         (s:cint; msg:pointer; len:size_t; flags:cint):ssize_t;
+begin
+  fpsend:=cfpsend (s,msg,len,flags);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fpsendto       (s:cint; msg:pointer; len:size_t; flags:cint; tox :psockaddr; tolen: tsocklen):ssize_t;
+begin
+  fpsendto:=cfpsendto (s,msg,len,flags,tox,tolen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fpsetsockopt  (s:cint; level:cint; optname:cint; optval:pointer; optlen :tsocklen):cint;
+begin
+  fpsetsockopt:=cfpsetsockopt(s,level,optname,optval,optlen);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fpshutdown     (s:cint; how:cint):cint;
+begin
+  fpshutdown:=cfpshutdown(s,how);
+  internal_socketerror:=fpgeterrno;
+end;
+
+function fpsocket       (domain:cint; xtype:cint; protocol: cint):cint;
+begin
+  fpsocket:=cfpsocket(domain,xtype,protocol);
+  internal_socketerror:=fpgeterrno;
+end;
+
+
+function fpsocketpair  (d:cint; xtype:cint; protocol:cint; sv:pcint):cint;
+begin
+{
+  fpsocketpair:=cfpsocketpair(d,xtype,protocol,sv);
+  internal_socketerror:=fpgeterrno;
+}
+  fpsocketpair:=-1;
+end;
+
+
+{$i sockovl.inc}
+{$i sockets.inc}
+
+// FIXME: this doesn't make any sense here, because SocketBase should be task-specific
+// but FPC doesn't support that yet (TODO)
+{$WARNING FIX ME, TODO}
+
+initialization
+
+  SocketBase:=NIL;
+  SocketBase:=OpenLibrary('bsdsocket.library',4);
+
+finalization
+
+  if (SocketBase<>NIL) then CloseLibrary(SocketBase);
+
+end.