Browse Source

+ compile the unit dos (OS-specific functions are dummies for now) for the WASI target

git-svn-id: trunk@49454 -
nickysn 4 years ago
parent
commit
e830ed6cbc
4 changed files with 865 additions and 107 deletions
  1. 1 0
      .gitattributes
  2. 108 106
      rtl/wasi/Makefile
  3. 7 1
      rtl/wasi/Makefile.fpc
  4. 749 0
      rtl/wasi/dos.pp

+ 1 - 0
.gitattributes

@@ -12265,6 +12265,7 @@ rtl/unix/x86.pp svneol=native#text/plain
 rtl/wasi/Makefile svneol=native#text/plain
 rtl/wasi/Makefile.fpc svneol=native#text/plain
 rtl/wasi/classes.pp svneol=native#text/plain
+rtl/wasi/dos.pp svneol=native#text/plain
 rtl/wasi/rtldefs.inc svneol=native#text/plain
 rtl/wasi/si_prc.pp svneol=native#text/plain
 rtl/wasi/sysdir.inc svneol=native#text/plain

+ 108 - 106
rtl/wasi/Makefile

@@ -366,322 +366,322 @@ ifdef NO_EXCEPTIONS_IN_SYSTEM
 override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-android)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i386-aros)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),m68k-macosclassic)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),m68k-sinclairql)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc-macosclassic)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc-wii)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc-aix)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-haiku)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-netbsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-openbsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-iphonesim)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-android)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-aros)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),x86_64-dragonfly)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-netbsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-android)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-aros)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-freertos)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),arm-ios)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),powerpc64-aix)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),mips-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),mipsel-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),mipsel-android)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),mips64el-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),jvm-java)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),jvm-android)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i8086-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i8086-msdos)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),i8086-win16)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),aarch64-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),aarch64-freebsd)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),aarch64-darwin)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),aarch64-win64)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),aarch64-android)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),aarch64-ios)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),wasm32-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),wasm32-wasi)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),sparc64-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),riscv32-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),riscv32-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),riscv64-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),riscv64-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),xtensa-linux)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),xtensa-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),xtensa-freertos)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),z80-embedded)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),z80-zxspectrum)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),z80-msxdos)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 ifeq ($(FULL_TARGET),z80-amstradcpc)
-override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar
+override TARGET_UNITS+=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts charset cpall character unicodedata unicodenumtable fpwidestring classes uuchar dos
 endif
 override INSTALL_FPCPACKAGE=y
 ifeq ($(FULL_TARGET),i386-linux)
@@ -2662,6 +2662,8 @@ wasiapi$(PPUEXT) : wasiapi.pp wasiinc/wasitypes.inc wasiinc/wasiprocs.inc $(SYST
 	$(COMPILER) $< -Fiwasiinc
 ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) $<
+dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc system$(PPUEXT)
+	$(COMPILER) $<
 sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
 		    objpas$(PPUEXT) wasiapi$(PPUEXT) sysconst$(PPUEXT) system$(PPUEXT)
 	$(COMPILER) $< -Fi$(OBJPASDIR)/sysutils

+ 7 - 1
rtl/wasi/Makefile.fpc

@@ -8,7 +8,7 @@ loaders=
 units=system $(SYSINIT_UNITS) objpas wasiapi ctypes strings sysconst sysutils \
       sortbase math rtlconsts types typinfo fgl macpas iso7185 getopts \
       charset cpall character unicodedata unicodenumtable fpwidestring \
-      classes uuchar
+      classes uuchar dos
 
 [require]
 nortl=y
@@ -90,6 +90,12 @@ wasiapi$(PPUEXT) : wasiapi.pp wasiinc/wasitypes.inc wasiinc/wasiprocs.inc $(SYST
 ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) $<
 
+#
+# TP7 Compatible RTL Units
+#
+dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc system$(PPUEXT)
+        $(COMPILER) $<
+
 #
 # Delphi Compatible Units
 #

+ 749 - 0
rtl/wasi/dos.pp

@@ -0,0 +1,749 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Michael Van Canneyt and Peter Vreman,
+    members of the Free Pascal development team
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+Unit Dos;
+Interface
+
+Const
+  FileNameLen = 255;
+
+Type
+  SearchRec =
+{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
+    packed
+{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
+    Record
+  {Fill : array[1..21] of byte;  Fill replaced with below}
+//    SearchPos  : TOff;        {directory position}
+    SearchNum  : LongInt;     {to track which search this is}
+    DirPtr     : Pointer;     {directory pointer for reading directory}
+    SearchType : Byte;        {0=normal, 1=open will close, 2=only 1 file}
+    SearchAttr : Byte;        {attribute we are searching for}
+    Mode       : Word;
+    Fill       : Array[1..1] of Byte; {future use}
+  {End of fill}
+    Attr       : Byte;        {attribute of found file}
+    Time       : LongInt;     {last modify date of found file}
+    Size       : LongInt;     {file size of found file}
+    Reserved   : Word;        {future use}
+    Name       : String[FileNameLen]; {name of found file}
+    SearchSpec : String[FileNameLen]; {search pattern}
+    NamePos    : Word;        {end of path, start of name position}
+  End;
+
+{$DEFINE HAS_FILENAMELEN}
+{$i dosh.inc}
+
+{Extra Utils}
+//function weekday(y,m,d : longint) : longint; platform;
+//Procedure UnixDateToDt(SecsPast: LongInt; Var Dt: DateTime); platform;
+//Function  DTToUnixDate(DT: DateTime): LongInt; platform;
+
+{Disk}
+//Function AddDisk(const path:string) : byte; platform;
+
+Implementation
+
+//Uses
+//  UnixUtil,
+//  Strings,
+//  Unix,
+//  {$ifdef FPC_USE_LIBC}initc{$ELSE}Syscall{$ENDIF};
+
+{$DEFINE HAS_GETMSCOUNT}
+
+{$DEFINE FPC_FEXPAND_TILDE} { Tilde is expanded to home }
+{$DEFINE FPC_FEXPAND_GETENVPCHAR} { GetEnv result is a PChar }
+
+{$I dos.inc}
+
+
+{******************************************************************************
+                           --- Link C Lib if set ---
+******************************************************************************}
+
+{type
+  RtlInfoType = Record
+    FMode,
+    FInode,
+    FUid,
+    FGid,
+    FSize,
+    FMTime : LongInt;
+  End;}
+
+
+{******************************************************************************
+                        --- Info / Date / Time ---
+******************************************************************************}
+
+Function DosVersion:Word;
+Begin
+End;
+
+(*function WeekDay (y,m,d:longint):longint;
+{
+  Calculates th day of the week. returns -1 on error
+}
+var
+  u,v : longint;
+begin
+  if (m<1) or (m>12) or (y<1600) or (y>4000) or
+     (d<1) or (d>30+((m+ord(m>7)) and 1)-ord(m=2)) or
+     ((m*d=58) and (((y mod 4>0) or (y mod 100=0)) and (y mod 400>0))) then
+   WeekDay:=-1
+  else
+   begin
+     u:=m;
+     v:=y;
+     if m<3 then
+      begin
+        inc(u,12);
+        dec(v);
+      end;
+     WeekDay:=(d+2*u+((3*(u+1)) div 5)+v+(v div 4)-(v div 100)+(v div 400)+1) mod 7;
+   end;
+end;*)
+
+
+Procedure GetDate(Var Year, Month, MDay, WDay: Word);
+begin
+end;
+
+
+procedure  SetTime(Hour,Minute,Second,sec100:word);
+begin
+end;
+
+procedure SetDate(Year,Month,Day:Word);
+begin
+end;
+
+
+Function SetDateTime(Year,Month,Day,hour,minute,second:Word) : Boolean;
+begin
+end;
+
+
+Procedure GetTime(Var Hour, Minute, Second, Sec100: Word);
+begin
+end;
+
+
+Procedure UnixDateToDt(SecsPast: LongInt; Var Dt: DateTime);
+Begin
+End;
+
+
+Function DTToUnixDate(DT: DateTime): LongInt;
+Begin
+End;
+
+
+function GetMsCount: int64;
+begin
+end;
+
+
+{******************************************************************************
+                               --- Exec ---
+******************************************************************************}
+
+Procedure Exec (Const Path: PathStr; Const ComLine: ComStr);
+Begin
+End;
+
+
+{******************************************************************************
+                               --- Disk ---
+******************************************************************************}
+
+{
+  The Diskfree and Disksize functions need a file on the specified drive, since this
+  is required for the fpstatfs system call.
+  These filenames are set in drivestr[0..26], and have been preset to :
+   0 - '.'      (default drive - hence current dir is ok.)
+   1 - '/fd0/.'  (floppy drive 1 - should be adapted to local system )
+   2 - '/fd1/.'  (floppy drive 2 - should be adapted to local system )
+   3 - '/'       (C: equivalent of dos is the root partition)
+   4..26          (can be set by you're own applications)
+  ! Use AddDisk() to Add new drives !
+  They both return -1 when a failure occurs.
+}
+Const
+  FixDriveStr : array[0..3] of pchar=(
+    '.',
+    '/fd0/.',
+    '/fd1/.',
+    '/.'
+    );
+const
+  Drives   : byte = 4;
+var
+  DriveStr : array[4..26] of pchar;
+
+Function AddDisk(const path:string) : byte;
+begin
+{  if not (DriveStr[Drives]=nil) then
+   FreeMem(DriveStr[Drives]);
+  GetMem(DriveStr[Drives],length(Path)+1);
+  StrPCopy(DriveStr[Drives],path);
+  AddDisk:=Drives;
+  inc(Drives);
+  if Drives>26 then
+    Drives:=4;}
+end;
+
+
+
+Function DiskFree(Drive: Byte): int64;
+{var
+  fs : tstatfs;}
+Begin
+{  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (fpStatFS(fixdrivestr[drive],@fs)<>-1)) or
+     ((not (drivestr[Drive]=nil)) and (fpStatFS(drivestr[drive],@fs)<>-1)) then
+   Diskfree:=int64(fs.bavail)*int64(fs.bsize)
+  else
+   Diskfree:=-1;}
+End;
+
+
+
+Function DiskSize(Drive: Byte): int64;
+{var
+  fs : tstatfs;}
+Begin
+{  if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (fpStatFS(fixdrivestr[drive],@fs)<>-1)) or
+     ((not (drivestr[Drive]=nil)) and (fpStatFS(drivestr[drive],@fs)<>-1)) then
+   DiskSize:=int64(fs.blocks)*int64(fs.bsize)
+  else
+   DiskSize:=-1;}
+End;
+
+
+
+Procedure FreeDriveStr;
+{var
+  i: longint;}
+begin
+{  for i:=low(drivestr) to high(drivestr) do
+    if assigned(drivestr[i]) then
+      begin
+        freemem(drivestr[i]);
+        drivestr[i]:=nil;
+      end;}
+end;
+
+{******************************************************************************
+                       --- Findfirst FindNext ---
+******************************************************************************}
+
+
+(*Function FNMatch(const Pattern,Name:string):Boolean;
+Var
+  LenPat,LenName : longint;
+
+  Function DoFNMatch(i,j:longint):Boolean;
+  Var
+    Found : boolean;
+  Begin
+  Found:=true;
+  While Found and (i<=LenPat) Do
+   Begin
+     Case Pattern[i] of
+      '?' : Found:=(j<=LenName);
+      '*' : Begin
+            {find the next character in pattern, different of ? and *}
+              while Found do
+                begin
+                inc(i);
+                if i>LenPat then Break;
+                case Pattern[i] of
+                  '*' : ;
+                  '?' : begin
+                          if j>LenName then begin DoFNMatch:=false; Exit; end;
+                          inc(j);
+                        end;
+                else
+                  Found:=false;
+                end;
+               end;
+              Assert((i>LenPat) or ( (Pattern[i]<>'*') and (Pattern[i]<>'?') ));
+            {Now, find in name the character which i points to, if the * or ?
+             wasn't the last character in the pattern, else, use up all the
+             chars in name}
+              Found:=false;
+              if (i<=LenPat) then
+              begin
+                repeat
+                  {find a letter (not only first !) which maches pattern[i]}
+                  while (j<=LenName) and (name[j]<>pattern[i]) do
+                    inc (j);
+                  if (j<LenName) then
+                  begin
+                    if DoFnMatch(i+1,j+1) then
+                    begin
+                      i:=LenPat;
+                      j:=LenName;{we can stop}
+                      Found:=true;
+                      Break;
+                    end else
+                      inc(j);{We didn't find one, need to look further}
+                  end else
+                  if j=LenName then
+                  begin
+                    Found:=true;
+                    Break;
+                  end;
+                  { This 'until' condition must be j>LenName, not j>=LenName.
+                    That's because when we 'need to look further' and
+                    j = LenName then loop must not terminate. }
+                until (j>LenName);
+              end else
+              begin
+                j:=LenName;{we can stop}
+                Found:=true;
+              end;
+            end;
+     else {not a wildcard character in pattern}
+       Found:=(j<=LenName) and (pattern[i]=name[j]);
+     end;
+     inc(i);
+     inc(j);
+   end;
+  DoFnMatch:=Found and (j>LenName);
+  end;
+
+Begin {start FNMatch}
+  LenPat:=Length(Pattern);
+  LenName:=Length(Name);
+  FNMatch:=DoFNMatch(1,1);
+End;*)
+
+
+Const
+  RtlFindSize = 15;
+Type
+  RtlFindRecType = Record
+    DirPtr   : Pointer;
+    SearchNum,
+    LastUsed : LongInt;
+  End;
+Var
+  RtlFindRecs   : Array[1..RtlFindSize] of RtlFindRecType;
+  CurrSearchNum : LongInt;
+
+
+Procedure FindClose(Var f: SearchRec);
+{
+  Closes dirptr if it is open
+}
+{Var
+  i : longint;}
+Begin
+{  if f.SearchType=0 then
+   begin
+     i:=1;
+     repeat
+       if (RtlFindRecs[i].SearchNum=f.SearchNum) then
+        break;
+       inc(i);
+     until (i>RtlFindSize);
+     If i<=RtlFindSize Then
+      Begin
+        RtlFindRecs[i].SearchNum:=0;
+        if f.dirptr<>nil then
+         fpclosedir(pdir(f.dirptr)^);
+      End;
+   end;
+  f.dirptr:=nil;}
+End;
+
+
+Function FindGetFileInfo(const s:string;var f:SearchRec):boolean;
+{var
+  DT   : DateTime;
+  Info : RtlInfoType;
+  st   : baseunix.stat;}
+begin
+{  FindGetFileInfo:=false;
+  if not fpstat(s,st)>=0 then
+   exit;
+  info.FSize:=st.st_Size;
+  info.FMTime:=st.st_mtime;
+  if (st.st_mode and STAT_IFMT)=STAT_IFDIR then
+   info.fmode:=$10
+  else
+   info.fmode:=$0;
+  if (st.st_mode and STAT_IWUSR)=0 then
+   info.fmode:=info.fmode or 1;
+  if s[f.NamePos+1]='.' then
+   info.fmode:=info.fmode or $2;
+
+  If ((Info.FMode and Not(f.searchattr))=0) Then
+   Begin
+     f.Name:=Copy(s,f.NamePos+1,255);
+     f.Attr:=Info.FMode;
+     f.Size:=Info.FSize;
+     f.mode:=st.st_mode;
+     UnixDateToDT(Info.FMTime, DT);
+     PackTime(DT,f.Time);
+     FindGetFileInfo:=true;
+   End;}
+end;
+
+
+Function  FindLastUsed: Longint;
+{
+  Find unused or least recently used dirpointer slot in findrecs array
+}
+{Var
+  BestMatch,i : Longint;
+  Found       : Boolean;}
+Begin
+{  BestMatch:=1;
+  i:=1;
+  Found:=False;
+  While (i <= RtlFindSize) And (Not Found) Do
+   Begin
+     If (RtlFindRecs[i].SearchNum = 0) Then
+      Begin
+        BestMatch := i;
+        Found := True;
+      End
+     Else
+      Begin
+        If RtlFindRecs[i].LastUsed > RtlFindRecs[BestMatch].LastUsed Then
+         BestMatch := i;
+      End;
+     Inc(i);
+   End;
+  FindLastUsed := BestMatch;}
+End;
+
+
+
+Procedure FindNext(Var f: SearchRec);
+{
+  re-opens dir if not already in array and calls FindWorkProc
+}
+{Var
+
+  DirName  : Array[0..256] of Char;
+  i,
+  ArrayPos : Longint;
+  FName,
+  SName    : string;
+  Found,
+  Finished : boolean;
+  p        : pdirent;}
+Begin
+(*  If f.SearchType=0 Then
+   Begin
+     ArrayPos:=0;
+     For i:=1 to RtlFindSize Do
+      Begin
+        If RtlFindRecs[i].SearchNum = f.SearchNum Then
+         ArrayPos:=i;
+        Inc(RtlFindRecs[i].LastUsed);
+      End;
+     If ArrayPos=0 Then
+      Begin
+        If f.NamePos = 0 Then
+         Begin
+           DirName[0] := '.';
+           DirName[1] := '/';
+           DirName[2] := #0;
+         End
+        Else
+         Begin
+           Move(f.SearchSpec[1], DirName[0], f.NamePos);
+           DirName[f.NamePos] := #0;
+         End;
+        f.DirPtr := fpopendir(@DirName[0]);
+        If f.DirPtr <> nil Then
+         begin
+           ArrayPos:=FindLastUsed;
+           If RtlFindRecs[ArrayPos].SearchNum > 0 Then
+            FpCloseDir((pdir(rtlfindrecs[arraypos].dirptr)^));
+           RtlFindRecs[ArrayPos].SearchNum := f.SearchNum;
+           RtlFindRecs[ArrayPos].DirPtr := f.DirPtr;
+           if f.searchpos>0 then
+            seekdir(pdir(f.dirptr), f.searchpos);
+         end;
+      End;
+     if ArrayPos>0 then
+       RtlFindRecs[ArrayPos].LastUsed:=0;
+   end;
+{Main loop}
+  SName:=Copy(f.SearchSpec,f.NamePos+1,255);
+  Found:=False;
+  Finished:=(f.dirptr=nil);
+  While Not Finished Do
+   Begin
+     p:=fpreaddir(pdir(f.dirptr)^);
+     if p=nil then
+      FName:=''
+     else
+      FName:=Strpas(@p^.d_name[0]);
+     If FName='' Then
+      Finished:=True
+     Else
+      Begin
+        If FNMatch(SName,FName) Then
+         Begin
+           Found:=FindGetFileInfo(Copy(f.SearchSpec,1,f.NamePos)+FName,f);
+           if Found then
+            Finished:=true;
+         End;
+      End;
+   End;
+{Shutdown}
+  If Found Then
+   Begin
+     f.searchpos:=telldir(pdir(f.dirptr));
+     DosError:=0;
+   End
+  Else
+   Begin
+     FindClose(f);
+     DosError:=18;
+   End;*)
+End;
+
+
+Procedure FindFirst(Const Path: PathStr; Attr: Word; Var f: SearchRec);
+{
+  opens dir and calls FindWorkProc
+}
+Begin
+(*  fillchar(f,sizeof(f),0);
+  if Path='' then
+   begin
+     DosError:=3;
+     exit;
+   end;
+{Create Info}
+  f.SearchSpec := Path;
+  {We always also search for readonly and archive, regardless of Attr:}
+  f.SearchAttr := Attr or archive or readonly;
+  f.SearchPos  := 0;
+  f.NamePos := Length(f.SearchSpec);
+  while (f.NamePos>0) and (f.SearchSpec[f.NamePos]<>'/') do
+   dec(f.NamePos);
+{Wildcards?}
+  if (Pos('?',Path)=0)  and (Pos('*',Path)=0) then
+   begin
+     if FindGetFileInfo(Path,f) then
+      DosError:=0
+     else
+      begin
+        { According to tdos2 test it should return 18
+        if ErrNo=Sys_ENOENT then
+         DosError:=3
+        else }
+         DosError:=18;
+      end;
+     f.DirPtr:=nil;
+     f.SearchType:=1;
+     f.searchnum:=-1;
+   end
+  else
+{Find Entry}
+   begin
+     Inc(CurrSearchNum);
+     f.SearchNum:=CurrSearchNum;
+     f.SearchType:=0;
+     FindNext(f);
+   end;*)
+End;
+
+
+{******************************************************************************
+                               --- File ---
+******************************************************************************}
+
+Function FSearch(path : pathstr;dirlist : string) : pathstr;
+{Var
+  info : BaseUnix.stat;}
+Begin
+{  if (length(Path)>0) and (path[1]='/') and (fpStat(path,info)>=0) and (not fpS_ISDIR(Info.st_Mode)) then
+    FSearch:=path
+  else
+    FSearch:=Unix.FSearch(path,dirlist);}
+End;
+
+Procedure GetFAttr(var f; var attr : word);
+(*Var
+  info    : baseunix.stat;
+  LinAttr : longint;
+  p       : pchar;
+{$ifndef FPC_ANSI_TEXTFILEREC}
+  r       : RawByteString;
+{$endif not FPC_ANSI_TEXTFILEREC}*)
+Begin
+(*  DosError:=0;
+{$ifdef FPC_ANSI_TEXTFILEREC}
+  { encoding is already correct }
+  p:=@textrec(f).name;
+{$else}
+  r:=ToSingleByteFileSystemEncodedFileName(textrec(f).name);
+  p:=pchar(r);
+{$endif}
+  { use the pchar rather than the rawbytestring version so that we don't check
+    a second time whether the string needs to be converted to the right code
+    page
+  }
+  if FPStat(p,info)<0 then
+   begin
+     Attr:=0;
+     DosError:=3;
+     exit;
+   end
+  else
+   LinAttr:=Info.st_Mode;
+  if fpS_ISDIR(LinAttr) then
+   Attr:=$10
+  else
+   Attr:=$0;
+  if fpAccess(p,W_OK)<0 then
+   Attr:=Attr or $1;
+  if filerec(f).name[0]='.' then
+   Attr:=Attr or $2;*)
+end;
+
+Procedure getftime (var f; var time : longint);
+{Var
+  Info: baseunix.stat;
+  DT: DateTime;}
+Begin
+{  doserror:=0;
+  if fpfstat(filerec(f).handle,info)<0 then
+   begin
+     Time:=0;
+     doserror:=6;
+     exit
+   end
+  else
+   UnixDateToDT(Info.st_mTime,DT);
+  PackTime(DT,Time);}
+End;
+
+Procedure setftime(var f; time : longint);
+(*
+Var
+  utim: utimbuf;
+  DT: DateTime;
+  p : pchar;
+{$ifndef FPC_ANSI_TEXTFILEREC}
+  r : Rawbytestring;
+{$endif not FPC_ANSI_TEXTFILEREC}*)
+Begin
+(*  doserror:=0;
+  with utim do
+    begin
+      actime:=fptime;
+      UnPackTime(Time,DT);
+      modtime:=DTToUnixDate(DT);
+    end;
+{$ifdef FPC_ANSI_TEXTFILEREC}
+  { encoding is already correct }
+  p:=@textrec(f).name;
+{$else}
+  r:=ToSingleByteFileSystemEncodedFileName(textrec(f).name);
+  p:=pchar(r);
+{$endif}
+  { use the pchar rather than the rawbytestring version so that we don't check
+    a second time whether the string needs to be converted to the right code
+    page
+  }
+  if fputime(p,@utim)<0 then
+    begin
+      Time:=0;
+      doserror:=3;
+    end;*)
+End;
+
+{******************************************************************************
+                             --- Environment ---
+******************************************************************************}
+
+Function EnvCount: Longint;
+{var
+  envcnt : longint;
+  p      : ppchar;}
+Begin
+(*  envcnt:=0;
+  p:=envp;      {defined in syslinux}
+  while (p^<>nil) do
+   begin
+     inc(envcnt);
+     inc(p);
+   end;
+  EnvCount := envcnt*)
+End;
+
+
+Function EnvStr (Index: longint): String;
+{Var
+  i : longint;
+  p : ppchar;}
+Begin
+(*  if Index <= 0 then
+    envstr:=''
+  else
+    begin
+      p:=envp;      {defined in syslinux}
+      i:=1;
+      while (i<Index) and (p^<>nil) do
+        begin
+          inc(i);
+          inc(p);
+        end;
+      if p=nil then
+        envstr:=''
+      else
+        envstr:=strpas(p^)
+    end;*)
+end;
+
+
+Function GetEnv(EnvVar: String): String;
+{var
+  p     : pchar;}
+Begin
+{  p:=BaseUnix.fpGetEnv(EnvVar);
+  if p=nil then
+   GetEnv:=''
+  else
+   GetEnv:=StrPas(p);}
+End;
+
+
+Procedure setfattr (var f;attr : word);
+Begin
+(*  {! No Unix equivalent !}
+  { Fail for setting VolumeId }
+  if (attr and VolumeID)<>0 then
+   doserror:=5;*)
+End;
+
+
+
+{******************************************************************************
+                            --- Initialization ---
+******************************************************************************}
+
+//Finalization
+//  FreeDriveStr;
+End.