* moved the common WASI RTL source files and includes to a 'wasicommon' dir

This commit is contained in:
Nikolay Nikolov 2025-02-28 14:46:17 +02:00
parent 40e41a846f
commit 7703ff9b34
23 changed files with 36 additions and 30 deletions

View File

@ -914,6 +914,9 @@ CP_UNITS_SRC=$(addsuffix .pas,$(addprefix $(RTL)/charmaps/,$(CP_UNITS)))
endif
RTL=..
INC=../inc
WASICOMMONINC=$(RTL)/wasicommon
SYSTEMDIR=$(WASICOMMONINC)
DOSDIR=$(WASICOMMONINC)
NSOSDIR=$(NSDIR)/wasi
COMMON=$(RTL)/common
PROCINC=../$(CPU_TARGET)
@ -927,7 +930,7 @@ endif
ifdef NO_EXCEPTIONS_IN_SYSTEM
override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
endif
override FPC_SYSTEM_OPT += -Fiwasiinc
override FPC_SYSTEM_OPT += -Fi$(WASICOMMONINC)/wasiinc
DOS_DEPS_OS=$(WASIAPIUNIT)$(PPUEXT) $(WASIUTILUNIT)$(PPUEXT)
ifeq ($(CPU_OS_TARGET),wasm32-wasip1)
override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) $(OBJPASUNIT) $(EXTPASUNIT) $(MACPASUNIT) $(ISO7185UNIT) $(UUCHARUNIT) $(WASIAPIUNIT) $(CTYPESUNIT) $(STRINGSUNIT) $(SYSCONSTUNIT) $(SYSUTILSUNIT) $(SORTBASEUNIT) $(MATHUNIT) $(RTLCONSTSUNIT) $(TYPESUNIT) $(TYPINFOUNIT) $(FGLUNIT) $(GETOPTSUNIT) $(CHARSETUNIT) $(CPALLUNIT) $(CHARACTERUNIT) $(FPWIDESTRINGUNIT) $(NOTHREADSUNIT) $(CLASSESUNIT) $(DOSUNIT) $(RESUNIT) $(HEAPTRCUNIT) $(WASIUTILUNIT) $(WEBASSEMBLYUNIT)
@ -937,7 +940,7 @@ override TARGET_IMPLICITUNITS+=$(CP_UNITS) $(UNICODEDATAUNIT)
endif
override INSTALL_FPCPACKAGE=y y
ifeq ($(CPU_OS_TARGET),wasm32-wasip1)
override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(WASICOMMONINC)
endif
ifeq ($(CPU_OS_TARGET),wasm32-wasip1)
override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
@ -2946,18 +2949,18 @@ include $(INC)/makefile.inc
SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
include $(PROCINC)/makefile.cpu
SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) wasiinc/wasitypes.inc wasiinc/wasiprocs.inc
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) $(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc
SYSUTILS_DEPS_OS=$(WASIUTILUNIT)$(PPUEXT)
si_prc$(PPUEXT) : si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
si_prc$(PPUEXT) : $(WASICOMMONINC)/si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $<
si_dll$(PPUEXT) : si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
si_dll$(PPUEXT) : $(WASICOMMONINC)/si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $<
WEBASSEMBLYDEPS=$(PROCINC)/webassembly.pp $(SYSTEMUNIT)$(PPUEXT) $(PROCINC)/cpuh.inc $(PROCINC)/cpuinnr.inc $(OBJPASUNIT)$(PPUEXT)
webassembly$(PPUEXT) : $(WEBASSEMBLYDEPS)
$(COMPILER) $<
Wasm.Api$(PPUEXT) : $(NSDIR)/wasm32/Wasm.Api.pp $(WEBASSEMBLYDEPS)
$(COMPILER) $<
WASIAPIDEPS=wasiinc/wasitypes.inc wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
WASIAPIDEPS=$(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
wasiapi$(PPUEXT) : wasiapi.pp $(WASIAPIDEPS)
$(COMPILER) $< -Fiwasiinc
WASIApi.WASIApi$(PPUEXT) : $(NSOSDIR)/WASIApi.WASIApi.pp $(WASIAPIDEPS)

View File

@ -24,12 +24,15 @@ target=wasip1
cpu=wasm32
[compiler]
includedir=$(INC) $(PROCINC)
includedir=$(INC) $(PROCINC) $(WASICOMMONINC)
sourcedir=$(INC) $(PROCINC) $(COMMON)
[prerules]
RTL=..
INC=../inc
WASICOMMONINC=$(RTL)/wasicommon
SYSTEMDIR=$(WASICOMMONINC)
DOSDIR=$(WASICOMMONINC)
NSOSDIR=$(NSDIR)/wasi
COMMON=$(RTL)/common
PROCINC=../$(CPU_TARGET)
@ -47,7 +50,7 @@ ifdef NO_EXCEPTIONS_IN_SYSTEM
override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
endif
override FPC_SYSTEM_OPT += -Fiwasiinc
override FPC_SYSTEM_OPT += -Fi$(WASICOMMONINC)/wasiinc
DOS_DEPS_OS=$(WASIAPIUNIT)$(PPUEXT) $(WASIUTILUNIT)$(PPUEXT)
@ -63,17 +66,17 @@ SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
include $(PROCINC)/makefile.cpu
SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
# Put system unit dependencies together.
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) wasiinc/wasitypes.inc wasiinc/wasiprocs.inc
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) $(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc
SYSUTILS_DEPS_OS=$(WASIUTILUNIT)$(PPUEXT)
#
# $(SYSINIT_UNITS) Units
#
si_prc$(PPUEXT) : si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
si_prc$(PPUEXT) : $(WASICOMMONINC)/si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $<
si_dll$(PPUEXT) : si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
si_dll$(PPUEXT) : $(WASICOMMONINC)/si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $<
#
@ -92,7 +95,7 @@ Wasm.Api$(PPUEXT) : $(NSDIR)/wasm32/Wasm.Api.pp $(WEBASSEMBLYDEPS)
# WASIAPI
#
WASIAPIDEPS=wasiinc/wasitypes.inc wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
WASIAPIDEPS=$(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
wasiapi$(PPUEXT) : wasiapi.pp $(WASIAPIDEPS)
$(COMPILER) $< -Fiwasiinc

View File

@ -914,9 +914,9 @@ CP_UNITS_SRC=$(addsuffix .pas,$(addprefix $(RTL)/charmaps/,$(CP_UNITS)))
endif
RTL=..
INC=../inc
WASIP1INC=$(RTL)/wasip1
SYSTEMDIR=$(WASIP1INC)
DOSDIR=$(WASIP1INC)
WASICOMMONINC=$(RTL)/wasicommon
SYSTEMDIR=$(WASICOMMONINC)
DOSDIR=$(WASICOMMONINC)
NSOSDIR=$(NSDIR)/wasi
COMMON=$(RTL)/common
PROCINC=../$(CPU_TARGET)
@ -930,7 +930,7 @@ endif
ifdef NO_EXCEPTIONS_IN_SYSTEM
override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
endif
override FPC_SYSTEM_OPT += -Fi$(WASIP1INC)/wasiinc
override FPC_SYSTEM_OPT += -Fi$(WASICOMMONINC)/wasiinc
DOS_DEPS_OS=$(WASIAPIUNIT)$(PPUEXT) $(WASIUTILUNIT)$(PPUEXT)
ifeq ($(CPU_OS_TARGET),wasm32-wasip1threads)
override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) $(OBJPASUNIT) $(EXTPASUNIT) $(MACPASUNIT) $(ISO7185UNIT) $(UUCHARUNIT) $(WASIAPIUNIT) $(CTYPESUNIT) $(STRINGSUNIT) $(SYSCONSTUNIT) $(SYSUTILSUNIT) $(SORTBASEUNIT) $(MATHUNIT) $(RTLCONSTSUNIT) $(TYPESUNIT) $(TYPINFOUNIT) $(FGLUNIT) $(GETOPTSUNIT) $(CHARSETUNIT) $(CPALLUNIT) $(CHARACTERUNIT) $(FPWIDESTRINGUNIT) $(NOTHREADSUNIT) $(CLASSESUNIT) $(DOSUNIT) $(RESUNIT) $(HEAPTRCUNIT) $(WASIUTILUNIT) $(WEBASSEMBLYUNIT)
@ -940,7 +940,7 @@ override TARGET_IMPLICITUNITS+=$(CP_UNITS) $(UNICODEDATAUNIT)
endif
override INSTALL_FPCPACKAGE=y y
ifeq ($(CPU_OS_TARGET),wasm32-wasip1threads)
override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(WASIP1INC)
override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(WASICOMMONINC)
endif
ifeq ($(CPU_OS_TARGET),wasm32-wasip1threads)
override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
@ -2949,18 +2949,18 @@ include $(INC)/makefile.inc
SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
include $(PROCINC)/makefile.cpu
SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) $(WASIP1INC)/wasiinc/wasitypes.inc $(WASIP1INC)/wasiinc/wasiprocs.inc
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) $(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc
SYSUTILS_DEPS_OS=$(WASIUTILUNIT)$(PPUEXT)
si_prc$(PPUEXT) : $(WASIP1INC)/si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
si_prc$(PPUEXT) : $(WASICOMMONINC)/si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $<
si_dll$(PPUEXT) : $(WASIP1INC)/si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
si_dll$(PPUEXT) : $(WASICOMMONINC)/si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $<
WEBASSEMBLYDEPS=$(PROCINC)/webassembly.pp $(SYSTEMUNIT)$(PPUEXT) $(PROCINC)/cpuh.inc $(PROCINC)/cpuinnr.inc $(OBJPASUNIT)$(PPUEXT)
webassembly$(PPUEXT) : $(WEBASSEMBLYDEPS)
$(COMPILER) $<
Wasm.Api$(PPUEXT) : $(NSDIR)/wasm32/Wasm.Api.pp $(WEBASSEMBLYDEPS)
$(COMPILER) $<
WASIAPIDEPS=$(WASIP1INC)/wasiinc/wasitypes.inc $(WASIP1INC)/wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
WASIAPIDEPS=$(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
wasiapi$(PPUEXT) : wasiapi.pp $(WASIAPIDEPS)
$(COMPILER) $< -Fiwasiinc
WASIApi.WASIApi$(PPUEXT) : $(NSOSDIR)/WASIApi.WASIApi.pp $(WASIAPIDEPS)

View File

@ -24,15 +24,15 @@ target=wasip1threads
cpu=wasm32
[compiler]
includedir=$(INC) $(PROCINC) $(WASIP1INC)
includedir=$(INC) $(PROCINC) $(WASICOMMONINC)
sourcedir=$(INC) $(PROCINC) $(COMMON)
[prerules]
RTL=..
INC=../inc
WASIP1INC=$(RTL)/wasip1
SYSTEMDIR=$(WASIP1INC)
DOSDIR=$(WASIP1INC)
WASICOMMONINC=$(RTL)/wasicommon
SYSTEMDIR=$(WASICOMMONINC)
DOSDIR=$(WASICOMMONINC)
NSOSDIR=$(NSDIR)/wasi
COMMON=$(RTL)/common
PROCINC=../$(CPU_TARGET)
@ -50,7 +50,7 @@ ifdef NO_EXCEPTIONS_IN_SYSTEM
override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
endif
override FPC_SYSTEM_OPT += -Fi$(WASIP1INC)/wasiinc
override FPC_SYSTEM_OPT += -Fi$(WASICOMMONINC)/wasiinc
DOS_DEPS_OS=$(WASIAPIUNIT)$(PPUEXT) $(WASIUTILUNIT)$(PPUEXT)
@ -66,17 +66,17 @@ SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
include $(PROCINC)/makefile.cpu
SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
# Put system unit dependencies together.
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) $(WASIP1INC)/wasiinc/wasitypes.inc $(WASIP1INC)/wasiinc/wasiprocs.inc
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS) $(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc
SYSUTILS_DEPS_OS=$(WASIUTILUNIT)$(PPUEXT)
#
# $(SYSINIT_UNITS) Units
#
si_prc$(PPUEXT) : $(WASIP1INC)/si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
si_prc$(PPUEXT) : $(WASICOMMONINC)/si_prc.pp $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $<
si_dll$(PPUEXT) : $(WASIP1INC)/si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
si_dll$(PPUEXT) : $(WASICOMMONINC)/si_dll.pp $(SYSTEMUNIT)$(PPUEXT)
$(COMPILER) $<
#
@ -95,7 +95,7 @@ Wasm.Api$(PPUEXT) : $(NSDIR)/wasm32/Wasm.Api.pp $(WEBASSEMBLYDEPS)
# WASIAPI
#
WASIAPIDEPS=$(WASIP1INC)/wasiinc/wasitypes.inc $(WASIP1INC)/wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
WASIAPIDEPS=$(WASICOMMONINC)/wasiinc/wasitypes.inc $(WASICOMMONINC)/wasiinc/wasiprocs.inc $(SYSTEMUNIT)$(PPUEXT)
wasiapi$(PPUEXT) : wasiapi.pp $(WASIAPIDEPS)
$(COMPILER) $< -Fiwasiinc