ソースを参照

* Wasmtime support

Michaël Van Canneyt 3 年 前
コミット
e091d263c8

+ 1 - 0
packages/fpmake_add.inc

@@ -147,5 +147,6 @@
   add_vclcompat(ADirectory+IncludeTrailingPathDelimiter('vcl-compat'));
   add_vclcompat(ADirectory+IncludeTrailingPathDelimiter('vcl-compat'));
   add_qlunits(ADirectory+IncludeTrailingPathDelimiter('qlunits'));
   add_qlunits(ADirectory+IncludeTrailingPathDelimiter('qlunits'));
   add_mustache(ADirectory+IncludeTrailingPathDelimiter('fcl-mustache'));
   add_mustache(ADirectory+IncludeTrailingPathDelimiter('fcl-mustache'));
+  add_wasmtime(ADirectory+IncludeTrailingPathDelimiter('wasmtime'));
   add_gitlab(ADirectory+IncludeTrailingPathDelimiter('gitlab'));
   add_gitlab(ADirectory+IncludeTrailingPathDelimiter('gitlab'));
   
   

+ 6 - 0
packages/fpmake_proc.inc

@@ -833,5 +833,11 @@ begin
 {$include fcl-mustache/fpmake.pp}
 {$include fcl-mustache/fpmake.pp}
 end;
 end;
 
 
+procedure add_wasmtime(const ADirectory: string);
+begin
+  with Installer do
+{$include wasmtime/fpmake.pp}
+end;
+
 {$include ide/fpmake.pp}
 {$include ide/fpmake.pp}
 {$include gitlab/fpmake.pp}
 {$include gitlab/fpmake.pp}

+ 2092 - 0
packages/wasmtime/Makefile

@@ -0,0 +1,2092 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0
+#
+default: all
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-netbsd m68k-amiga m68k-atari m68k-palmos m68k-macosclassic m68k-embedded m68k-sinclairql powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macosclassic powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-haiku x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-iphonesim x86_64-android x86_64-aros x86_64-dragonfly arm-linux arm-netbsd arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android arm-aros arm-freertos arm-ios powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android mips64el-linux jvm-java jvm-android i8086-embedded i8086-msdos i8086-win16 aarch64-linux aarch64-freebsd aarch64-darwin aarch64-win64 aarch64-android aarch64-ios wasm32-embedded wasm32-wasi sparc64-linux riscv32-linux riscv32-embedded riscv64-linux riscv64-embedded xtensa-linux xtensa-embedded xtensa-freertos z80-embedded z80-zxspectrum z80-msxdos z80-amstradcpc
+BSDs = freebsd netbsd openbsd darwin dragonfly
+UNIXs = linux $(BSDs) solaris qnx haiku aix
+LIMIT83fs = go32v2 os2 emx watcom msdos win16 atari
+OSNeedsComspecToRunBatch = go32v2 watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+ifndef RUNBATCH
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override DEFAULT_FPCDIR=../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
+FPC:=$(shell $(FPCPROG) -PB)
+endif
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+else
+ifeq ($(strip $(wildcard $(FPC))),)
+FPC:=$(firstword $(FPCPROG))
+endif
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifeq ($(CPU_TARGET),armeb)
+ARCH=arm
+override FPCOPT+=-Cb
+else
+ifeq ($(CPU_TARGET),armel)
+ARCH=arm
+override FPCOPT+=-CaEABI
+else
+ARCH=$(CPU_TARGET)
+endif
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+ifeq ($(SUBARCH),)
+$(error When compiling for arm-embedded, a sub-architecture (e.g. SUBARCH=armv4t or SUBARCH=armv7m) must be defined)
+endif
+override FPCOPT+=-Cp$(SUBARCH)
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+ifeq ($(SUBARCH),)
+$(error When compiling for avr-embedded, a sub-architecture (e.g. SUBARCH=avr25 or SUBARCH=avr35) must be defined)
+endif
+override FPCOPT+=-Cp$(SUBARCH)
+endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+ifeq ($(SUBARCH),)
+$(error When compiling for mipsel-embedded, a sub-architecture (e.g. SUBARCH=pic32mx) must be defined)
+endif
+override FPCOPT+=-Cp$(SUBARCH)
+endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
+ifeq ($(SUBARCH),)
+$(error When compiling for xtensa-embedded, a sub-architecture (e.g. SUBARCH=lx106 or SUBARCH=lx6) must be defined)
+endif
+override FPCOPT+=-Cp$(SUBARCH)
+endif
+ifeq ($(FULL_TARGET),xtensa-freertos)
+ifeq ($(SUBARCH),)
+$(error When compiling for xtensa-freertos, a sub-architecture (e.g. SUBARCH=lx106 or SUBARCH=lx6) must be defined)
+endif
+override FPCOPT+=-Cp$(SUBARCH)
+endif
+ifeq ($(FULL_TARGET),arm-freertos)
+ifeq ($(SUBARCH),)
+$(error When compiling for arm-freertos, a sub-architecture (e.g. SUBARCH=armv6m or SUBARCH=armv7em) must be defined)
+endif
+override FPCOPT+=-Cp$(SUBARCH)
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+ifneq ($(findstring $(OS_TARGET),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+endif
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+ifndef CROSSCOMPILE
+BUILDFULLNATIVE=1
+export BUILDFULLNATIVE
+endif
+ifdef BUILDFULLNATIVE
+BUILDNATIVE=1
+export BUILDNATIVE
+endif
+export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifneq ($(findstring $(OS_TARGET),darwin iphonesim ios),)
+ifneq ($(findstring $(OS_SOURCE),darwin ios),)
+DARWIN2DARWIN=1
+endif
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+ifneq ($(OS_TARGET),msdos)
+ifndef DARWIN2DARWIN
+ifneq ($(CPU_TARGET),jvm)
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+ifeq ($(OS_TARGET),android)
+ifeq ($(CPU_TARGET),arm)
+BINUTILSPREFIX=arm-linux-androideabi-
+else
+ifeq ($(CPU_TARGET),i386)
+BINUTILSPREFIX=i686-linux-android-
+else
+BINUTILSPREFIX=$(CPU_TARGET)-linux-android-
+endif
+endif
+endif
+endif
+endif
+else
+BINUTILSPREFIX=$(OS_TARGET)-
+endif
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
+ifndef FPCFPMAKE
+ifdef CROSSCOMPILE
+ifeq ($(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR)))),)
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+FPCFPMAKE:=$(shell $(FPCPROG) -PB)
+ifeq ($(strip $(wildcard $(FPCFPMAKE))),)
+FPCFPMAKE:=$(firstword $(FPCPROG))
+endif
+else
+override FPCFPMAKE=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+else
+FPCFPMAKE=$(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR))))
+FPMAKE_SKIP_CONFIG=-n
+export FPCFPMAKE
+export FPMAKE_SKIP_CONFIG
+endif
+else
+FPMAKE_SKIP_CONFIG=-n
+FPCFPMAKE=$(FPC)
+endif
+endif
+override PACKAGE_NAME=wasmtime
+override PACKAGE_VERSION=3.3.1
+FPMAKE_BIN_CLEAN=$(wildcard ./fpmake$(SRCEXEEXT))
+ifdef OS_TARGET
+FPC_TARGETOPT+=--os=$(OS_TARGET)
+endif
+ifdef CPU_TARGET
+FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
+endif
+LOCALFPMAKE=./fpmake$(SRCEXEEXT)
+override INSTALL_FPCPACKAGE=y
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+ifeq ($(OS_SOURCE),linux)
+ifndef GCCLIBDIR
+ifeq ($(CPU_TARGET),i386)
+ifneq ($(findstring x86_64,$(shell uname -a)),)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
+else
+CROSSGCCOPT=-m32
+endif
+endif
+endif
+ifeq ($(CPU_TARGET),powerpc)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
+else
+CROSSGCCOPT=-m32
+endif
+endif
+ifeq ($(CPU_TARGET),powerpc64)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`)
+else
+CROSSGCCOPT=-m64
+endif
+endif
+ifeq ($(CPU_TARGET),sparc)
+ifneq ($(findstring sparc64,$(shell uname -a)),)
+ifeq ($(BINUTILSPREFIX),)
+GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
+else
+ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),mips mipsel),)
+CROSSGCCOPT=-mabi=32
+else
+CROSSGCCOPT=-m32
+endif
+endif
+endif
+endif
+endif
+ifdef FPCFPMAKE
+FPCFPMAKE_CPU_TARGET=$(shell $(FPCFPMAKE) -iTP)
+ifeq ($(CPU_TARGET),$(FPCFPMAKE_CPU_TARGET))
+FPCMAKEGCCLIBDIR:=$(GCCLIBDIR)
+else
+ifneq ($(findstring $(FPCFPMAKE_CPU_TARGET),aarch64 powerpc64 riscv64 sparc64 x86_64),)
+FPCMAKE_CROSSGCCOPT=-m64
+else
+ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),mips64 mips64el),)
+FPCMAKE_CROSSGCCOPT=-mabi=64
+else
+ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),mips mipsel),)
+FPCMAKE_CROSSGCCOPT=-mabi=32
+else
+ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),riscv64),)
+FPCMAKE_CROSSGCCOPT=-mabi=lp64
+else
+ifneq ($(findstring $(FPCFPMAKE_CPU_OPT),riscv32),)
+FPCMAKE_CROSSGCCOPT=-mabi=ilp32
+else
+FPCMAKE_CROSSGCCOPT=-m32
+endif
+endif
+endif
+endif
+endif
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc $(FPCMAKE_CROSSGCCOPT) -print-libgcc-file-name`)
+endif
+endif
+ifndef FPCMAKEGCCLIBDIR
+FPCMAKEGCCLIBDIR:=$(shell dirname `gcc -print-libgcc-file-name`)
+endif
+ifndef GCCLIBDIR
+CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(CROSSGCC),)
+GCCLIBDIR:=$(shell dirname `$(CROSSGCC) $(CROSSGCCOPT) -print-libgcc-file-name`)
+endif
+endif
+endif
+ifdef inUnix
+ifeq ($(OS_SOURCE),netbsd)
+OTHERLIBDIR:=/usr/pkg/lib
+endif
+export GCCLIBDIR FPCMAKEGCCLIBDIR OTHERLIBDIR
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+LTOEXT=.bc
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+EXEDBGEXT=.dbg
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=wat
+IMPORTLIBPREFIX=
+endif
+ifneq ($(CPU_TARGET),jvm)
+ifeq ($(OS_TARGET),android)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),dragonfly)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=df
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),emx)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=emx
+ECHO=echo
+IMPORTLIBPREFIX=
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),aros)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=aros
+endif
+ifeq ($(OS_TARGET),morphos)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=mos
+endif
+ifeq ($(OS_TARGET),atari)
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),haiku)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=hai
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nw
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),netwlibc)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nwl
+IMPORTLIBPREFIX=imp
+endif
+ifeq ($(OS_TARGET),macosclassic)
+BATCHEXT=
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+IMPORTLIBPREFIX=imp
+endif
+ifneq ($(findstring $(OS_TARGET),darwin iphonesim ios),)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=dwn
+EXEDBGEXT=.dSYM
+endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+ifeq ($(OS_TARGET),NativeNT)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=nativent
+endif
+ifeq ($(OS_TARGET),wii)
+EXEEXT=.dol
+SHAREDLIBEXT=.so
+SHORTSUFFIX=wii
+endif
+ifeq ($(OS_TARGET),aix)
+BATCHEXT=.sh
+EXEEXT=
+SHAREDLIBEXT=.a
+SHORTSUFFIX=aix
+endif
+ifeq ($(OS_TARGET),java)
+OEXT=.class
+ASMEXT=.j
+SHAREDLIBEXT=.jar
+SHORTSUFFIX=java
+endif
+ifeq ($(CPU_TARGET),jvm)
+ifeq ($(OS_TARGET),android)
+OEXT=.class
+ASMEXT=.j
+SHAREDLIBEXT=.jar
+SHORTSUFFIX=android
+endif
+endif
+ifeq ($(OS_TARGET),msdos)
+STATICLIBPREFIX=
+STATICLIBEXT=.a
+SHORTSUFFIX=d16
+endif
+ifeq ($(OS_TARGET),msxdos)
+STATICLIBPREFIX=
+STATICLIBEXT=.a
+SHORTSUFFIX=msd
+endif
+ifeq ($(OS_TARGET),embedded)
+ifeq ($(CPU_TARGET),i8086)
+STATICLIBPREFIX=
+STATICLIBEXT=.a
+else
+EXEEXT=.bin
+endif
+ifeq ($(CPU_TARGET),z80)
+OEXT=.rel
+endif
+SHORTSUFFIX=emb
+endif
+ifeq ($(OS_TARGET),win16)
+STATICLIBPREFIX=
+STATICLIBEXT=.a
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w16
+endif
+ifeq ($(OS_TARGET),zxspectrum)
+OEXT=.rel
+endif
+ifeq ($(OS_TARGET),wasi)
+EXEEXT=.wasm
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+FPCMADE=fpcmade.$(SHORTSUFFIX)
+ZIPSUFFIX=$(SHORTSUFFIX)
+ZIPCROSSPREFIX=
+ZIPSOURCESUFFIX=src
+ZIPEXAMPLESUFFIX=exm
+else
+FPCMADE=fpcmade.$(TARGETSUFFIX)
+ZIPSOURCESUFFIX=.source
+ZIPEXAMPLESUFFIX=.examples
+ifdef CROSSCOMPILE
+ZIPSUFFIX=.$(SOURCESUFFIX)
+ZIPCROSSPREFIX=$(TARGETSUFFIX)-
+else
+ZIPSUFFIX=.$(TARGETSUFFIX)
+ZIPCROSSPREFIX=
+endif
+endif
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO= __missing_command_ECHO
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE= __missing_command_DATE
+else
+DATE:=$(firstword $(DATE))
+endif
+else
+DATE:=$(firstword $(DATE))
+endif
+endif
+export DATE
+ifndef GINSTALL
+GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL= __missing_command_GINSTALL
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+endif
+export GINSTALL
+ifndef CPPROG
+CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(CPPROG),)
+CPPROG= __missing_command_CPPROG
+else
+CPPROG:=$(firstword $(CPPROG))
+endif
+endif
+export CPPROG
+ifndef RMPROG
+RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(RMPROG),)
+RMPROG= __missing_command_RMPROG
+else
+RMPROG:=$(firstword $(RMPROG))
+endif
+endif
+export RMPROG
+ifndef MVPROG
+MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MVPROG),)
+MVPROG= __missing_command_MVPROG
+else
+MVPROG:=$(firstword $(MVPROG))
+endif
+endif
+export MVPROG
+ifndef MKDIRPROG
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG= __missing_command_MKDIRPROG
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+endif
+export MKDIRPROG
+ifndef ECHOREDIR
+ifndef inUnix
+ECHOREDIR=echo
+else
+ECHOREDIR=$(ECHO)
+endif
+endif
+ifndef COPY
+COPY:=$(CPPROG) -fp
+endif
+ifndef COPYTREE
+COPYTREE:=$(CPPROG) -Rfp
+endif
+ifndef MKDIRTREE
+MKDIRTREE:=$(MKDIRPROG) -p
+endif
+ifndef MOVE
+MOVE:=$(MVPROG) -f
+endif
+ifndef DEL
+DEL:=$(RMPROG) -f
+endif
+ifndef DELTREE
+DELTREE:=$(RMPROG) -rf
+endif
+ifndef INSTALL
+ifdef inUnix
+INSTALL:=$(GINSTALL) -c -m 644
+else
+INSTALL:=$(COPY)
+endif
+endif
+ifndef INSTALLEXE
+ifdef inUnix
+INSTALLEXE:=$(GINSTALL) -c -m 755
+else
+INSTALLEXE:=$(COPY)
+endif
+endif
+ifndef MKDIR
+MKDIR:=$(GINSTALL) -m 755 -d
+endif
+export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE= __missing_command_PPUMOVE
+else
+PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+export PPUMOVE
+ifndef FPCMAKE
+FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(FPCMAKE),)
+FPCMAKE= __missing_command_FPCMAKE
+else
+FPCMAKE:=$(firstword $(FPCMAKE))
+endif
+endif
+export FPCMAKE
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG= __missing_command_ZIPPROG
+else
+ZIPPROG:=$(firstword $(ZIPPROG))
+endif
+endif
+export ZIPPROG
+ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG= __missing_command_TARPROG
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+endif
+export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+NASMNAME=$(BINUTILSPREFIX)nasm
+ifndef ASPROG
+ifdef CROSSBINDIR
+ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
+else
+ASPROG=$(ASNAME)
+endif
+endif
+ifndef LDPROG
+ifdef CROSSBINDIR
+LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
+else
+LDPROG=$(LDNAME)
+endif
+endif
+ifndef RCPROG
+ifdef CROSSBINDIR
+RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
+else
+RCPROG=$(RCNAME)
+endif
+endif
+ifndef ARPROG
+ifdef CROSSBINDIR
+ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
+else
+ARPROG=$(ARNAME)
+endif
+endif
+ifndef NASMPROG
+ifdef CROSSBINDIR
+NASMPROG=$(CROSSBINDIR)/$(NASMNAME)$(SRCEXEEXT)
+else
+NASMPROG=$(NASMNAME)
+endif
+endif
+AS=$(ASPROG)
+LD=$(LDPROG)
+RC=$(RCPROG)
+AR=$(ARPROG)
+NASM=$(NASMPROG)
+ifdef inUnix
+PPAS=./ppas$(SRCBATCHEXT)
+else
+PPAS=ppas$(SRCBATCHEXT)
+endif
+ifdef inUnix
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+ZIPOPT=-9
+ZIPEXT=.zip
+ifeq ($(USETAR),bz2)
+TAROPT=vj
+TAREXT=.tar.bz2
+else
+TAROPT=vz
+TAREXT=.tar.gz
+endif
+override REQUIRE_PACKAGES=rtl
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-haiku)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-nativent)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-iphonesim)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-android)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-aros)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-macosclassic)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-sinclairql)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macosclassic)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-wii)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-aix)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-haiku)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-openbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-iphonesim)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-android)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-aros)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-dragonfly)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-android)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-aros)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-freertos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-ios)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-aix)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),avr-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),armeb-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),armeb-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),mips-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),mipsel-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),mipsel-android)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),mips64el-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),jvm-java)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),jvm-android)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i8086-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i8086-msdos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i8086-win16)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),aarch64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),aarch64-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),aarch64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),aarch64-win64)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),aarch64-android)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),aarch64-ios)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),wasm32-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),wasm32-wasi)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),riscv32-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),riscv32-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),riscv64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),riscv64-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),xtensa-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),xtensa-freertos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),z80-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),z80-zxspectrum)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),z80-msxdos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),z80-amstradcpc)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifdef REQUIRE_PACKAGES_RTL
+PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_RTL),)
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
+UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
+else
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+endif
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(SOURCESUFFIX)),)
+UNITDIR_FPMAKE_RTL=$(PACKAGEDIR_RTL)/units/$(SOURCESUFFIX)
+else
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units_bs/$(SOURCESUFFIX)),)
+UNITDIR_FPMAKE_RTL=$(PACKAGEDIR_RTL)/units_bs/$(SOURCESUFFIX)
+else
+UNITDIR_FPMAKE_RTL=$(PACKAGEDIR_RTL)
+endif
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_RTL)/$(OS_TARGET)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_RTL)/$(OS_TARGET) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(OS_TARGET)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_RTL=
+UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_RTL),)
+UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override COMPILER_UNITDIR+=$(UNITDIR_RTL)
+endif
+ifdef UNITDIR_FPMAKE_RTL
+override COMPILER_FPMAKE_UNITDIR+=$(UNITDIR_FPMAKE_RTL)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(ARCH)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(ARCH)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+override FPCMAKEOPT+=-FD$(NEW_BINUTILS_PATH)
+override FPMAKE_BUILD_OPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX)
+ifneq ($(RLINKPATH),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+endif
+ifndef CROSSCOMPILE
+ifneq ($(BINUTILSPREFIX),)
+override FPCMAKEOPT+=-XP$(BINUTILSPREFIX)
+override FPMAKE_BUILD_OPT+=-XP$(BINUTILSPREFIX)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+FPCCPUOPT:=-O2
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef SYSROOTPATH
+override FPCOPT+=-XR$(SYSROOTPATH)
+else
+ifeq ($(OS_TARGET),$(OS_SOURCE))
+ifneq ($(findstring $(OS_TARGET),darwin),)
+ifneq ($(findstring $(CPU_TARGET),aarch64),)
+ifneq ($(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk),)
+override FPCOPT+=-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
+endif
+endif
+endif
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+endif
+ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
+ifneq ($(findstring $(CPU_TARGET),x86_64 mips mipsel riscv64),)
+override FPCOPT+=-Cg
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef GCCLIBDIR
+override FPCOPT+=-Fl$(GCCLIBDIR)
+ifdef FPCMAKEGCCLIBDIR
+override FPCMAKEOPT+=-Fl$(FPCMAKEGCCLIBDIR)
+else
+override FPCMAKEOPT+=-Fl$(GCCLIBDIR)
+endif
+endif
+ifdef OTHERLIBDIR
+override FPCOPT+=$(addprefix -Fl,$(OTHERLIBDIR))
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPMAKEBUILDOPT
+override FPMAKE_BUILD_OPT+=$(FPMAKEBUILDOPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(strip $(FPC) $(FPCOPT))
+ifneq (,$(findstring -sh ,$(COMPILER)))
+UseEXECPPAS=1
+endif
+ifneq (,$(findstring -s ,$(COMPILER)))
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+UseEXECPPAS=1
+endif
+endif
+ifneq ($(UseEXECPPAS),1)
+EXECPPAS=
+else
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
+EXECPPAS:=@$(PPAS)
+endif
+endif
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+ifneq ($(IMPORTLIBPREFIX)-$(STATICLIBEXT),$(STATICLIBPREFIX)-$(STATICLIBEXT))
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(subst $(PPUEXT),$(LTOEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+else
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(subst $(PPUEXT),$(LTOEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+endif
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILENAMES:=$(notdir $(INSTALLPPUFILES))
+override INSTALLPPULINKFILENAMES:=$(notdir $(INSTALLPPULINKFILES))
+override INSTALLPPUFILES=$(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPUFILENAMES))
+override INSTALLPPULINKFILES=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(INSTALLPPULINKFILENAMES)))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(EXAMPLEINSTALLTARGET) $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_distinstall
+fpc_distinstall: install exampleinstall
+.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
+ifndef PACKDIR
+ifndef inUnix
+PACKDIR=$(BASEDIR)/../fpc-pack
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+ifndef ZIPNAME
+ifdef DIST_ZIPNAME
+ZIPNAME=$(DIST_ZIPNAME)
+else
+ZIPNAME=$(PACKAGE_NAME)
+endif
+endif
+ifndef FULLZIPNAME
+FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
+endif
+ifndef ZIPTARGET
+ifdef DIST_ZIPTARGET
+ZIPTARGET=DIST_ZIPTARGET
+else
+ZIPTARGET=install
+endif
+endif
+ifndef USEZIP
+ifdef inUnix
+USETAR=1
+endif
+endif
+ifndef inUnix
+USEZIPWRAPPER=1
+endif
+ifdef USEZIPWRAPPER
+ZIPPATHSEP=$(PATHSEP)
+ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
+else
+ZIPPATHSEP=/
+endif
+ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
+ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
+ifdef USETAR
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
+ZIPCMD_ZIP:=$(TARPROG) c$(TAROPT)f $(ZIPDESTFILE) *
+else
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
+ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
+endif
+fpc_zipinstall:
+	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
+	$(MKDIR) $(DIST_DESTDIR)
+	$(DEL) $(ZIPDESTFILE)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
+else
+	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
+	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
+	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
+endif
+ifdef inUnix
+	/bin/sh $(ZIPWRAPPER)
+else
+ifdef RUNBATCH
+	$(RUNBATCH) $(ZIPWRAPPER)
+else
+	$(ZIPWRAPPER)
+endif
+endif
+	$(DEL) $(ZIPWRAPPER)
+else
+	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
+endif
+	$(DELTREE) $(PACKDIR)
+fpc_zipsourceinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
+fpc_zipexampleinstall:
+ifdef HASEXAMPLES
+	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
+endif
+fpc_zipdistinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+override CLEANEXEDBGFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEDBGFILES))
+endif
+ifdef CLEAN_PROGRAMS
+override CLEANEXEFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEEXT), $(CLEAN_PROGRAMS)))
+override CLEANEXEDBGFILES+=$(addprefix $(TARGETDIRPREFIX),$(addsuffix $(EXEDBGEXT), $(CLEAN_PROGRAMS)))
+endif
+ifdef CLEAN_UNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
+endif
+ifdef CLEANPPUFILES
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(subst $(PPUEXT),$(LTOEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILENAMES:=$(CLEANPPUFILES)
+override CLEANPPUFILES=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILENAMES))
+override CLEANPPULINKFILENAMES:=$(CLEANPPULINKFILES)
+override CLEANPPULINKFILES=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILENAMES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANEXEDBGFILES
+	-$(DELTREE) $(CLEANEXEDBGFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+	-$(DEL) $(FPCMADE) *$(FULL_TARGET).fpm Package.fpc *$(ASMEXT)
+	-$(DEL) $(FPCEXTFILE) $(REDIRFILE) script*.res link*.res *_script.res *_link.res
+	-$(DEL) $(PPAS) *_ppas$(BATCHEXT) ppas$(BATCHEXT) ppaslink$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+	-$(DELTREE) units
+	-$(DELTREE) bin
+	-$(DEL) *$(OEXT) *$(LTOEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+	-$(DEL) *.o *.ppu *.a
+endif
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) fpcmade.* Package.fpc *.fpm
+	-$(DEL) $(FPCEXTFILE) $(REDIRFILE) script*.res link*.res *_script.res *_link.res
+	-$(DEL) $(PPAS) *_ppas$(BATCHEXT) ppas$(BATCHEXT) ppaslink$(BATCHEXT)
+ifdef AOUTEXT
+	-$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+	-$(DEL) *$(DEBUGSYMEXT)
+endif
+ifdef LOCALFPMAKEBIN
+	-$(DEL) $(LOCALFPMAKEBIN)
+	-$(DEL) $(FPMAKEBINOBJ)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+	@$(ECHO)
+	@$(ECHO)  == Package info ==
+	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
+	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC.......... $(FPC)
+	@$(ECHO)  FPC Version.. $(FPC_VERSION)
+	@$(ECHO)  Source CPU... $(CPU_SOURCE)
+	@$(ECHO)  Target CPU... $(CPU_TARGET)
+	@$(ECHO)  Source OS.... $(OS_SOURCE)
+	@$(ECHO)  Target OS.... $(OS_TARGET)
+	@$(ECHO)  Full Source.. $(FULL_SOURCE)
+	@$(ECHO)  Full Target.. $(FULL_TARGET)
+	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
+	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
+	@$(ECHO)  FPC fpmake... $(FPCFPMAKE)
+	@$(ECHO)
+	@$(ECHO)  == Directory info ==
+	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
+	@$(ECHO)  Basedir......... $(BASEDIR)
+	@$(ECHO)  FPCDir.......... $(FPCDIR)
+	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
+	@$(ECHO)  UnitsDir........ $(UNITSDIR)
+	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
+	@$(ECHO)
+	@$(ECHO)  GCC library..... $(GCCLIBDIR)
+	@$(ECHO)  Other library... $(OTHERLIBDIR)
+	@$(ECHO)
+	@$(ECHO)  == Tools info ==
+	@$(ECHO)
+	@$(ECHO)  As........ $(AS)
+	@$(ECHO)  Ld........ $(LD)
+	@$(ECHO)  Ar........ $(AR)
+	@$(ECHO)  Rc........ $(RC)
+	@$(ECHO)
+	@$(ECHO)  Mv........ $(MVPROG)
+	@$(ECHO)  Cp........ $(CPPROG)
+	@$(ECHO)  Rm........ $(RMPROG)
+	@$(ECHO)  GInstall.. $(GINSTALL)
+	@$(ECHO)  Echo...... $(ECHO)
+	@$(ECHO)  Shell..... $(SHELL)
+	@$(ECHO)  Date...... $(DATE)
+	@$(ECHO)  FPCMake... $(FPCMAKE)
+	@$(ECHO)  PPUMove... $(PPUMOVE)
+	@$(ECHO)  Zip....... $(ZIPPROG)
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)
+	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
+	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
+	@$(ECHO)
+	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
+	@$(ECHO)  Install Files....... $(INSTALL_FILES)
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+	@$(ECHO)  DateStr.............. $(DATESTR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
+	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
+	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
+	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
+	@$(ECHO)
+	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
+	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
+	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
+	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
+	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
+	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
+	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
+	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
+	@$(ECHO)
+	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
+	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
+	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+units:
+examples:
+shared:
+sourceinstall: fpc_sourceinstall
+exampleinstall: fpc_exampleinstall
+zipexampleinstall: fpc_zipexampleinstall
+info: fpc_info
+makefiles: fpc_makefiles
+.PHONY: units examples shared sourceinstall exampleinstall zipexampleinstall info makefiles
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+override FPCOPT:=$(filter-out -FU%,$(FPCOPT))
+override FPCOPT:=$(filter-out -FE%,$(FPCOPT))
+override FPCOPT:=$(filter-out $(addprefix -Fu,$(COMPILER_UNITDIR)),$(FPCOPT))# Compose general fpmake-parameters
+ifdef FPMAKEOPT
+FPMAKE_OPT+=$(FPMAKEOPT)
+endif
+FPMAKE_OPT+=--localunitdir=../..
+FPMAKE_OPT+=--globalunitdir=..
+FPMAKE_OPT+=$(FPC_TARGETOPT)
+FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT))
+FPMAKE_OPT+=--compiler=$(FPC)
+FPMAKE_OPT+=-bu
+.NOTPARALLEL:
+fpmake$(SRCEXEEXT): fpmake.pp
+	$(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT)
+all:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) compile $(FPMAKE_OPT)
+smart:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX
+release:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE
+debug:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG
+ifeq ($(FPMAKE_BIN_CLEAN),)
+clean:
+else
+clean:
+	$(FPMAKE_BIN_CLEAN) clean $(FPMAKE_OPT)
+endif
+ifeq ($(FPMAKE_BIN_CLEAN),)
+distclean:	$(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
+else
+distclean:
+ifdef inUnix
+	{ $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT); if [ $$? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; $(DEL) $(FPMAKE_BIN_CLEAN); $(MAKE) fpc_cleanall; }; fi;  }
+else
+	$(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT)
+endif
+	-$(DEL) $(LOCALFPMAKE)
+endif
+cleanall: distclean
+install:	fpmake$(SRCEXEEXT)
+ifdef UNIXHier
+	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR)
+else
+	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
+endif
+distinstall:	fpmake$(SRCEXEEXT)
+ifdef UNIXHier
+	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0
+else
+	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0
+endif
+zipinstall:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX)
+zipdistinstall:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie -fsp 0
+zipsourceinstall:	fpmake$(SRCEXEEXT)
+ifdef UNIXHier
+	$(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=share/src/fpc-\$$\(PACKAGEVERSION\)/$(INSTALL_FPCSUBDIR)/\$$\(PACKAGEDIRECTORY\)
+else
+	$(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=source\\$(INSTALL_FPCSUBDIR)\\\$$\(PACKAGEDIRECTORY\)
+endif

+ 102 - 0
packages/wasmtime/Makefile.fpc

@@ -0,0 +1,102 @@
+#
+#   Makefile.fpc for running fpmake
+#
+
+[package]
+name=wasmtime
+version=3.3.1
+
+[require]
+packages=rtl 
+
+[install]
+fpcpackage=y
+
+[default]
+fpcdir=../..
+
+[prerules]
+FPMAKE_BIN_CLEAN=$(wildcard ./fpmake$(SRCEXEEXT))
+ifdef OS_TARGET
+FPC_TARGETOPT+=--os=$(OS_TARGET)
+endif
+ifdef CPU_TARGET
+FPC_TARGETOPT+=--cpu=$(CPU_TARGET)
+endif
+LOCALFPMAKE=./fpmake$(SRCEXEEXT)
+
+[rules]
+# Do not pass the Makefile's unit and binary target locations. Fpmake uses it's own.
+override FPCOPT:=$(filter-out -FU%,$(FPCOPT))
+override FPCOPT:=$(filter-out -FE%,$(FPCOPT))
+# Do not pass the package-unitdirectories. Fpmake adds those and this way they don't apear in the .fpm
+override FPCOPT:=$(filter-out $(addprefix -Fu,$(COMPILER_UNITDIR)),$(FPCOPT))# Compose general fpmake-parameters
+# Compose general fpmake-parameters
+ifdef FPMAKEOPT
+FPMAKE_OPT+=$(FPMAKEOPT)
+endif
+FPMAKE_OPT+=--localunitdir=../..
+FPMAKE_OPT+=--globalunitdir=..
+FPMAKE_OPT+=$(FPC_TARGETOPT)
+FPMAKE_OPT+=$(addprefix -o ,$(FPCOPT))
+FPMAKE_OPT+=--compiler=$(FPC)
+FPMAKE_OPT+=-bu
+.NOTPARALLEL:
+
+fpmake$(SRCEXEEXT): fpmake.pp
+	$(FPCFPMAKE) fpmake.pp $(FPMAKE_SKIP_CONFIG) $(addprefix -Fu,$(COMPILER_FPMAKE_UNITDIR)) $(FPCMAKEOPT) $(OPT)
+all:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) compile $(FPMAKE_OPT)
+smart:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -XX -o -CX
+release:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dRELEASE
+debug:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) compile $(FPMAKE_OPT) -o -dDEBUG
+# If no fpmake exists and (dist)clean is called, do not try to build fpmake, it will
+# most often fail because the dependencies are cleared.
+# In case of a clean, simply do nothing
+ifeq ($(FPMAKE_BIN_CLEAN),)
+clean:
+else
+clean:
+	$(FPMAKE_BIN_CLEAN) clean $(FPMAKE_OPT)
+endif
+# In case of a distclean, perform an 'old'-style distclean. This to avoid problems
+# when the package is compiled using fpcmake prior to running this clean using fpmake
+ifeq ($(FPMAKE_BIN_CLEAN),)
+distclean:	$(addsuffix _distclean,$(TARGET_DIRS)) fpc_cleanall
+else
+distclean:
+ifdef inUnix
+        { $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT); if [ $$? != "0" ]; then { echo Something wrong with fpmake exectable. Remove the executable and call make recursively to recover.; $(DEL) $(FPMAKE_BIN_CLEAN); $(MAKE) fpc_cleanall; }; fi;  }
+else
+        $(FPMAKE_BIN_CLEAN) distclean $(FPMAKE_OPT)
+endif
+	-$(DEL) $(LOCALFPMAKE)
+endif
+cleanall: distclean
+install:	fpmake$(SRCEXEEXT)
+ifdef UNIXHier
+	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR)
+else
+	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR)
+endif
+# distinstall also installs the example-sources and omits the location of the source-
+# files from the fpunits.cfg files.
+distinstall:	fpmake$(SRCEXEEXT)
+ifdef UNIXHier
+	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_PREFIX) --baseinstalldir=$(INSTALL_LIBDIR)/fpc/$(FPC_VERSION) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0
+else
+	$(LOCALFPMAKE) install $(FPMAKE_OPT) --prefix=$(INSTALL_BASEDIR) --baseinstalldir=$(INSTALL_BASEDIR) --unitinstalldir=$(INSTALL_UNITDIR) -ie -fsp 0
+endif
+zipinstall:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX)
+zipdistinstall:	fpmake$(SRCEXEEXT)
+	$(LOCALFPMAKE) zipinstall $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) -ie -fsp 0
+zipsourceinstall:	fpmake$(SRCEXEEXT)
+ifdef UNIXHier
+	$(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=share/src/fpc-\$$\(PACKAGEVERSION\)/$(INSTALL_FPCSUBDIR)/\$$\(PACKAGEDIRECTORY\)
+else
+	$(LOCALFPMAKE) archive $(FPMAKE_OPT) --zipprefix=$(DIST_DESTDIR)/$(ZIPPREFIX) --prefix=source\\$(INSTALL_FPCSUBDIR)\\\$$\(PACKAGEDIRECTORY\)
+endif

+ 58 - 0
packages/wasmtime/examples/gcd.lpi

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <General>
+      <Flags>
+        <MainUnitHasCreateFormStatements Value="False"/>
+        <MainUnitHasTitleStatement Value="False"/>
+        <MainUnitHasScaledStatement Value="False"/>
+        <UseDefaultCompilerOptions Value="True"/>
+      </Flags>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="gcd"/>
+      <UseAppBundle Value="False"/>
+      <ResourceType Value="res"/>
+    </General>
+    <BuildModes>
+      <Item Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+    </RunParams>
+    <Units>
+      <Unit>
+        <Filename Value="gcd.pp"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="gcd"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="../src"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions>
+      <Item>
+        <Name Value="EAbort"/>
+      </Item>
+      <Item>
+        <Name Value="ECodetoolError"/>
+      </Item>
+      <Item>
+        <Name Value="EFOpenError"/>
+      </Item>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 108 - 0
packages/wasmtime/examples/gcd.pp

@@ -0,0 +1,108 @@
+program gcd;
+
+uses sysutils, classes,ctypes, wasmtime;
+
+procedure exit_with_error(message : Pchar; error : Pwasmtime_error_t; trap: Pwasm_trap_t); cdecl;
+
+var
+  error_message : Twasm_byte_vec_t ;
+  S : AnsiString;
+begin
+  Writeln(stderr, 'error: ', message);
+
+  if (error <> Nil)  then
+    begin
+    wasmtime_error_message(error, @error_message);
+    wasmtime_error_delete(error)
+    end
+  else
+    begin
+    wasm_trap_message(trap, @error_message);
+    wasm_trap_delete(trap);
+    end;
+  SetLength(S,error_message.size);
+  Move(error_message.data^,S[1],error_message.size);
+  Writeln(stderr, S);
+  wasm_byte_vec_delete(@error_message);
+  halt(1);
+end;
+
+Var
+  engine : Pwasm_engine_t = Nil;
+  store : Pwasmtime_store_t = Nil;
+  context : Pwasmtime_context_t = Nil;
+  F : TMemoryStream;
+  wat : Twasm_byte_vec_t;
+  wasm : twasm_byte_vec_t;
+  module : Pwasmtime_module_t = Nil;
+  error : Pwasmtime_error_t = Nil;
+  trap : Pwasm_trap_t = Nil;
+  instance : Twasmtime_instance_t;
+  gcd_func : Twasmtime_extern_t;
+  ok : Byte;
+
+  a : longint = 6;
+  b : longint = 27;
+  params : Array [0..1] of twasmtime_val_t;
+  results : array [0..0] of twasmtime_val_t;
+
+
+begin
+  Writeln('Loading wasm library');
+  Loadwasmtime('./'+libwasmtime);
+  Writeln('Initializing...');
+  gcd_func:=Default(Twasmtime_extern_t);
+  engine := wasm_engine_new();
+  store:=wasmtime_store_new(engine, nil,nil);
+  context:=wasmtime_store_context(store);
+  F:=TMemoryStream.Create;
+  try
+    F.LoadFromFile('gcd.wat');
+    wasm_byte_vec_new_uninitialized(@wat, F.Size);
+    Move(F.Memory^,wat.data^,F.Size);
+  finally
+    F.Free;
+  end;
+  error:=wasmtime_wat2wasm(pcchar(wat.data), wat.size, @wasm);
+  if (error<>Nil) then
+    exit_with_error('failed to parse wat', error, Nil);
+  wasm_byte_vec_delete(@wat);
+
+  Writeln('Compiling module...');
+
+  error:=wasmtime_module_new(engine, Puint8_t(wasm.data), wasm.size, @module);
+  wasm_byte_vec_delete(@wasm);
+  if (error <> nil) then
+    exit_with_error('failed to compile module', error, nil);
+
+  Writeln('Instantiating module...');
+  error:=wasmtime_instance_new(context, module, nil, 0, @instance, @trap);
+  if (error<>nil) or (trap <>Nil) then
+    exit_with_error('failed to instantiate', error, trap);
+
+  Writeln('Extracting export...');
+  ok:=wasmtime_instance_export_get(context, @instance, PChar('gcd'), 3, @gcd_func) ;
+  if OK=0 then
+    exit_with_error('failed to get gcd export', nil, nil);
+  if gcd_func.kind<>WASMTIME_EXTERN_FUNC then
+    exit_with_error('gcd is not a function', nil, nil);
+
+
+  Writeln('Calling export...');
+  params[0].kind:=WASMTIME_I32;
+  params[0].of_.i32:=a;
+  params[1].kind:=WASMTIME_I32;
+  params[1].of_.i32:= b;
+
+  error:=wasmtime_func_call(context, @gcd_func.of_.func, @params, 2, @results, 1, @trap);
+  if (error<>nil) or (trap<>nil) then
+    exit_with_error('failed to call function', error, trap);
+
+  writeln(Format('gcd(%d, %d) = %d',[ a, b, results[0].of_.i32]));
+  // Clean up after ourselves at this point
+  Writeln('All finished!');
+  wasmtime_module_delete(module);
+  wasmtime_store_delete(store);
+  wasm_engine_delete(engine);
+end.
+

+ 27 - 0
packages/wasmtime/examples/gcd.wat

@@ -0,0 +1,27 @@
+(module
+  (func $gcd (param i32 i32) (result i32)
+    (local i32)
+    block  ;; label = @1
+      block  ;; label = @2
+        local.get 0
+        br_if 0 (;@2;)
+        local.get 1
+        local.set 2
+        br 1 (;@1;)
+      end
+      loop  ;; label = @2
+        local.get 1
+        local.get 0
+        local.tee 2
+        i32.rem_u
+        local.set 0
+        local.get 2
+        local.set 1
+        local.get 0
+        br_if 0 (;@2;)
+      end
+    end
+    local.get 2
+  )
+  (export "gcd" (func $gcd))
+)

+ 4 - 0
packages/wasmtime/examples/hello.wat

@@ -0,0 +1,4 @@
+(module
+  (func $hello (import "" "hello"))
+  (func (export "run") (call $hello))
+)

+ 61 - 0
packages/wasmtime/examples/helloworld.lpi

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <General>
+      <Flags>
+        <MainUnitHasCreateFormStatements Value="False"/>
+        <MainUnitHasTitleStatement Value="False"/>
+        <MainUnitHasScaledStatement Value="False"/>
+      </Flags>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="helloworld"/>
+      <UseAppBundle Value="False"/>
+      <ResourceType Value="res"/>
+    </General>
+    <BuildModes>
+      <Item Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+    </RunParams>
+    <Units>
+      <Unit>
+        <Filename Value="helloworld.pp"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+      <Unit>
+        <Filename Value="../src/wasmtime.pp"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="helloworld"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="../src"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions>
+      <Item>
+        <Name Value="EAbort"/>
+      </Item>
+      <Item>
+        <Name Value="ECodetoolError"/>
+      </Item>
+      <Item>
+        <Name Value="EFOpenError"/>
+      </Item>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 111 - 0
packages/wasmtime/examples/helloworld.pp

@@ -0,0 +1,111 @@
+program helloworld;
+
+uses classes,ctypes, wasmtime;
+
+procedure exit_with_error(message : Pchar; error : Pwasmtime_error_t; trap: Pwasm_trap_t); cdecl;
+
+var
+  error_message : Twasm_byte_vec_t ;
+  S : AnsiString;
+
+begin
+  Writeln(stderr, 'error: ', message);
+  S:='';
+  if (error <> Nil)  then
+    begin
+    wasmtime_error_message(error, @error_message);
+    wasmtime_error_delete(error)
+    end
+  else
+    begin
+    wasm_trap_message(trap, @error_message);
+    wasm_trap_delete(trap);
+    end;
+  SetLength(S,error_message.size);
+  Move(error_message.data^,S[1],error_message.size);
+  Writeln(stderr, S);
+  wasm_byte_vec_delete(@error_message);
+  halt(1);
+end;
+
+function hello_callback(env : Pointer; caller : Pwasmtime_caller_t; args : pwasmtime_val_t; nargs : size_t; results : pwasmtime_val_t; nresults : size_t) : pwasm_trap_t; cdecl;
+begin
+  Writeln('Calling back...');
+  Writeln(' Hello World!');
+  Result:=Nil;
+end;
+
+Var
+  engine : Pwasm_engine_t = Nil;
+  store : Pwasmtime_store_t = Nil;
+  context : Pwasmtime_context_t = Nil;
+  F : TMemoryStream;
+  wat : Twasm_byte_vec_t;
+  wasm : twasm_byte_vec_t;
+  module : Pwasmtime_module_t = Nil;
+  error : Pwasmtime_error_t = Nil;
+  hello_ty : Pwasm_functype_t = nil;
+  hello : Twasmtime_func_t;
+  trap : Pwasm_trap_t = Nil;
+  instance : Twasmtime_instance_t;
+  import : Twasmtime_extern_t;
+  run : Twasmtime_extern_t;
+  ok : Byte;
+
+begin
+  Writeln('Loading wasm library');
+  Loadwasmtime('./'+libwasmtime);
+  Writeln('Initializing...');
+  engine := wasm_engine_new();
+  store:=wasmtime_store_new(engine, nil,nil);
+  context:=wasmtime_store_context(store);
+  F:=TMemoryStream.Create;
+  try
+    F.LoadFromFile('hello.wat');
+    wasm_byte_vec_new_uninitialized(@wat, F.Size);
+    Move(F.Memory^,wat.data^,F.Size);
+  finally
+    F.Free;
+  end;
+
+  error:=wasmtime_wat2wasm(pcchar(wat.data), wat.size, @wasm);
+  if (error<>Nil) then
+    exit_with_error('failed to parse wat', error, Nil);
+  wasm_byte_vec_delete(@wat);
+
+  Writeln('Compiling module...\n');
+
+  error:=wasmtime_module_new(engine, Puint8_t(wasm.data), wasm.size, @module);
+  wasm_byte_vec_delete(@wasm);
+  if (error <> nil) then
+    exit_with_error('failed to compile module', error, nil);
+
+  Writeln('Creating callback...\n');
+  hello_ty:=wasm_functype_new_0_0();
+  wasmtime_func_new(context, hello_ty, @hello_callback, Nil, Nil, @hello);
+
+  Writeln('Instantiating module...');
+  import.kind:=WASMTIME_EXTERN_FUNC;
+  import.of_.func:=hello;
+  error:=wasmtime_instance_new(context, module, @import, 1, @instance, @trap);
+  if (error<>nil) or (trap <>Nil) then
+    exit_with_error('failed to instantiate', error, trap);
+
+  Writeln('Extracting export...\n');
+  ok:=wasmtime_instance_export_get(context, @instance, PChar('run'), 3, @run) ;
+  if OK=0 then
+    exit_with_error('failed to get run export', nil, nil);
+  if run.kind<>WASMTIME_EXTERN_FUNC then
+    exit_with_error('run is not a function', nil, nil);
+
+  Writeln('Calling export...');
+  error:=wasmtime_func_call(context, @run.of_.func, nil, 0, nil, 0, @trap);
+  if (error<>nil) or (trap<>nil) then
+    exit_with_error('failed to call function', error, trap);
+
+  Writeln('All finished!\n');
+  wasmtime_module_delete(module);
+  wasmtime_store_delete(store);
+  wasm_engine_delete(engine);
+end.
+

BIN
packages/wasmtime/examples/helloworld.wasm


+ 58 - 0
packages/wasmtime/examples/memory.lpi

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <General>
+      <Flags>
+        <MainUnitHasCreateFormStatements Value="False"/>
+        <MainUnitHasTitleStatement Value="False"/>
+        <MainUnitHasScaledStatement Value="False"/>
+        <UseDefaultCompilerOptions Value="True"/>
+      </Flags>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="memory"/>
+      <UseAppBundle Value="False"/>
+      <ResourceType Value="res"/>
+    </General>
+    <BuildModes>
+      <Item Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+    </RunParams>
+    <Units>
+      <Unit>
+        <Filename Value="memory.pp"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="memory"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="../src"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions>
+      <Item>
+        <Name Value="EAbort"/>
+      </Item>
+      <Item>
+        <Name Value="ECodetoolError"/>
+      </Item>
+      <Item>
+        <Name Value="EFOpenError"/>
+      </Item>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 289 - 0
packages/wasmtime/examples/memory.pp

@@ -0,0 +1,289 @@
+program memory;
+
+uses classes,ctypes, wasmtime;
+
+procedure exit_with_error(message : string; error : Pwasmtime_error_t; trap: Pwasm_trap_t); cdecl;
+
+var
+  error_message : Twasm_byte_vec_t ;
+  S : AnsiString;
+
+begin
+  Writeln(stderr, 'error: ', message);
+  S:='';
+  if (error <> Nil)  then
+    begin
+    wasmtime_error_message(error, @error_message);
+    wasmtime_error_delete(error)
+    end
+  else
+    begin
+    wasm_trap_message(trap, @error_message);
+    wasm_trap_delete(trap);
+    end;
+  SetLength(S,error_message.size);
+  Move(error_message.data^,S[1],error_message.size);
+  Writeln(stderr, S);
+  wasm_byte_vec_delete(@error_message);
+  halt(1);
+end;
+
+procedure check(success : boolean);
+begin
+  if (not success) then
+    begin
+    Writeln('> Error, expected success');
+    Halt(1);
+    end;
+end;
+
+procedure check_call(store : pwasmtime_context_t;
+                func : Pwasmtime_func_t;
+                args : Pwasmtime_val_t;
+                nargs : Tsize_t;
+                expected : tint32_t);
+Var
+  results : Array[0..0] of twasmtime_val_t;
+  trap : Pwasm_trap_t;
+  error : Pwasmtime_error_t;
+begin
+  trap:=nil;
+  error:=wasmtime_func_call(store, func, args, nargs, results, 1, @trap);
+  if (error<>nil) or (trap<>nil) then
+    exit_with_error('failed to call function', error, trap);
+  if (results[0].of_.i32 <> expected) then
+    begin
+    writeln('> Error on result');
+    halt(1);
+    end;
+end;
+
+procedure check_trap(store : pwasmtime_context_t;
+                func : Pwasmtime_func_t;
+                args : Pwasmtime_val_t;
+                nargs : Tsize_t;
+                num_results : size_t);
+var
+  results : array [0..0] of twasmtime_val_t ;
+  trap : Pwasm_trap_t;
+  error : Pwasmtime_error_t;
+begin
+  assert(num_results <= 1);
+  trap:=nil;;
+  error:=wasmtime_func_call(store, func, args, nargs, results, num_results, @trap);
+  if (error<>Nil) then
+    exit_with_error('failed to call function', error, nil);
+  if (trap = Nil) then
+    begin
+    Writeln('> Error on result, expected trap');
+    halt(1);
+    end;
+  wasm_trap_delete(trap);
+end;
+
+
+procedure check_call0(store : Pwasmtime_context_t; func : Pwasmtime_func_t; expected : Tint32_t );
+
+begin
+  check_call(store, func, nil, 0, expected);
+end;
+
+procedure check_call1(store : Pwasmtime_context_t; func : Pwasmtime_func_t; arg : tint32_t; expected: tint32_t);
+var
+  args : array[0..0] of twasmtime_val_t;
+begin
+  args[0].kind:=WASMTIME_I32;
+  args[0].of_.i32:=arg;
+  check_call(store, func, @args, 1, expected);
+end;
+
+
+procedure check_ok(store : Pwasmtime_context_t; func : Pwasmtime_func_t; args : Pwasmtime_val_t;nargs: tsize_t);
+
+var
+  trap : Pwasm_trap_t;
+  error : Pwasmtime_error_t;
+
+begin
+  trap:=nil;
+  error:=wasmtime_func_call(store, func, args, nargs, nil, 0, @trap);
+  if ((error<>nil) or (trap <> nil)) then
+    exit_with_error('failed to call function', error, trap);
+end;
+
+procedure check_ok2(store : Pwasmtime_context_t; func : Pwasmtime_func_t; arg1,arg2 : tint32_t) ;
+var
+  args : array[0..1] of twasmtime_val_t;
+begin
+  args[0].kind:=WASMTIME_I32;
+  args[0].of_.i32:=arg1;
+  args[1].kind:=WASMTIME_I32;
+  args[1].of_.i32:=arg2;
+  check_ok(store, func, args, 2);
+end;
+
+procedure check_trap1(store : Pwasmtime_context_t; func : Pwasmtime_func_t; arg : tint32_t);
+
+var
+  args : array[0..0] of twasmtime_val_t;
+begin
+  args[0].kind := WASMTIME_I32;
+  args[0].of_.i32 := arg;
+  check_trap(store, func, args, 1, 1);
+end;
+
+procedure check_trap2(store : Pwasmtime_context_t; func : Pwasmtime_func_t; arg1,arg2 : tint32_t);
+
+var
+  args : array[0..1] of twasmtime_val_t;
+begin
+  args[0].kind:=WASMTIME_I32;
+  args[0].of_.i32:=arg1;
+  args[1].kind:=WASMTIME_I32;
+  args[1].of_.i32:=arg2;
+  check_trap(store, func, args, 2, 0);
+end;
+
+
+
+
+Function GetFunc(context : Pwasmtime_context_t; instance : Pwasmtime_instance_t; aName : string) : twasmtime_func_t;
+
+var
+  item : twasmtime_extern_t;
+  Ok : Byte;
+begin
+  ok:=wasmtime_instance_export_get(context, instance, PChar(aName), Length(aName), @item) ;
+  if OK=0 then
+    exit_with_error('failed to get '+aName+'export', nil, nil);
+  if item.kind<>WASMTIME_EXTERN_FUNC then
+    exit_with_error(aName+' is not a function', nil, nil);
+  Result:=item.of_.func;
+end;
+
+Var
+  engine : Pwasm_engine_t = Nil;
+  store : Pwasmtime_store_t = Nil;
+  context : Pwasmtime_context_t = Nil;
+  F : TMemoryStream;
+  wat : Twasm_byte_vec_t;
+  wasm : twasm_byte_vec_t;
+  module : Pwasmtime_module_t = Nil;
+  error : Pwasmtime_error_t = Nil;
+  trap : Pwasm_trap_t = Nil;
+  instance : Twasmtime_instance_t;
+  ok : Byte;
+  mem,mem2 : twasmtime_memory_t ;
+  size_func, load_func, store_func : twasmtime_func_t;
+  item : twasmtime_extern_t;
+  old_size : Tuint32_t;
+  limits : twasm_limits_t;
+  memorytype : pwasm_memorytype_t;
+begin
+  Writeln('Loading wasm library');
+  Loadwasmtime('./'+libwasmtime);
+  Writeln('Initializing...');
+
+  engine := wasm_engine_new();
+  store:=wasmtime_store_new(engine, nil,nil);
+  context:=wasmtime_store_context(store);
+  F:=TMemoryStream.Create;
+  try
+    F.LoadFromFile('memory.wat');
+    wasm_byte_vec_new_uninitialized(@wat, F.Size);
+    Move(F.Memory^,wat.data^,F.Size);
+  finally
+    F.Free;
+  end;
+
+  error:=wasmtime_wat2wasm(pcchar(wat.data), wat.size, @wasm);
+  if (error<>Nil) then
+    exit_with_error('failed to parse wat', error, Nil);
+  wasm_byte_vec_delete(@wat);
+
+  Writeln('Compiling module...');
+
+  error:=wasmtime_module_new(engine, Puint8_t(wasm.data), wasm.size, @module);
+  wasm_byte_vec_delete(@wasm);
+  if (error <> nil) then
+    exit_with_error('failed to compile module', error, nil);
+
+  error:=wasmtime_instance_new(context, module, Nil, 0, @instance, @trap);
+  if (error<>nil) or (trap <>Nil) then
+    exit_with_error('failed to instantiate', error, trap);
+
+  Writeln('Extracting exports...');
+
+  ok:=wasmtime_instance_export_get(context, @instance, PChar('memory'), 6, @item) ;
+  if OK=0 then
+    exit_with_error('failed to get run export', nil, nil);
+  if item.kind<>WASMTIME_EXTERN_MEMORY then
+    exit_with_error('mem is not memory', nil, nil);
+  mem:=item.of_.memory;
+
+  size_func:=GetFunc(context,@instance,'size');
+  load_func:=GetFunc(context,@instance,'load');
+  store_func:=GetFunc(context,@instance,'store');
+
+  Writeln('Checking memory...');
+  check(wasmtime_memory_size(context, @mem) = 2);
+  check(wasmtime_memory_data_size(context, @mem) = $20000);
+  check(wasmtime_memory_data(context, @mem)[0] = 0);
+  check(wasmtime_memory_data(context, @mem)[$1000] = 1);
+  check(wasmtime_memory_data(context, @mem)[$1003] = 4);
+
+  check_call0(context, @size_func, 2);
+  check_call1(context, @load_func, 0, 0);
+  check_call1(context, @load_func, $1000, 1);
+  check_call1(context, @load_func, $1003, 4);
+  check_call1(context, @load_func, $1ffff, 0);
+  check_trap1(context, @load_func, $20000);
+
+  Writeln('Mutating memory...');
+  wasmtime_memory_data(context, @mem)[$1003]:=5;
+  check_ok2(context, @store_func, $1002, 6);
+  check_trap2(context, @store_func, $20000, 0);
+
+  check(wasmtime_memory_data(context, @mem)[$1002] = 6);
+  check(wasmtime_memory_data(context, @mem)[$1003] = 5);
+  check_call1(context, @load_func, $1002, 6);
+  check_call1(context, @load_func, $1003, 5);
+
+  writeln('Growing memory...');
+
+  error:=wasmtime_memory_grow(context, @mem, 1, @old_size);
+  if (error <> Nil) then
+    exit_with_error('failed to grow memory', error, nil);
+  check(wasmtime_memory_size(context, @mem) = 3);
+  check(wasmtime_memory_data_size(context, @mem) = $30000);
+
+  check_call1(context, @load_func, $20000, 0);
+  check_ok2(context, @store_func, $20000, 0);
+  check_trap1(context, @load_func, $30000);
+  check_trap2(context, @store_func, $30000, 0);
+
+  // We expect an error here !
+  error:=wasmtime_memory_grow(context, @mem, 1, @old_size);
+  if (error = Nil) then
+    exit_with_error('failed to grow memory 2', nil, nil);
+  wasmtime_error_delete(error);
+  error:=wasmtime_memory_grow(context, @mem, 0, @old_size);
+  if (error <>Nil) then
+    exit_with_error('failed to grow memory 3', error, nil);
+
+  writeln('Creating stand-alone memory...');
+  limits.min:=5;
+  limits.max:=5;
+  memorytype:=wasm_memorytype_new(@limits);
+  error:=wasmtime_memory_new(context, memorytype, @mem2);
+  if (error<>nil) then
+    exit_with_error('failed to create memory', error, nil);
+  wasm_memorytype_delete(memorytype);
+  check(wasmtime_memory_size(context, @mem2)=5);
+
+  Writeln('All finished!');
+  wasmtime_module_delete(module);
+  wasmtime_store_delete(store);
+  wasm_engine_delete(engine);
+end.
+

+ 13 - 0
packages/wasmtime/examples/memory.wat

@@ -0,0 +1,13 @@
+(module
+  (memory (export "memory") 2 3)
+
+  (func (export "size") (result i32) (memory.size))
+  (func (export "load") (param i32) (result i32)
+    (i32.load8_s (local.get 0))
+  )
+  (func (export "store") (param i32 i32)
+    (i32.store8 (local.get 0) (local.get 1))
+  )
+
+  (data (i32.const 0x1000) "\01\02\03\04")
+)

+ 58 - 0
packages/wasmtime/examples/wasi.lpi

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <General>
+      <Flags>
+        <MainUnitHasCreateFormStatements Value="False"/>
+        <MainUnitHasTitleStatement Value="False"/>
+        <MainUnitHasScaledStatement Value="False"/>
+        <UseDefaultCompilerOptions Value="True"/>
+      </Flags>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="wasi"/>
+      <UseAppBundle Value="False"/>
+      <ResourceType Value="res"/>
+    </General>
+    <BuildModes>
+      <Item Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+    </RunParams>
+    <Units>
+      <Unit>
+        <Filename Value="wasi.pp"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <Target>
+      <Filename Value="wasi"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="../src"/>
+      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions>
+      <Item>
+        <Name Value="EAbort"/>
+      </Item>
+      <Item>
+        <Name Value="ECodetoolError"/>
+      </Item>
+      <Item>
+        <Name Value="EFOpenError"/>
+      </Item>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 121 - 0
packages/wasmtime/examples/wasi.pp

@@ -0,0 +1,121 @@
+program wasi;
+
+uses classes,ctypes, wasmtime;
+
+procedure exit_with_error(message : Pchar; error : Pwasmtime_error_t; trap: Pwasm_trap_t); cdecl;
+
+var
+  error_message : Twasm_byte_vec_t ;
+  S : AnsiString;
+begin
+  Writeln(stderr, 'error: ', message);
+  S:='';
+  if (error <> Nil)  then
+    begin
+    write('Error: ');
+    wasmtime_error_message(error, @error_message);
+    wasmtime_error_delete(error)
+    end
+  else
+    begin
+    write('Trap: ');
+    wasm_trap_message(trap, @error_message);
+    wasm_trap_delete(trap);
+    end;
+  SetLength(S,error_message.size);
+  Move(error_message.data^,S[1],error_message.size);
+  Writeln(stderr, '>>',S,'<<');
+  wasm_byte_vec_delete(@error_message);
+  halt(1);
+end;
+
+Var
+  engine : Pwasm_engine_t = Nil;
+  store : Pwasmtime_store_t = Nil;
+  context : Pwasmtime_context_t = Nil;
+  F : TMemoryStream;
+  wasm : twasm_byte_vec_t;
+  module : Pwasmtime_module_t = Nil;
+  error : Pwasmtime_error_t = Nil;
+  func : Twasmtime_func_t;
+  trap : Pwasm_trap_t = Nil;
+  linker : Pwasmtime_linker_t;
+  wasi_config : Pwasi_config_t;
+  status : cint;
+
+begin
+  Writeln('Loading wasm library');
+  Loadwasmtime('./'+libwasmtime);
+  Writeln('Initializing...');
+  engine := wasm_engine_new();
+  store:=wasmtime_store_new(engine, nil,nil);
+  context:=wasmtime_store_context(store);
+
+  linker:= wasmtime_linker_new(engine);
+  error:=wasmtime_linker_define_wasi(linker);
+  if (error<>Nil) then
+    exit_with_error('failed to define link wasi', error, Nil);
+
+  F:=TMemoryStream.Create;
+  try
+    F.LoadFromFile('helloworld.wasm');
+    wasm_byte_vec_new_uninitialized(@wasm, F.Size);
+    Move(F.Memory^,wasm.data^,F.Size);
+  finally
+    F.Free;
+  end;
+
+  // Now that we've got our binary webassembly we can compile our module.
+  Writeln('Compiling module...');
+
+  error:=wasmtime_module_new(engine, Puint8_t(wasm.data), wasm.size, @module);
+  wasm_byte_vec_delete(@wasm);
+  if (error <> nil) then
+    exit_with_error('failed to compile module', error, nil);
+
+  wasi_config:=wasi_config_new();
+  if (wasi_config=nil) then
+    exit_with_error('failed to create wasi config', Nil, nil);
+
+  wasi_config_inherit_argv(wasi_config);
+  wasi_config_inherit_env(wasi_config);
+  wasi_config_inherit_stdin(wasi_config);
+  wasi_config_inherit_stdout(wasi_config);
+  wasi_config_inherit_stderr(wasi_config);
+  wasi_config_preopen_dir(wasi_config,pchar('.'),pchar('.'));
+  error:=wasmtime_context_set_wasi(context, wasi_config);
+  if (error<>Nil) then
+    exit_with_error('failed to instantiate WASI', error, nil);
+
+  // Instantiate the module
+  error:=wasmtime_linker_module(linker, context, Nil, 0, module);
+  if (error<>nil) then
+    exit_with_error('failed to instantiate module', Nil, Nil);
+
+
+  error:=wasmtime_linker_get_default(linker, context, nil, 0, @func);
+  if (error<>nil) then
+    exit_with_error('failed to locate default export for module', error, nil);
+
+  // And call it!
+  Writeln('Calling export...');
+  error:=wasmtime_func_call(context, @func, nil, 0, nil, 0, @trap);
+  if (Trap<>Nil) then
+    begin
+    // exit_proc is reported as trap.
+    if wasmtime_trap_exit_status(trap,@status)<>0 then
+      Writeln('Wasm program exited with status: ',Status)
+    else
+      exit_with_error('failed to run default export for module', error, trap);
+    end
+  else if (error<>nil) then
+    exit_with_error('failed to run default export for module', error, trap);
+
+  // Clean up after ourselves at this point
+  Writeln('All finished!\n');
+  wasmtime_module_delete(module);
+  wasmtime_store_delete(store);
+  wasm_engine_delete(engine);
+
+end.
+

+ 36 - 0
packages/wasmtime/fpmake.pp

@@ -0,0 +1,36 @@
+{$ifndef ALLPACKAGES}
+{$mode objfpc}{$H+}
+program fpmake;
+
+uses fpmkunit;
+
+Var
+  P : TPackage;
+  T : TTarget;
+begin
+  With Installer do
+    begin
+{$endif ALLPACKAGES}
+
+    P:=AddPackage('wasmtime');
+    P.ShortName:='wasmtime';
+    P.Description := 'Interface unit wasmtime webassembly library.';
+{$ifdef ALLPACKAGES}
+    P.Directory:=ADirectory;
+{$endif ALLPACKAGES}
+    P.Version:='3.3.1';
+    P.SourcePath.Add('src');
+    P.OSes := [linux,darwin,win64];
+    P.CPUs:=[x86_64];
+    T:=P.Targets.AddUnit('wasmtime.pp');
+    P.ExamplePath.Add('examples');
+    P.Targets.AddExampleProgram('helloworld.pp');
+    P.Targets.AddExampleProgram('gcd.pp');
+    P.Targets.AddExampleProgram('memory.pp');
+    P.Targets.AddExampleProgram('wasi.pp');
+    
+{$ifndef ALLPACKAGES}
+    Run;
+    end;
+end.
+{$endif ALLPACKAGES}

+ 2064 - 0
packages/wasmtime/src/wasmtime.pp

@@ -0,0 +1,2064 @@
+{
+   This file is part of the Free Pascal run time library.
+   Copyright (c) 2022 by Michael Van Canneyt, member of the
+   Free Pascal development team
+
+   WasmTime DLL import unit
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+**********************************************************************}
+
+{$mode objfpc}
+unit wasmtime;
+interface
+
+uses
+  ctypes;
+
+{
+  Automatically converted by H2Pas 1.0.0 from wt.h
+  The following command line parameters were used:
+    -u
+    wasmtime
+    -l
+    wasmtime
+    -o
+    wasmtime.pp
+    -p
+    -P
+    -t
+    -C
+    -c
+    wt.h
+}
+Const
+  {$IFDEF WINDOWS}
+  libwasmtime = 'libwasmtime.dll';
+  {$ELSE}
+    {$IFDEF DARWIN}
+      libwasmtime = 'libwasmtime.dylib';
+    {$ELSE}
+      libwasmtime = 'libwasmtime.so';
+    {$ENDIF}
+  {$ENDIF}
+
+Const
+  WASMTIME_EXTERN_FUNC     = 0;
+  WASMTIME_EXTERN_GLOBAL   = 1;
+  WASMTIME_EXTERN_TABLE    = 2;
+  WASMTIME_EXTERN_MEMORY   = 3;
+  WASMTIME_EXTERN_INSTANCE = 4;
+  WASMTIME_EXTERN_MODULE   = 5;
+
+  WASMTIME_I32       = 0;
+  WASMTIME_I64       = 1;
+  WASMTIME_F32       = 2;
+  WASMTIME_F64       = 3;
+  WASMTIME_V128      = 4;
+  WASMTIME_FUNCREF   = 5;
+  WASMTIME_EXTERNREF = 6;
+
+{ Pointers to basic pascal types, inserted by h2pas conversion program.}
+{$IFDEF FPC}
+{$PACKRECORDS C}
+{$ENDIF}
+Type
+  T_Bool = Byte;
+  PLongint  = ^Longint;
+  PSmallInt = ^SmallInt;
+  PByte     = ^Byte;
+  PWord     = ^Word;
+  PDWord    = ^DWord;
+  PDouble   = ^Double;
+  Byte_T    = byte;
+  Float32_t = Single;
+  FLoat64_t = Double;
+  Size_t    = Int64; 
+  Uint32_t  = Cardinal;
+  Uint64_t  = QWord;
+  Uint8_t   = Byte;
+
+Type
+  Pbyte_t  = ^byte_t;
+  Pfloat32_t  = ^float32_t;
+  Pfloat64_t  = ^float64_t;
+  Psize_t  = ^size_t;
+  Puint32_t  = ^uint32_t;
+  Puint64_t  = ^uint64_t;
+  Puint8_t  = ^uint8_t;
+  Pwasi_config_t  = ^Twasi_config_t;
+  Pwasm_byte_t  = ^Twasm_byte_t;
+  Pwasm_byte_vec_t  = ^Twasm_byte_vec_t;
+  Pwasm_config_t  = ^Twasm_config_t;
+  Pwasm_engine_t  = ^Twasm_engine_t;
+  Pwasm_exporttype_t  = ^Twasm_exporttype_t;
+  Pwasm_exporttype_vec_t  = ^Twasm_exporttype_vec_t;
+  Pwasm_extern_t  = ^Twasm_extern_t;
+  Pwasm_extern_vec_t  = ^Twasm_extern_vec_t;
+  Pwasm_externkind_enum  = ^Twasm_externkind_enum;
+  Pwasm_externkind_t  = ^Twasm_externkind_t;
+  Pwasm_externtype_t  = ^Twasm_externtype_t;
+  Pwasm_externtype_vec_t  = ^Twasm_externtype_vec_t;
+  Pwasm_foreign_t  = ^Twasm_foreign_t;
+  Pwasm_frame_t  = ^Twasm_frame_t;
+  Pwasm_frame_vec_t  = ^Twasm_frame_vec_t;
+  Pwasm_func_callback_t  = ^Twasm_func_callback_t;
+  Pwasm_func_callback_with_env_t  = ^Twasm_func_callback_with_env_t;
+  Pwasm_func_t  = ^Twasm_func_t;
+  Pwasm_functype_t  = ^Twasm_functype_t;
+  Pwasm_functype_vec_t  = ^Twasm_functype_vec_t;
+  Pwasm_global_t  = ^Twasm_global_t;
+  Pwasm_globaltype_t  = ^Twasm_globaltype_t;
+  Pwasm_globaltype_vec_t  = ^Twasm_globaltype_vec_t;
+  Pwasm_importtype_t  = ^Twasm_importtype_t;
+  Pwasm_importtype_vec_t  = ^Twasm_importtype_vec_t;
+  Pwasm_instance_t  = ^Twasm_instance_t;
+  Pwasm_limits_t  = ^Twasm_limits_t;
+  Pwasm_memory_pages_t  = ^Twasm_memory_pages_t;
+  Pwasm_memory_t  = ^Twasm_memory_t;
+  Pwasm_memorytype_t  = ^Twasm_memorytype_t;
+  Pwasm_memorytype_vec_t  = ^Twasm_memorytype_vec_t;
+  Pwasm_message_t  = ^Twasm_message_t;
+  Pwasm_module_t  = ^Twasm_module_t;
+  Pwasm_mutability_enum  = ^Twasm_mutability_enum;
+  Pwasm_mutability_t  = ^Twasm_mutability_t;
+  Pwasm_name_t  = ^Twasm_name_t;
+  Pwasm_ref_t  = ^Twasm_ref_t;
+  Pwasm_shared_module_t  = ^Twasm_shared_module_t;
+  Pwasm_store_t  = ^Twasm_store_t;
+  Pwasm_table_size_t  = ^Twasm_table_size_t;
+  Pwasm_table_t  = ^Twasm_table_t;
+  Pwasm_tabletype_t  = ^Twasm_tabletype_t;
+  Pwasm_tabletype_vec_t  = ^Twasm_tabletype_vec_t;
+  Pwasm_trap_t  = ^Twasm_trap_t;
+  Pwasm_val_t  = ^Twasm_val_t;
+  Pwasm_val_vec_t  = ^Twasm_val_vec_t;
+  Pwasm_valkind_enum  = ^Twasm_valkind_enum;
+  Pwasm_valkind_t  = ^Twasm_valkind_t;
+  Pwasm_valtype_t  = ^Twasm_valtype_t;
+  Pwasm_valtype_vec_t  = ^Twasm_valtype_vec_t;
+  Pwasmtime_caller_t  = ^Twasmtime_caller_t;
+  Pwasmtime_context_t  = ^Twasmtime_context_t;
+  Pwasmtime_error_t  = ^Twasmtime_error_t;
+  Pwasmtime_extern  = ^Twasmtime_extern;
+  Pwasmtime_extern_kind_t  = ^Twasmtime_extern_kind_t;
+  Pwasmtime_extern_t  = ^Twasmtime_extern_t;
+  Pwasmtime_extern_union  = ^Twasmtime_extern_union;
+  Pwasmtime_extern_union_t  = ^Twasmtime_extern_union_t;
+  Pwasmtime_externref_t  = ^Twasmtime_externref_t;
+  Pwasmtime_func  = ^Twasmtime_func;
+  Pwasmtime_func_callback_t  = ^Twasmtime_func_callback_t;
+  Pwasmtime_func_t  = ^Twasmtime_func_t;
+  Pwasmtime_func_unchecked_callback_t  = ^Twasmtime_func_unchecked_callback_t;
+  Pwasmtime_global  = ^Twasmtime_global;
+  Pwasmtime_global_t  = ^Twasmtime_global_t;
+  Pwasmtime_instance  = ^Twasmtime_instance;
+  Pwasmtime_instance_t  = ^Twasmtime_instance_t;
+  Pwasmtime_instancetype_t  = ^Twasmtime_instancetype_t;
+  Pwasmtime_interrupt_handle_t  = ^Twasmtime_interrupt_handle_t;
+  Pwasmtime_linker_t  = ^Twasmtime_linker_t;
+  Pwasmtime_memory  = ^Twasmtime_memory;
+  Pwasmtime_memory_t  = ^Twasmtime_memory_t;
+  Pwasmtime_module_t  = ^Twasmtime_module_t;
+  Pwasmtime_moduletype_t  = ^Twasmtime_moduletype_t;
+  Pwasmtime_opt_level_enum  = ^Twasmtime_opt_level_enum;
+  Pwasmtime_opt_level_t  = ^Twasmtime_opt_level_t;
+  Pwasmtime_profiling_strategy_enum  = ^Twasmtime_profiling_strategy_enum;
+  Pwasmtime_profiling_strategy_t  = ^Twasmtime_profiling_strategy_t;
+  Pwasmtime_store_t  = ^Twasmtime_store_t;
+  Pwasmtime_strategy_enum  = ^Twasmtime_strategy_enum;
+  Pwasmtime_strategy_t  = ^Twasmtime_strategy_t;
+  Pwasmtime_table  = ^Twasmtime_table;
+  Pwasmtime_table_t  = ^Twasmtime_table_t;
+  Pwasmtime_trap_code_enum  = ^Twasmtime_trap_code_enum;
+  Pwasmtime_trap_code_t  = ^Twasmtime_trap_code_t;
+  Pwasmtime_v128  = ^Twasmtime_v128;
+  Pwasmtime_val  = ^Twasmtime_val;
+  Pwasmtime_val_raw  = ^Twasmtime_val_raw;
+  Pwasmtime_val_raw_t  = ^Twasmtime_val_raw_t;
+  Pwasmtime_val_t  = ^Twasmtime_val_t;
+  Pwasmtime_valkind_t  = ^Twasmtime_valkind_t;
+  Pwasmtime_valunion  = ^Twasmtime_valunion;
+  Pwasmtime_valunion_t  = ^Twasmtime_valunion_t;
+  PPwasm_trap_t= ^Pwasm_trap_t;
+  PPwasmtime_module_t = ^Pwasmtime_module_t;
+  
+  Ppcchar = ^pchar;
+  Tcint = cint;
+  Tbyte_t = byte;
+  Tfloat32_t = single;
+  Tfloat64_t = double;
+  Twasm_byte_t = Tbyte_t;
+
+  Twasm_byte_vec_t = record
+      size : size_t;
+      data : Pwasm_byte_t;
+    end;
+  Twasm_name_t = Twasm_byte_vec_t;
+{
+static inline void wasm_name_new_from_string(
+  wasm_name_t* out, const char* s
+) 
+  wasm_byte_vec_new(out, strlen(s), s);
+
+
+static inline void wasm_name_new_from_string_nt(
+  wasm_name_t* out, const char* s
+) 
+  wasm_byte_vec_new(out, strlen(s) + 1, s);
+
+
+ }
+  Tuint8_t = byte;
+  Tuint32_t = cardinal;
+  Tuint64_t = qword;
+  TSize_t = size_t;
+  Tint32_t = longint;
+  Tint64_t = int64;
+  
+  // Opaque record defs
+  Twasmtime_moduletype_t = record
+  end;
+  Twasmtime_module_t = record
+  end;
+  Twasmtime_store_t = record
+  end;
+  Twasmtime_context_t = record
+  end;
+  Twasmtime_interrupt_handle_t = record
+  end;
+  Twasmtime_instancetype_t = record
+  end;  
+  Twasmtime_linker_t = record
+  end;  
+  Twasmtime_caller_t = record
+  end;  
+  Twasmtime_externref_t = record
+  end;
+  Twasi_config_t = record
+  end;   
+  Twasm_config_t = record
+  end;   
+  Twasm_engine_t = record
+  end;   
+  Twasm_exportype_t = record
+  end;   
+  Twasm_extern_t = record
+  end;   
+  Twasm_externtype_t = record
+  end;   
+  Twasm_foreign_t = record
+  end;   
+  Twasm_frame_t = record
+  end;   
+  Twasm_func_t = record
+  end;   
+  Twasm_functype_t = record
+  end;   
+  Twasm_global_t = record
+  end;   
+  Twasm_globaltype_t = record
+  end;   
+  Twasm_instance_t = record
+  end;   
+  Twasm_memory_t = record
+  end;   
+  Twasm_memorytype_t = record
+  end;   
+  Twasm_module_t = record
+  end;   
+  Twasm_sharedmodule_t = record
+  end;   
+  Twasm_store_t = record
+  end;   
+  Twasm_table_t = record
+  end;   
+  Twasm_tabletype_t = record
+  end;   
+  Twasm_trap_t = record
+  end;   
+  Twasm_valtime_t = record
+  end;   
+  Twasm_exporttype_t = record
+  end;
+  Twasm_importtype_t = record
+  end;
+  Twasm_shared_module_t = record
+  end;
+  Twasm_valtype_t = record
+  end;
+  PPwasm_functype_t = ^Pwasm_functype_t;
+
+  Twasm_mutability_t = Tuint8_t;
+  Twasm_mutability_enum = (WASM_CONST,WASM_VAR);
+
+  Twasmtime_opt_level_enum = (WASMTIME_OPT_LEVEL_NONE,WASMTIME_OPT_LEVEL_SPEED,
+      WASMTIME_OPT_LEVEL_SPEED_AND_SIZE);
+      
+  Twasm_limits_t = record
+      min : Tuint32_t;
+      max : Tuint32_t;
+    end;
+{
+static const uint32_t wasm_limits_max_default = 0xffffffff;
+ }
+  Twasm_valtype_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_valtype_t;
+    end;
+  Twasm_valkind_t = Tuint8_t;
+  Twasm_valkind_enum = (WASM_I32,WASM_I64,WASM_F32,WASM_F64,WASM_ANYREF := 128,
+    WASM_FUNCREF);
+
+  Twasm_functype_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_functype_t;
+    end;
+  Twasm_globaltype_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_globaltype_t;
+    end;
+  Twasm_tabletype_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_tabletype_t;
+    end;
+  Twasm_memorytype_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_memorytype_t;
+    end;
+  Twasm_externtype_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_externtype_t;
+    end;
+  Twasm_externkind_t = Tuint8_t;
+  Twasm_externkind_enum = (WASM_EXTERN_FUNC,WASM_EXTERN_GLOBAL,WASM_EXTERN_TABLE,
+    WASM_EXTERN_MEMORY);
+
+  Twasm_importtype_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_importtype_t;
+    end;
+  Twasm_exporttype_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_exporttype_t;
+    end;
+  Twasm_ref_t = record
+      {undefined structure}
+    end;
+
+
+  Twasm_val_t = record
+      kind : Twasm_valkind_t;
+      of_ : record
+          case longint of
+            0 : ( i32 : Tint32_t );
+            1 : ( i64 : Tint64_t );
+            2 : ( f32 : Tfloat32_t );
+            3 : ( f64 : Tfloat64_t );
+            4 : ( ref : Pwasm_ref_t );
+          end;
+    end;
+  Twasm_val_vec_t = record
+      size : Tsize_t;
+      data : Pwasm_val_t;
+    end;
+  Twasm_frame_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_frame_t;
+    end;
+  Twasm_message_t = Twasm_name_t;
+  Twasm_func_callback_t = function (args:Pwasm_val_vec_t; results:Pwasm_val_vec_t):Pwasm_trap_t;cdecl;
+  
+  Twasm_func_callback_with_env_t = function (env:pointer; args:Pwasm_val_vec_t; results:Pwasm_val_vec_t):Pwasm_trap_t;cdecl;
+  Twasm_table_size_t = Tuint32_t;
+  Twasm_memory_pages_t = Tuint32_t;
+{
+static  MEMORY_PAGE_SIZE = 0x10000;
+ }
+  Twasm_extern_vec_t = record
+      size : Tsize_t;
+      data : ^Pwasm_extern_t;
+    end;
+  Twasmtime_error_t = cint;
+  Twasmtime_error = Twasmtime_error_t;
+  Twasmtime_strategy_t = Tuint8_t;
+  Twasmtime_strategy_enum = (WASMTIME_STRATEGY_AUTO,WASMTIME_STRATEGY_CRANELIFT
+    );
+
+
+  Twasmtime_opt_level_t = Tuint8_t;
+
+
+  Twasmtime_profiling_strategy_t = Tuint8_t;
+  Twasmtime_profiling_strategy_enum = (WASMTIME_PROFILING_STRATEGY_NONE,WASMTIME_PROFILING_STRATEGY_JITDUMP,
+    WASMTIME_PROFILING_STRATEGY_VTUNE);
+
+
+
+  Twasmtime_moduletype = Twasmtime_moduletype_t;
+  Twasmtime_module = Twasmtime_module_t;
+  Twasmtime_store = Twasmtime_store_t;
+  Twasmtime_context = Twasmtime_context_t;
+  Twasmtime_interrupt_handle = Twasmtime_interrupt_handle_t;
+  Twasmtime_func = record
+      store_id : Tuint64_t;
+      index : Tsize_t;
+    end;
+  Twasmtime_func_t = Twasmtime_func;
+
+  Twasmtime_table = record
+      store_id : Tuint64_t;
+      index : Tsize_t;
+    end;
+  Twasmtime_table_t = Twasmtime_table;
+
+  Twasmtime_memory = record
+      store_id : Tuint64_t;
+      index : Tsize_t;
+    end;
+  Twasmtime_memory_t = Twasmtime_memory;
+
+  Twasmtime_instance = record
+      store_id : Tuint64_t;
+      index : Tsize_t;
+    end;
+  Twasmtime_instance_t = Twasmtime_instance;
+
+  Twasmtime_global = record
+      store_id : Tuint64_t;
+      index : Tsize_t;
+    end;
+  Twasmtime_global_t = Twasmtime_global;
+
+  Twasmtime_extern_kind_t = Tuint8_t;
+
+  Twasmtime_extern_union = record
+      case longint of
+        0 : ( func : Twasmtime_func_t );
+        1 : ( global : Twasmtime_global_t );
+        2 : ( table : Twasmtime_table_t );
+        3 : ( memory : Twasmtime_memory_t );
+        4 : ( instance : Twasmtime_instance_t );
+        5 : ( module : Pwasmtime_module_t );
+      end;
+  Twasmtime_extern_union_t = Twasmtime_extern_union;
+
+  Twasmtime_extern = record
+      kind : Twasmtime_extern_kind_t;
+      of_ : Twasmtime_extern_union_t;
+    end;
+  Twasmtime_extern_t = Twasmtime_extern;
+  Twasmtime_externref = Twasmtime_externref_t;
+  Twasmtime_valkind_t = Tuint8_t;
+
+  Twasmtime_v128 = array[0..15] of Tuint8_t;
+
+  Twasmtime_valunion = record
+      case longint of
+        0 : ( i32 : Tint32_t );
+        1 : ( i64 : Tint64_t );
+        2 : ( f32 : Tfloat32_t );
+        3 : ( f64 : Tfloat64_t );
+        4 : ( funcref : Twasmtime_func_t );
+        5 : ( externref : Pwasmtime_externref_t );
+        6 : ( v128 : Twasmtime_v128 );
+      end;
+  Twasmtime_valunion_t = Twasmtime_valunion;
+
+  Twasmtime_val_raw = record
+      case longint of
+        0 : ( i32 : Tint32_t );
+        1 : ( i64 : Tint64_t );
+        2 : ( f32 : Tfloat32_t );
+        3 : ( f64 : Tfloat64_t );
+        4 : ( v128 : Twasmtime_v128 );
+        5 : ( funcref : Tsize_t );
+        6 : ( externref : Tsize_t );
+      end;
+  Twasmtime_val_raw_t = Twasmtime_val_raw;
+
+  Twasmtime_val = record
+      kind : Twasmtime_valkind_t;
+      of_ : Twasmtime_valunion_t;
+    end;
+  Twasmtime_val_t = Twasmtime_val;
+  Twasmtime_caller = Twasmtime_caller_t;
+
+  Twasmtime_func_callback_t = function (env:pointer; caller:Pwasmtime_caller_t; args:Pwasmtime_val_t; nargs:Tsize_t; results:Pwasmtime_val_t; 
+               nresults:Tsize_t):Pwasm_trap_t;cdecl;
+  Twasmtime_func_unchecked_callback_t = function (env:pointer; caller:Pwasmtime_caller_t; args_and_results:Pwasmtime_val_raw_t):Pwasm_trap_t;cdecl;
+  Twasmtime_instancetype = Twasmtime_instancetype_t;
+  Twasmtime_linker = Twasmtime_linker_t;
+  Twasmtime_trap_code_t = Tuint8_t;
+  Twasmtime_trap_code_enum = (WASMTIME_TRAP_CODE_STACK_OVERFLOW,WASMTIME_TRAP_CODE_MEMORY_OUT_OF_BOUNDS,
+    WASMTIME_TRAP_CODE_HEAP_MISALIGNED,WASMTIME_TRAP_CODE_TABLE_OUT_OF_BOUNDS,
+    WASMTIME_TRAP_CODE_INDIRECT_CALL_TO_NULL,
+    WASMTIME_TRAP_CODE_BAD_SIGNATURE,WASMTIME_TRAP_CODE_INTEGER_OVERFLOW,
+    WASMTIME_TRAP_CODE_INTEGER_DIVISION_BY_ZERO,
+    WASMTIME_TRAP_CODE_BAD_CONVERSION_TO_INTEGER,
+    WASMTIME_TRAP_CODE_UNREACHABLE_CODE_REACHED,
+    WASMTIME_TRAP_CODE_INTERRUPT);
+    
+  TFinalizer = procedure (_para1:pointer); cdecl;
+
+var
+
+  wasm_byte_vec_new_empty : procedure(_out:Pwasm_byte_vec_t); cdecl;
+  wasm_byte_vec_new_uninitialized : procedure(_out:Pwasm_byte_vec_t; _para2:Tsize_t); cdecl;
+  wasm_byte_vec_new : procedure(_out:Pwasm_byte_vec_t; _para2:Tsize_t; _para3:Pwasm_byte_t); cdecl;
+  wasm_byte_vec_copy : procedure(_out:Pwasm_byte_vec_t; _para2:Pwasm_byte_vec_t); cdecl;
+  wasm_byte_vec_delete : procedure(_para1:Pwasm_byte_vec_t); cdecl;
+  wasm_config_delete : procedure(_para1:Pwasm_config_t); cdecl;
+  wasm_config_new : function:Pwasm_config_t; cdecl;
+  wasm_engine_delete : procedure(_para1:Pwasm_engine_t); cdecl;
+  wasm_engine_new : function:Pwasm_engine_t; cdecl;
+  wasm_engine_new_with_config : function(_para1:Pwasm_config_t):Pwasm_engine_t; cdecl;
+  wasm_store_delete : procedure(_para1:Pwasm_store_t); cdecl;
+  wasm_store_new : function(_para1:Pwasm_engine_t):Pwasm_store_t; cdecl;
+  wasm_valtype_delete : procedure(_para1:Pwasm_valtype_t); cdecl;
+  wasm_valtype_vec_new_empty : procedure(_out:Pwasm_valtype_vec_t); cdecl;
+  wasm_valtype_vec_new_uninitialized : procedure(_out:Pwasm_valtype_vec_t; _para2:Tsize_t); cdecl;
+  wasm_valtype_vec_new : procedure(_out:Pwasm_valtype_vec_t; _para2:Tsize_t; data:Pwasm_valtype_t); cdecl;
+  wasm_valtype_vec_copy : procedure(_out:Pwasm_valtype_vec_t; _para2:Pwasm_valtype_vec_t); cdecl;
+  wasm_valtype_vec_delete : procedure(_para1:Pwasm_valtype_vec_t); cdecl;
+  wasm_valtype_copy : function(_para1:Pwasm_valtype_t):Pwasm_valtype_t; cdecl;
+  wasm_valtype_new : function(_para1:Twasm_valkind_t):Pwasm_valtype_t; cdecl;
+  wasm_valtype_kind : function(_para1:Pwasm_valtype_t):Twasm_valkind_t; cdecl;
+  wasm_functype_delete : procedure(_para1:Pwasm_functype_t); cdecl;
+  wasm_functype_vec_new_empty : procedure(_out:Pwasm_functype_vec_t); cdecl;
+  wasm_functype_vec_new_uninitialized : procedure(_out:Pwasm_functype_vec_t; _para2:Tsize_t); cdecl;
+  wasm_functype_vec_new : procedure(_out:Pwasm_functype_vec_t; _para2:Tsize_t; _para3:PPwasm_functype_t); cdecl;
+  wasm_functype_vec_copy : procedure(_out:Pwasm_functype_vec_t; _para2:Pwasm_functype_vec_t); cdecl;
+  wasm_functype_vec_delete : procedure(_para1:Pwasm_functype_vec_t); cdecl;
+  wasm_functype_copy : function(_para1:Pwasm_functype_t):Pwasm_functype_t; cdecl;
+  wasm_functype_new : function(params:Pwasm_valtype_vec_t; results:Pwasm_valtype_vec_t):Pwasm_functype_t; cdecl;
+  wasm_functype_params : function(_para1:Pwasm_functype_t):Pwasm_valtype_vec_t; cdecl;
+  wasm_functype_results : function(_para1:Pwasm_functype_t):Pwasm_valtype_vec_t; cdecl;
+  wasm_globaltype_delete : procedure(_para1:Pwasm_globaltype_t); cdecl;
+  wasm_globaltype_vec_new_empty : procedure(_out:Pwasm_globaltype_vec_t); cdecl;
+  wasm_globaltype_vec_new_uninitialized : procedure(_out:Pwasm_globaltype_vec_t; _para2:Tsize_t); cdecl;
+  wasm_globaltype_vec_new : procedure(_out:Pwasm_globaltype_vec_t; _para2:Tsize_t; data:Pwasm_globaltype_t); cdecl;
+  wasm_globaltype_vec_copy : procedure(_out:Pwasm_globaltype_vec_t; data:Pwasm_globaltype_vec_t); cdecl;
+  wasm_globaltype_vec_delete : procedure(_para1:Pwasm_globaltype_vec_t); cdecl;
+  wasm_globaltype_copy : function(_para1:Pwasm_globaltype_t):Pwasm_globaltype_t; cdecl;
+  wasm_globaltype_new : function(_para1:Pwasm_valtype_t; _para2:Twasm_mutability_t):Pwasm_globaltype_t; cdecl;
+  wasm_globaltype_content : function(_para1:Pwasm_globaltype_t):Pwasm_valtype_t; cdecl;
+  wasm_globaltype_mutability : function(_para1:Pwasm_globaltype_t):Twasm_mutability_t; cdecl;
+  wasm_tabletype_delete : procedure(_para1:Pwasm_tabletype_t); cdecl;
+  wasm_tabletype_vec_new_empty : procedure(_out:Pwasm_tabletype_vec_t); cdecl;
+  wasm_tabletype_vec_new_uninitialized : procedure(_out:Pwasm_tabletype_vec_t; _para2:Tsize_t); cdecl;
+  wasm_tabletype_vec_new : procedure(_out:Pwasm_tabletype_vec_t; _para2:Tsize_t; data:Pwasm_tabletype_t); cdecl;
+  wasm_tabletype_vec_copy : procedure(_out:Pwasm_tabletype_vec_t; data:Pwasm_tabletype_vec_t); cdecl;
+  wasm_tabletype_vec_delete : procedure(_para1:Pwasm_tabletype_vec_t); cdecl;
+  wasm_tabletype_copy : function(_para1:Pwasm_tabletype_t):Pwasm_tabletype_t; cdecl;
+  wasm_tabletype_new : function(_para1:Pwasm_valtype_t; _para2:Pwasm_limits_t):Pwasm_tabletype_t; cdecl;
+  wasm_tabletype_element : function(_para1:Pwasm_tabletype_t):Pwasm_valtype_t; cdecl;
+  wasm_tabletype_limits : function(_para1:Pwasm_tabletype_t):Pwasm_limits_t; cdecl;
+  wasm_memorytype_delete : procedure(_para1:Pwasm_memorytype_t); cdecl;
+  wasm_memorytype_vec_new_empty : procedure(_out:Pwasm_memorytype_vec_t); cdecl;
+  wasm_memorytype_vec_new_uninitialized : procedure(_out:Pwasm_memorytype_vec_t; _para2:Tsize_t); cdecl;
+  wasm_memorytype_vec_new : procedure(_out:Pwasm_memorytype_vec_t; _para2:Tsize_t; data:Pwasm_memorytype_t); cdecl;
+  wasm_memorytype_vec_copy : procedure(_out:Pwasm_memorytype_vec_t; data:Pwasm_memorytype_vec_t); cdecl;
+  wasm_memorytype_vec_delete : procedure(_para1:Pwasm_memorytype_vec_t); cdecl;
+  wasm_memorytype_copy : function(_para1:Pwasm_memorytype_t):Pwasm_memorytype_t; cdecl;
+  wasm_memorytype_new : function(_para1:Pwasm_limits_t):Pwasm_memorytype_t; cdecl;
+  wasm_memorytype_limits : function(_para1:Pwasm_memorytype_t):Pwasm_limits_t; cdecl;
+  wasm_externtype_delete : procedure(_para1:Pwasm_externtype_t); cdecl;
+  wasm_externtype_vec_new_empty : procedure(_out:Pwasm_externtype_vec_t); cdecl;
+  wasm_externtype_vec_new_uninitialized : procedure(_out:Pwasm_externtype_vec_t; _para2:Tsize_t); cdecl;
+  wasm_externtype_vec_new : procedure(_out:Pwasm_externtype_vec_t; _para2:Tsize_t; data:Pwasm_externtype_t); cdecl;
+  wasm_externtype_vec_copy : procedure(_out:Pwasm_externtype_vec_t; _para2:Pwasm_externtype_vec_t); cdecl;
+  wasm_externtype_vec_delete : procedure(_para1:Pwasm_externtype_vec_t); cdecl;
+  wasm_externtype_copy : function(_para1:Pwasm_externtype_t):Pwasm_externtype_t; cdecl;
+  wasm_externtype_kind : function(_para1:Pwasm_externtype_t):Twasm_externkind_t; cdecl;
+  wasm_functype_as_externtype : function(_para1:Pwasm_functype_t):Pwasm_externtype_t; cdecl;
+  wasm_globaltype_as_externtype : function(_para1:Pwasm_globaltype_t):Pwasm_externtype_t; cdecl;
+  wasm_tabletype_as_externtype : function(_para1:Pwasm_tabletype_t):Pwasm_externtype_t; cdecl;
+  wasm_memorytype_as_externtype : function(_para1:Pwasm_memorytype_t):Pwasm_externtype_t; cdecl;
+  wasm_externtype_as_functype : function(_para1:Pwasm_externtype_t):Pwasm_functype_t; cdecl;
+  wasm_externtype_as_globaltype : function(_para1:Pwasm_externtype_t):Pwasm_globaltype_t; cdecl;
+  wasm_externtype_as_tabletype : function(_para1:Pwasm_externtype_t):Pwasm_tabletype_t; cdecl;
+  wasm_externtype_as_memorytype : function(_para1:Pwasm_externtype_t):Pwasm_memorytype_t; cdecl;
+  wasm_functype_as_externtype_const : function(_para1:Pwasm_functype_t):Pwasm_externtype_t; cdecl;
+  wasm_globaltype_as_externtype_const : function(_para1:Pwasm_globaltype_t):Pwasm_externtype_t; cdecl;
+  wasm_tabletype_as_externtype_const : function(_para1:Pwasm_tabletype_t):Pwasm_externtype_t; cdecl;
+  wasm_memorytype_as_externtype_const : function(_para1:Pwasm_memorytype_t):Pwasm_externtype_t; cdecl;
+  wasm_externtype_as_functype_const : function(_para1:Pwasm_externtype_t):Pwasm_functype_t; cdecl;
+  wasm_externtype_as_globaltype_const : function(_para1:Pwasm_externtype_t):Pwasm_globaltype_t; cdecl;
+  wasm_externtype_as_tabletype_const : function(_para1:Pwasm_externtype_t):Pwasm_tabletype_t; cdecl;
+  wasm_externtype_as_memorytype_const : function(_para1:Pwasm_externtype_t):Pwasm_memorytype_t; cdecl;
+  wasm_importtype_delete : procedure(_para1:Pwasm_importtype_t); cdecl;
+  wasm_importtype_vec_new_empty : procedure(_out:Pwasm_importtype_vec_t); cdecl;
+  wasm_importtype_vec_new_uninitialized : procedure(_out:Pwasm_importtype_vec_t; _para2:Tsize_t); cdecl;
+  wasm_importtype_vec_new : procedure(_out:Pwasm_importtype_vec_t; _para2:Tsize_t; data:Pwasm_importtype_t); cdecl;
+  wasm_importtype_vec_copy : procedure(_out:Pwasm_importtype_vec_t; _para2:Pwasm_importtype_vec_t); cdecl;
+  wasm_importtype_vec_delete : procedure(_para1:Pwasm_importtype_vec_t); cdecl;
+  wasm_importtype_copy : function(_para1:Pwasm_importtype_t):Pwasm_importtype_t; cdecl;
+  wasm_importtype_new : function(module:Pwasm_name_t; name:Pwasm_name_t; _para3:Pwasm_externtype_t):Pwasm_importtype_t; cdecl;
+  wasm_importtype_module : function(_para1:Pwasm_importtype_t):Pwasm_name_t; cdecl;
+  wasm_importtype_name : function(_para1:Pwasm_importtype_t):Pwasm_name_t; cdecl;
+  wasm_importtype_type : function(_para1:Pwasm_importtype_t):Pwasm_externtype_t; cdecl;
+  wasm_exporttype_delete : procedure(_para1:Pwasm_exporttype_t); cdecl;
+  wasm_exporttype_vec_new_empty : procedure(_out:Pwasm_exporttype_vec_t); cdecl;
+  wasm_exporttype_vec_new_uninitialized : procedure(_out:Pwasm_exporttype_vec_t; _para2:Tsize_t); cdecl;
+  wasm_exporttype_vec_new : procedure(_out:Pwasm_exporttype_vec_t; _para2:Tsize_t; data:Pwasm_exporttype_t); cdecl;
+  wasm_exporttype_vec_copy : procedure(_out:Pwasm_exporttype_vec_t; _para2:Pwasm_exporttype_vec_t); cdecl;
+  wasm_exporttype_vec_delete : procedure(_para1:Pwasm_exporttype_vec_t); cdecl;
+  wasm_exporttype_copy : function(_para1:Pwasm_exporttype_t):Pwasm_exporttype_t; cdecl;
+  wasm_exporttype_new : function(_para1:Pwasm_name_t; _para2:Pwasm_externtype_t):Pwasm_exporttype_t; cdecl;
+  wasm_exporttype_name : function(_para1:Pwasm_exporttype_t):Pwasm_name_t; cdecl;
+  wasm_exporttype_type : function(_para1:Pwasm_exporttype_t):Pwasm_externtype_t; cdecl;
+  wasm_val_delete : procedure(v:Pwasm_val_t); cdecl;
+  wasm_val_copy : procedure(_out:Pwasm_val_t; _para2:Pwasm_val_t); cdecl;
+  wasm_val_vec_new_empty : procedure(_out:Pwasm_val_vec_t); cdecl;
+  wasm_val_vec_new_uninitialized : procedure(_out:Pwasm_val_vec_t; _para2:Tsize_t); cdecl;
+  wasm_val_vec_new : procedure(_out:Pwasm_val_vec_t; _para2:Tsize_t; data:Pwasm_val_t); cdecl;
+  wasm_val_vec_copy : procedure(_out:Pwasm_val_vec_t; _para2:Pwasm_val_vec_t); cdecl;
+  wasm_val_vec_delete : procedure(_para1:Pwasm_val_vec_t); cdecl;
+  wasm_ref_delete : procedure(_para1:Pwasm_ref_t); cdecl;
+  wasm_ref_copy : function(_para1:Pwasm_ref_t):Pwasm_ref_t; cdecl;
+  wasm_ref_same : function(_para1:Pwasm_ref_t; _para2:Pwasm_ref_t):T_Bool;
+  wasm_ref_get_host_info : function(_para1:Pwasm_ref_t):pointer;
+  wasm_ref_set_host_info : procedure(_para1:Pwasm_ref_t; _para2:pointer); cdecl;
+  wasm_ref_set_host_info_with_finalizer : procedure(_para1:Pwasm_ref_t; _para2:pointer; _para3:TFInalizer); cdecl;
+  wasm_frame_delete : procedure(_para1:Pwasm_frame_t); cdecl;
+  wasm_frame_vec_new_empty : procedure(_out:Pwasm_frame_vec_t); cdecl;
+  wasm_frame_vec_new_uninitialized : procedure(_out:Pwasm_frame_vec_t; _para2:Tsize_t); cdecl;
+  wasm_frame_vec_new : procedure(_out:Pwasm_frame_vec_t; _para2:Tsize_t; data:Pwasm_frame_t); cdecl;
+  wasm_frame_vec_copy : procedure(_out:Pwasm_frame_vec_t; _para2:Pwasm_frame_vec_t); cdecl;
+  wasm_frame_vec_delete : procedure(_para1:Pwasm_frame_vec_t); cdecl;
+  wasm_frame_copy : function(_para1:Pwasm_frame_t):Pwasm_frame_t; cdecl;
+  wasm_frame_instance : function(_para1:Pwasm_frame_t):Pwasm_instance_t; cdecl;
+  wasm_frame_func_index : function(_para1:Pwasm_frame_t):Tuint32_t; cdecl;
+  wasm_frame_func_offset : function(_para1:Pwasm_frame_t):Tsize_t; cdecl;
+  wasm_frame_module_offset : function(_para1:Pwasm_frame_t):Tsize_t; cdecl;
+  wasm_trap_delete : procedure(_para1:Pwasm_trap_t); cdecl;
+  wasm_trap_copy : function(_para1:Pwasm_trap_t):Pwasm_trap_t; cdecl;
+  wasm_trap_same : function(_para1:Pwasm_trap_t; _para2:Pwasm_trap_t):T_Bool;
+  wasm_trap_get_host_info : function(_para1:Pwasm_trap_t):pointer;
+  wasm_trap_set_host_info : procedure(_para1:Pwasm_trap_t; _para2:pointer); cdecl;
+  wasm_trap_set_host_info_with_finalizer : procedure(_para1:Pwasm_trap_t; _para2:pointer; _para3:TFinalizer); cdecl;
+  wasm_trap_as_ref : function(_para1:Pwasm_trap_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_trap : function(_para1:Pwasm_ref_t):Pwasm_trap_t; cdecl;
+  wasm_trap_as_ref_const : function(_para1:Pwasm_trap_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_trap_const : function(_para1:Pwasm_ref_t):Pwasm_trap_t; cdecl;
+  wasm_trap_new : function(store:Pwasm_store_t; _para2:Pwasm_message_t):Pwasm_trap_t; cdecl;
+  wasm_trap_message : procedure(_para1:Pwasm_trap_t; out_:Pwasm_message_t); cdecl;
+  wasm_trap_origin : function(_para1:Pwasm_trap_t):Pwasm_frame_t; cdecl;
+  wasm_trap_trace : procedure(_para1:Pwasm_trap_t; out_:Pwasm_frame_vec_t); cdecl;
+  wasm_foreign_delete : procedure(_para1:Pwasm_foreign_t); cdecl;
+  wasm_foreign_copy : function(_para1:Pwasm_foreign_t):Pwasm_foreign_t; cdecl;
+  wasm_foreign_same : function(_para1:Pwasm_foreign_t; _para2:Pwasm_foreign_t):T_Bool;
+  wasm_foreign_get_host_info : function(_para1:Pwasm_foreign_t):pointer;
+  wasm_foreign_set_host_info : procedure(_para1:Pwasm_foreign_t; _para2:pointer); cdecl;
+  wasm_foreign_set_host_info_with_finalizer : procedure(_para1:Pwasm_foreign_t; _para2:pointer; _para3:TFinalizer); cdecl;
+  wasm_foreign_as_ref : function(_para1:Pwasm_foreign_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_foreign : function(_para1:Pwasm_ref_t):Pwasm_foreign_t; cdecl;
+  wasm_foreign_as_ref_const : function(_para1:Pwasm_foreign_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_foreign_const : function(_para1:Pwasm_ref_t):Pwasm_foreign_t; cdecl;
+  wasm_foreign_new : function(_para1:Pwasm_store_t):Pwasm_foreign_t; cdecl;
+  wasm_module_delete : procedure(_para1:Pwasm_module_t); cdecl;
+  wasm_module_copy : function(_para1:Pwasm_module_t):Pwasm_module_t; cdecl;
+  wasm_module_same : function(_para1:Pwasm_module_t; _para2:Pwasm_module_t):T_Bool;
+  wasm_module_get_host_info : function(_para1:Pwasm_module_t):pointer;
+  wasm_module_set_host_info : procedure(_para1:Pwasm_module_t; _para2:pointer); cdecl;
+  wasm_module_set_host_info_with_finalizer : procedure(_para1:Pwasm_module_t; _para2:pointer; _para3: TFinalizer); cdecl;
+  wasm_module_as_ref : function(_para1:Pwasm_module_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_module : function(_para1:Pwasm_ref_t):Pwasm_module_t; cdecl;
+  wasm_module_as_ref_const : function(_para1:Pwasm_module_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_module_const : function(_para1:Pwasm_ref_t):Pwasm_module_t; cdecl;
+  wasm_shared_module_delete : procedure(_para1:Pwasm_shared_module_t); cdecl;
+  wasm_module_share : function(_para1:Pwasm_module_t):Pwasm_shared_module_t; cdecl;
+  wasm_module_obtain : function(_para1:Pwasm_store_t; _para2:Pwasm_shared_module_t):Pwasm_module_t; cdecl;
+  wasm_module_new : function(_para1:Pwasm_store_t; binary:Pwasm_byte_vec_t):Pwasm_module_t; cdecl;
+  wasm_module_validate : function(_para1:Pwasm_store_t; binary:Pwasm_byte_vec_t):T_Bool;
+  wasm_module_imports : procedure(_para1:Pwasm_module_t; out_:Pwasm_importtype_vec_t); cdecl;
+  wasm_module_exports : procedure(_para1:Pwasm_module_t; out_:Pwasm_exporttype_vec_t); cdecl;
+  wasm_module_serialize : procedure(_para1:Pwasm_module_t; out_:Pwasm_byte_vec_t); cdecl;
+  wasm_module_deserialize : function(_para1:Pwasm_store_t; _para2:Pwasm_byte_vec_t):Pwasm_module_t; cdecl;
+  wasm_func_delete : procedure(_para1:Pwasm_func_t); cdecl;
+  wasm_func_copy : function(_para1:Pwasm_func_t):Pwasm_func_t; cdecl;
+  wasm_func_same : function(_para1:Pwasm_func_t; _para2:Pwasm_func_t):T_Bool;
+  wasm_func_get_host_info : function(_para1:Pwasm_func_t):pointer;
+  wasm_func_set_host_info : procedure(_para1:Pwasm_func_t; _para2:pointer); cdecl;
+  wasm_func_set_host_info_with_finalizer : procedure(_para1:Pwasm_func_t; _para2:pointer; _para3:TFinalizer); cdecl;
+  wasm_func_as_ref : function(_para1:Pwasm_func_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_func : function(_para1:Pwasm_ref_t):Pwasm_func_t; cdecl;
+  wasm_func_as_ref_const : function(_para1:Pwasm_func_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_func_const : function(_para1:Pwasm_ref_t):Pwasm_func_t; cdecl;
+  wasm_func_new : function(_para1:Pwasm_store_t; _para2:Pwasm_functype_t; _para3:Twasm_func_callback_t):Pwasm_func_t; cdecl;
+  wasm_func_new_with_env : function(_para1:Pwasm_store_t; _type:Pwasm_functype_t; _para3:Twasm_func_callback_with_env_t; env:pointer; finalizer:TFinalizer):Pwasm_func_t; cdecl;
+  wasm_func_type : function(_para1:Pwasm_func_t):Pwasm_functype_t; cdecl;
+  wasm_func_param_arity : function(_para1:Pwasm_func_t):Tsize_t; cdecl;
+  wasm_func_result_arity : function(_para1:Pwasm_func_t):Tsize_t; cdecl;
+  wasm_func_call : function(_para1:Pwasm_func_t; args:Pwasm_val_vec_t; results:Pwasm_val_vec_t):Pwasm_trap_t; cdecl;
+  wasm_global_delete : procedure(_para1:Pwasm_global_t); cdecl;
+  wasm_global_copy : function(_para1:Pwasm_global_t):Pwasm_global_t; cdecl;
+  wasm_global_same : function(_para1:Pwasm_global_t; _para2:Pwasm_global_t):T_Bool;
+  wasm_global_get_host_info : function(_para1:Pwasm_global_t):pointer;
+  wasm_global_set_host_info : procedure(_para1:Pwasm_global_t; _para2:pointer); cdecl;
+  wasm_global_set_host_info_with_finalizer : procedure(_para1:Pwasm_global_t; _para2:pointer; _para3:TFinalizer); cdecl;
+  wasm_global_as_ref : function(_para1:Pwasm_global_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_global : function(_para1:Pwasm_ref_t):Pwasm_global_t; cdecl;
+  wasm_global_as_ref_const : function(_para1:Pwasm_global_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_global_const : function(_para1:Pwasm_ref_t):Pwasm_global_t; cdecl;
+  wasm_global_new : function(_para1:Pwasm_store_t; _para2:Pwasm_globaltype_t; _para3:Pwasm_val_t):Pwasm_global_t; cdecl;
+  wasm_global_type : function(_para1:Pwasm_global_t):Pwasm_globaltype_t; cdecl;
+  wasm_global_get : procedure(_para1:Pwasm_global_t; out_:Pwasm_val_t); cdecl;
+  wasm_global_set : procedure(_para1:Pwasm_global_t; _para2:Pwasm_val_t); cdecl;
+  wasm_table_delete : procedure(_para1:Pwasm_table_t); cdecl;
+  wasm_table_copy : function(_para1:Pwasm_table_t):Pwasm_table_t; cdecl;
+  wasm_table_same : function(_para1:Pwasm_table_t; _para2:Pwasm_table_t):T_Bool;
+  wasm_table_get_host_info : function(_para1:Pwasm_table_t):pointer;
+  wasm_table_set_host_info : procedure(_para1:Pwasm_table_t; _para2:pointer); cdecl;
+  wasm_table_set_host_info_with_finalizer : procedure(_para1:Pwasm_table_t; _para2:pointer; _para3:TFinalizer); cdecl;
+  wasm_table_as_ref : function(_para1:Pwasm_table_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_table : function(_para1:Pwasm_ref_t):Pwasm_table_t; cdecl;
+  wasm_table_as_ref_const : function(_para1:Pwasm_table_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_table_const : function(_para1:Pwasm_ref_t):Pwasm_table_t; cdecl;
+  wasm_table_new : function(_para1:Pwasm_store_t; _para2:Pwasm_tabletype_t; init:Pwasm_ref_t):Pwasm_table_t; cdecl;
+  wasm_table_type : function(_para1:Pwasm_table_t):Pwasm_tabletype_t; cdecl;
+  wasm_table_get : function(_para1:Pwasm_table_t; index:Twasm_table_size_t):Pwasm_ref_t; cdecl;
+  wasm_table_set : function(_para1:Pwasm_table_t; index:Twasm_table_size_t; _para3:Pwasm_ref_t):T_Bool;
+  wasm_table_size : function(_para1:Pwasm_table_t):Twasm_table_size_t; cdecl;
+  wasm_table_grow : function(_para1:Pwasm_table_t; delta:Twasm_table_size_t; init:Pwasm_ref_t):T_Bool;
+  wasm_memory_delete : procedure(_para1:Pwasm_memory_t); cdecl;
+  wasm_memory_copy : function(_para1:Pwasm_memory_t):Pwasm_memory_t; cdecl;
+  wasm_memory_same : function(_para1:Pwasm_memory_t; _para2:Pwasm_memory_t):T_Bool;
+  wasm_memory_get_host_info : function(_para1:Pwasm_memory_t):pointer;
+  wasm_memory_set_host_info : procedure(_para1:Pwasm_memory_t; _para2:pointer); cdecl;
+  wasm_memory_set_host_info_with_finalizer : procedure(_para1:Pwasm_memory_t; _para2:pointer; _para3:TFinalizer); cdecl;
+  wasm_memory_as_ref : function(_para1:Pwasm_memory_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_memory : function(_para1:Pwasm_ref_t):Pwasm_memory_t; cdecl;
+  wasm_memory_as_ref_const : function(_para1:Pwasm_memory_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_memory_const : function(_para1:Pwasm_ref_t):Pwasm_memory_t; cdecl;
+  wasm_memory_new : function(_para1:Pwasm_store_t; _para2:Pwasm_memorytype_t):Pwasm_memory_t; cdecl;
+  wasm_memory_type : function(_para1:Pwasm_memory_t):Pwasm_memorytype_t; cdecl;
+  wasm_memory_data : function(_para1:Pwasm_memory_t):Pbyte_t; cdecl;
+  wasm_memory_data_size : function(_para1:Pwasm_memory_t):Tsize_t; cdecl;
+  wasm_memory_size : function(_para1:Pwasm_memory_t):Twasm_memory_pages_t; cdecl;
+  wasm_memory_grow : function(_para1:Pwasm_memory_t; delta:Twasm_memory_pages_t):T_Bool;
+  wasm_extern_delete : procedure(_para1:Pwasm_extern_t); cdecl;
+  wasm_extern_copy : function(_para1:Pwasm_extern_t):Pwasm_extern_t; cdecl;
+  wasm_extern_same : function(_para1:Pwasm_extern_t; _para2:Pwasm_extern_t):T_Bool;
+  wasm_extern_get_host_info : function(_para1:Pwasm_extern_t):pointer;
+  wasm_extern_set_host_info : procedure(_para1:Pwasm_extern_t; _para2:pointer); cdecl;
+  wasm_extern_set_host_info_with_finalizer : procedure(_para1:Pwasm_extern_t; _para2:pointer; _para3: TFinalizer); cdecl;
+  wasm_extern_as_ref : function(_para1:Pwasm_extern_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_extern : function(_para1:Pwasm_ref_t):Pwasm_extern_t; cdecl;
+  wasm_extern_as_ref_const : function(_para1:Pwasm_extern_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_extern_const : function(_para1:Pwasm_ref_t):Pwasm_extern_t; cdecl;
+  wasm_extern_vec_new_empty : procedure(_out:Pwasm_extern_vec_t); cdecl;
+  wasm_extern_vec_new_uninitialized : procedure(_out:Pwasm_extern_vec_t; _para2:Tsize_t); cdecl;
+  wasm_extern_vec_new : procedure(_out:Pwasm_extern_vec_t; _para2:Tsize_t; data:Pwasm_extern_t); cdecl;
+  wasm_extern_vec_copy : procedure(_out:Pwasm_extern_vec_t; _para2:Pwasm_extern_vec_t); cdecl;
+  wasm_extern_vec_delete : procedure(_para1:Pwasm_extern_vec_t); cdecl;
+  wasm_extern_kind : function(_para1:Pwasm_extern_t):Twasm_externkind_t; cdecl;
+  wasm_extern_type : function(_para1:Pwasm_extern_t):Pwasm_externtype_t; cdecl;
+  wasm_func_as_extern : function(_para1:Pwasm_func_t):Pwasm_extern_t; cdecl;
+  wasm_global_as_extern : function(_para1:Pwasm_global_t):Pwasm_extern_t; cdecl;
+  wasm_table_as_extern : function(_para1:Pwasm_table_t):Pwasm_extern_t; cdecl;
+  wasm_memory_as_extern : function(_para1:Pwasm_memory_t):Pwasm_extern_t; cdecl;
+  wasm_extern_as_func : function(_para1:Pwasm_extern_t):Pwasm_func_t; cdecl;
+  wasm_extern_as_global : function(_para1:Pwasm_extern_t):Pwasm_global_t; cdecl;
+  wasm_extern_as_table : function(_para1:Pwasm_extern_t):Pwasm_table_t; cdecl;
+  wasm_extern_as_memory : function(_para1:Pwasm_extern_t):Pwasm_memory_t; cdecl;
+  wasm_func_as_extern_const : function(_para1:Pwasm_func_t):Pwasm_extern_t; cdecl;
+  wasm_global_as_extern_const : function(_para1:Pwasm_global_t):Pwasm_extern_t; cdecl;
+  wasm_table_as_extern_const : function(_para1:Pwasm_table_t):Pwasm_extern_t; cdecl;
+  wasm_memory_as_extern_const : function(_para1:Pwasm_memory_t):Pwasm_extern_t; cdecl;
+  wasm_extern_as_func_const : function(_para1:Pwasm_extern_t):Pwasm_func_t; cdecl;
+  wasm_extern_as_global_const : function(_para1:Pwasm_extern_t):Pwasm_global_t; cdecl;
+  wasm_extern_as_table_const : function(_para1:Pwasm_extern_t):Pwasm_table_t; cdecl;
+  wasm_extern_as_memory_const : function(_para1:Pwasm_extern_t):Pwasm_memory_t; cdecl;
+  wasm_instance_delete : procedure(_para1:Pwasm_instance_t); cdecl;
+  wasm_instance_copy : function(_para1:Pwasm_instance_t):Pwasm_instance_t; cdecl;
+  wasm_instance_same : function(_para1:Pwasm_instance_t; _para2:Pwasm_instance_t):T_Bool;
+  wasm_instance_get_host_info : function(_para1:Pwasm_instance_t):pointer;
+  wasm_instance_set_host_info : procedure(_para1:Pwasm_instance_t; _para2:pointer); cdecl;
+  wasm_instance_set_host_info_with_finalizer : procedure(_para1:Pwasm_instance_t; _para2:pointer; _para3: TFInalizer); cdecl;
+  wasm_instance_as_ref : function(_para1:Pwasm_instance_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_instance : function(_para1:Pwasm_ref_t):Pwasm_instance_t; cdecl;
+  wasm_instance_as_ref_const : function(_para1:Pwasm_instance_t):Pwasm_ref_t; cdecl;
+  wasm_ref_as_instance_const : function(_para1:Pwasm_ref_t):Pwasm_instance_t; cdecl;
+  wasm_instance_new : function(_para1:Pwasm_store_t; _para2:Pwasm_module_t; imports:Pwasm_extern_vec_t; _para4:PPwasm_trap_t):Pwasm_instance_t; cdecl;
+  wasm_instance_exports : procedure(_para1:Pwasm_instance_t; out_:Pwasm_extern_vec_t); cdecl;
+  wasi_config_new : function:Pwasi_config_t; cdecl;
+  wasi_config_set_argv : procedure(config:Pwasi_config_t; argc:Tcint; argv:Ppcchar); cdecl;
+  wasi_config_inherit_argv : procedure(config:Pwasi_config_t); cdecl;
+  wasi_config_set_env : procedure(config:Pwasi_config_t; envc:Tcint; names:Ppcchar; values:Ppcchar); cdecl;
+  wasi_config_inherit_env : procedure(config:Pwasi_config_t); cdecl;
+  wasi_config_set_stdin_file : function(config:Pwasi_config_t; path:pcchar):T_Bool;
+  wasi_config_inherit_stdin : procedure(config:Pwasi_config_t); cdecl;
+  wasi_config_set_stdout_file : function(config:Pwasi_config_t; path:pcchar):T_Bool;
+  wasi_config_inherit_stdout : procedure(config:Pwasi_config_t); cdecl;
+  wasi_config_set_stderr_file : function(config:Pwasi_config_t; path:pcchar):T_Bool;
+  wasi_config_inherit_stderr : procedure(config:Pwasi_config_t); cdecl;
+  wasi_config_preopen_dir : function(config:Pwasi_config_t; path:pchar; guest_path:pchar):T_Bool;
+  wasmtime_error_delete : procedure(error:Pwasmtime_error_t); cdecl;
+  wasmtime_error_message : procedure(error:Pwasmtime_error_t; message:Pwasm_name_t); cdecl;
+  wasmtime_config_debug_info_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_interruptable_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_consume_fuel_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_max_wasm_stack_set : procedure(_para1:Pwasm_config_t; _para2:Tsize_t); cdecl;
+  wasmtime_config_wasm_threads_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_wasm_reference_types_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_wasm_simd_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_wasm_bulk_memory_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_wasm_multi_value_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_wasm_multi_memory_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_wasm_module_linking_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_wasm_memory64_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_strategy_set : function(_para1:Pwasm_config_t; _para2:Twasmtime_strategy_t):Pwasmtime_error_t; cdecl;
+  wasmtime_config_cranelift_debug_verifier_set : procedure(_para1:Pwasm_config_t; _para2:T_Bool); cdecl;
+  wasmtime_config_cranelift_opt_level_set : procedure(_para1:Pwasm_config_t; _para2:Twasmtime_opt_level_t); cdecl;
+  wasmtime_config_profiler_set : function(_para1:Pwasm_config_t; _para2:Twasmtime_profiling_strategy_t):Pwasmtime_error_t; cdecl;
+  wasmtime_config_static_memory_maximum_size_set : procedure(_para1:Pwasm_config_t; _para2:Tuint64_t); cdecl;
+  wasmtime_config_static_memory_guard_size_set : procedure(_para1:Pwasm_config_t; _para2:Tuint64_t); cdecl;
+  wasmtime_config_dynamic_memory_guard_size_set : procedure(_para1:Pwasm_config_t; _para2:Tuint64_t); cdecl;
+  wasmtime_config_cache_config_load : function(_para1:Pwasm_config_t; _para2:pcchar):Pwasmtime_error_t; cdecl;
+  wasmtime_moduletype_delete : procedure(ty:Pwasmtime_moduletype_t); cdecl;
+  wasmtime_moduletype_imports : procedure(_para1:Pwasmtime_moduletype_t; out_:Pwasm_importtype_vec_t); cdecl;
+  wasmtime_moduletype_exports : procedure(_para1:Pwasmtime_moduletype_t; out_:Pwasm_exporttype_vec_t); cdecl;
+  wasmtime_moduletype_as_externtype : function(_para1:Pwasmtime_moduletype_t):Pwasm_externtype_t; cdecl;
+  wasmtime_externtype_as_moduletype : function(_para1:Pwasm_externtype_t):Pwasmtime_moduletype_t; cdecl;
+  wasmtime_module_new : function(engine:Pwasm_engine_t; wasm:Puint8_t; wasm_len:Tsize_t; ret:PPwasmtime_module_t):Pwasmtime_error_t; cdecl;
+  wasmtime_module_delete : procedure(m:Pwasmtime_module_t); cdecl;
+  wasmtime_module_clone : function(m:Pwasmtime_module_t):Pwasmtime_module_t; cdecl;
+  wasmtime_module_validate : function(engine:Pwasm_engine_t; wasm:Puint8_t; wasm_len:Tsize_t):Pwasmtime_error_t; cdecl;
+  wasmtime_module_type : function(_para1:Pwasmtime_module_t):Pwasmtime_moduletype_t; cdecl;
+  wasmtime_module_serialize : function(module:Pwasmtime_module_t; ret:Pwasm_byte_vec_t):Pwasmtime_error_t; cdecl;
+  wasmtime_module_deserialize : function(engine:Pwasm_engine_t; bytes:Puint8_t; bytes_len:Tsize_t; ret:PPwasmtime_module_t):Pwasmtime_error_t; cdecl;
+  wasmtime_module_deserialize_file : function(engine:Pwasm_engine_t; path:pcchar; ret:PPwasmtime_module_t):Pwasmtime_error_t; cdecl;
+  wasmtime_store_new : function(engine:Pwasm_engine_t; data:pointer; finalizer: TFinalizer):Pwasmtime_store_t; cdecl;
+  wasmtime_store_context : function(store:Pwasmtime_store_t):Pwasmtime_context_t; cdecl;
+  wasmtime_store_delete : procedure(store:Pwasmtime_store_t); cdecl;
+  wasmtime_context_get_data : function(context:Pwasmtime_context_t):pointer;
+  wasmtime_context_set_data : procedure(context:Pwasmtime_context_t; data:pointer); cdecl;
+  wasmtime_context_gc : procedure(context:Pwasmtime_context_t); cdecl;
+  wasmtime_context_add_fuel : function(store:Pwasmtime_context_t; fuel:Tuint64_t):Pwasmtime_error_t; cdecl;
+  wasmtime_context_fuel_consumed : function(context:Pwasmtime_context_t; fuel:Puint64_t):T_Bool;
+  wasmtime_context_consume_fuel : function(context:Pwasmtime_context_t; fuel:Tuint64_t; remaining:Puint64_t):Pwasmtime_error_t; cdecl;
+  wasmtime_context_set_wasi : function(context:Pwasmtime_context_t; wasi:Pwasi_config_t):Pwasmtime_error_t; cdecl;
+  wasmtime_interrupt_handle_new : function(context:Pwasmtime_context_t):Pwasmtime_interrupt_handle_t; cdecl;
+  wasmtime_interrupt_handle_interrupt : procedure(handle:Pwasmtime_interrupt_handle_t); cdecl;
+  wasmtime_interrupt_handle_delete : procedure(handle:Pwasmtime_interrupt_handle_t); cdecl;
+  wasmtime_extern_delete : procedure(val:Pwasmtime_extern_t); cdecl;
+  wasmtime_extern_type : function(context:Pwasmtime_context_t; val:Pwasmtime_extern_t):Pwasm_externtype_t; cdecl;
+  wasmtime_externref_new : function(data:pointer; finalizer: TFInalizer):Pwasmtime_externref_t; cdecl;
+  wasmtime_externref_data : function(data:Pwasmtime_externref_t):pointer;
+  wasmtime_externref_clone : function(ref:Pwasmtime_externref_t):Pwasmtime_externref_t; cdecl;
+  wasmtime_externref_delete : procedure(ref:Pwasmtime_externref_t); cdecl;
+  wasmtime_externref_from_raw : function(context:Pwasmtime_context_t; raw:Tsize_t):Pwasmtime_externref_t; cdecl;
+  wasmtime_externref_to_raw : function(context:Pwasmtime_context_t; ref:Pwasmtime_externref_t):Tsize_t; cdecl;
+  wasmtime_val_delete : procedure(val:Pwasmtime_val_t); cdecl;
+  wasmtime_val_copy : procedure(dst:Pwasmtime_val_t; src:Pwasmtime_val_t); cdecl;
+  wasmtime_func_new : procedure(store:Pwasmtime_context_t; _type:Pwasm_functype_t; callback:Twasmtime_func_callback_t; env:pointer; finalizer:TFinalizer; 
+      ret:Pwasmtime_func_t); cdecl;
+  wasmtime_func_new_unchecked : procedure(store:Pwasmtime_context_t; _type:Pwasm_functype_t; callback:Twasmtime_func_unchecked_callback_t; env:pointer; finalizer: TFinalizer; 
+      ret:Pwasmtime_func_t); cdecl;
+  wasmtime_func_type : function(store:Pwasmtime_context_t; func:Pwasmtime_func_t):Pwasm_functype_t; cdecl;
+  wasmtime_func_call : function(store:Pwasmtime_context_t; func:Pwasmtime_func_t; args:Pwasmtime_val_t; nargs:Tsize_t; results:Pwasmtime_val_t; 
+      nresults:Tsize_t; trap:PPwasm_trap_t):Pwasmtime_error_t; cdecl;
+  wasmtime_func_call_unchecked : function(store:Pwasmtime_context_t; func:Pwasmtime_func_t; args_and_results:Pwasmtime_val_raw_t):Pwasm_trap_t; cdecl;
+  wasmtime_caller_export_get : function(caller:Pwasmtime_caller_t; name:pcchar; name_len:Tsize_t; item:Pwasmtime_extern_t):T_Bool;
+  wasmtime_caller_context : function(caller:Pwasmtime_caller_t):Pwasmtime_context_t; cdecl;
+  wasmtime_func_from_raw : procedure(context:Pwasmtime_context_t; raw:Tsize_t; ret:Pwasmtime_func_t); cdecl;
+  wasmtime_func_to_raw : function(context:Pwasmtime_context_t; func:Pwasmtime_func_t):Tsize_t; cdecl;
+  wasmtime_global_new : function(store:Pwasmtime_context_t; _type:Pwasm_globaltype_t; val:Pwasmtime_val_t; ret:Pwasmtime_global_t):Pwasmtime_error_t; cdecl;
+  wasmtime_global_type : function(store:Pwasmtime_context_t; global:Pwasmtime_global_t):Pwasm_globaltype_t; cdecl;
+  wasmtime_global_get : procedure(store:Pwasmtime_context_t; global:Pwasmtime_global_t; out_:Pwasmtime_val_t); cdecl;
+  wasmtime_global_set : function(store:Pwasmtime_context_t; global:Pwasmtime_global_t; val:Pwasmtime_val_t):Pwasmtime_error_t; cdecl;
+  wasmtime_instancetype_delete : procedure(ty:Pwasmtime_instancetype_t); cdecl;
+  wasmtime_instancetype_exports : procedure(_para1:Pwasmtime_instancetype_t; out_:Pwasm_exporttype_vec_t); cdecl;
+  wasmtime_instancetype_as_externtype : function(_para1:Pwasmtime_instancetype_t):Pwasm_externtype_t; cdecl;
+  wasmtime_externtype_as_instancetype : function(_para1:Pwasm_externtype_t):Pwasmtime_instancetype_t; cdecl;
+  wasmtime_instance_new : function(store:Pwasmtime_context_t; module:Pwasmtime_module_t; imports:Pwasmtime_extern_t; nimports:Tsize_t; instance:Pwasmtime_instance_t; 
+      trap:PPwasm_trap_t):Pwasmtime_error_t; cdecl;
+  wasmtime_instance_type : function(store:Pwasmtime_context_t; instance:Pwasmtime_instance_t):Pwasmtime_instancetype_t; cdecl;
+  wasmtime_instance_export_get : function(store:Pwasmtime_context_t; instance:Pwasmtime_instance_t; name:pchar; name_len:Tsize_t; item:Pwasmtime_extern_t):T_Bool;
+  wasmtime_instance_export_nth : function(store:Pwasmtime_context_t; instance:Pwasmtime_instance_t; index:Tsize_t; name:Ppcchar; name_len:Psize_t; 
+      item:Pwasmtime_extern_t):T_Bool;
+  wasmtime_linker_new : function(engine:Pwasm_engine_t):Pwasmtime_linker_t; cdecl;
+  wasmtime_linker_delete : procedure(linker:Pwasmtime_linker_t); cdecl;
+  wasmtime_linker_allow_shadowing : procedure(linker:Pwasmtime_linker_t; allow_shadowing:T_Bool); cdecl;
+  wasmtime_linker_define : function(linker:Pwasmtime_linker_t; module:pcchar; module_len:Tsize_t; name:pcchar; name_len:Tsize_t; 
+      item:Pwasmtime_extern_t):Pwasmtime_error_t; cdecl;
+  wasmtime_linker_define_func : function(linker:Pwasmtime_linker_t; module:pcchar; module_len:Tsize_t; name:pcchar; name_len:Tsize_t; 
+      ty:Pwasm_functype_t; cb:Twasmtime_func_callback_t; data:pointer; finalizer: TFInalizer):Pwasmtime_error_t; cdecl;
+  wasmtime_linker_define_func_unchecked : function(linker:Pwasmtime_linker_t; module:pcchar; module_len:Tsize_t; name:pcchar; name_len:Tsize_t; 
+      ty:Pwasm_functype_t; cb:Twasmtime_func_unchecked_callback_t; data:pointer; finalizer: TFInalizer):Pwasmtime_error_t; cdecl;
+  wasmtime_linker_define_wasi : function(linker:Pwasmtime_linker_t):Pwasmtime_error_t; cdecl;
+  wasmtime_linker_define_instance : function(linker:Pwasmtime_linker_t; store:Pwasmtime_context_t; name:pcchar; name_len:Tsize_t; instance:Pwasmtime_instance_t):Pwasmtime_error_t; cdecl;
+  wasmtime_linker_instantiate : function(linker:Pwasmtime_linker_t; store:Pwasmtime_context_t; module:Pwasmtime_module_t; instance:Pwasmtime_instance_t; trap:PPwasm_trap_t):Pwasmtime_error_t; cdecl;
+  wasmtime_linker_module : function(linker:Pwasmtime_linker_t; store:Pwasmtime_context_t; name:pcchar; name_len:Tsize_t; module:Pwasmtime_module_t):Pwasmtime_error_t; cdecl;
+  wasmtime_linker_get_default : function(linker:Pwasmtime_linker_t; store:Pwasmtime_context_t; name:pcchar; name_len:Tsize_t; func:Pwasmtime_func_t):Pwasmtime_error_t; cdecl;
+  wasmtime_linker_get : function(linker:Pwasmtime_linker_t; store:Pwasmtime_context_t; module:pcchar; module_len:Tsize_t; name:pcchar; 
+      name_len:Tsize_t; item:Pwasmtime_extern_t):T_Bool;
+  wasmtime_memorytype_new : function(min:Tuint64_t; max_present:T_Bool; max:Tuint64_t; is_64:T_Bool):Pwasm_memorytype_t; cdecl;
+  wasmtime_memorytype_minimum : function(ty:Pwasm_memorytype_t):Tuint64_t; cdecl;
+  wasmtime_memorytype_maximum : function(ty:Pwasm_memorytype_t; max:Puint64_t):T_Bool;
+  wasmtime_memorytype_is64 : function(ty:Pwasm_memorytype_t):T_Bool;
+  wasmtime_memory_new : function(store:Pwasmtime_context_t; ty:Pwasm_memorytype_t; ret:Pwasmtime_memory_t):Pwasmtime_error_t; cdecl;
+  wasmtime_memory_type : function(store:Pwasmtime_context_t; memory:Pwasmtime_memory_t):Pwasm_memorytype_t; cdecl;
+  wasmtime_memory_data : function(store:Pwasmtime_context_t; memory:Pwasmtime_memory_t):Puint8_t; cdecl;
+  wasmtime_memory_data_size : function(store:Pwasmtime_context_t; memory:Pwasmtime_memory_t):Tsize_t; cdecl;
+  wasmtime_memory_size : function(store:Pwasmtime_context_t; memory:Pwasmtime_memory_t):Tuint64_t; cdecl;
+  wasmtime_memory_grow : function(store:Pwasmtime_context_t; memory:Pwasmtime_memory_t; delta:Tuint64_t; prev_size:Puint64_t):Pwasmtime_error_t; cdecl;
+  wasmtime_table_new : function(store:Pwasmtime_context_t; ty:Pwasm_tabletype_t; init:Pwasmtime_val_t; table:Pwasmtime_table_t):Pwasmtime_error_t; cdecl;
+  wasmtime_table_type : function(store:Pwasmtime_context_t; table:Pwasmtime_table_t):Pwasm_tabletype_t; cdecl;
+  wasmtime_table_get : function(store:Pwasmtime_context_t; table:Pwasmtime_table_t; index:Tuint32_t; val:Pwasmtime_val_t):T_Bool;
+  wasmtime_table_set : function(store:Pwasmtime_context_t; table:Pwasmtime_table_t; index:Tuint32_t; value:Pwasmtime_val_t):Pwasmtime_error_t; cdecl;
+  wasmtime_table_size : function(store:Pwasmtime_context_t; table:Pwasmtime_table_t):Tuint32_t; cdecl;
+  wasmtime_table_grow : function(store:Pwasmtime_context_t; table:Pwasmtime_table_t; delta:Tuint32_t; init:Pwasmtime_val_t; prev_size:Puint32_t):Pwasmtime_error_t; cdecl;
+  wasmtime_trap_new : function(msg:pcchar; msg_len:Tsize_t):Pwasm_trap_t; cdecl;
+  wasmtime_trap_code : function(_para1:Pwasm_trap_t; code:Pwasmtime_trap_code_t):T_Bool;
+  wasmtime_trap_exit_status : function(_para1:Pwasm_trap_t; status:pcint):T_Bool;
+  wasmtime_frame_func_name : function(_para1:Pwasm_frame_t):Pwasm_name_t; cdecl;
+  wasmtime_frame_module_name : function(_para1:Pwasm_frame_t):Pwasm_name_t; cdecl;
+  wasmtime_wat2wasm : function(wat:pcchar; wat_len:Tsize_t; ret:Pwasm_byte_vec_t):Pwasmtime_error_t; cdecl;
+  wasi_config_delete : procedure(_para1:Pwasi_config_t); cdecl;
+
+// Converted Inline functions
+
+function wasm_valkind_is_num(k: twasm_valkind_t) : boolean; 
+function wasm_valkind_is_ref(k: twasm_valkind_t) : boolean; 
+function wasm_valtype_is_num(t: Pwasm_valtype_t) : Boolean;
+function wasm_valtype_is_ref(t: Pwasm_valtype_t) : Boolean;
+
+function wasm_valtype_new_i32 : Pwasm_valtype_t;
+function wasm_valtype_new_i64 : Pwasm_valtype_t;
+function wasm_valtype_new_f32 : Pwasm_valtype_t;
+function wasm_valtype_new_f64 : Pwasm_valtype_t;
+function wasm_valtype_new_anyref : Pwasm_valtype_t;
+function wasm_valtype_new_funcref : Pwasm_valtype_t;
+
+function wasm_functype_new_0_0 : Pwasm_functype_t;
+function wasm_functype_new_1_0 (P : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_2_0 (P1,p2 : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_3_0 (P1,p2,p3 : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_0_1 (R : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_1_1 (P,R : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_2_1 (P1,P2,R : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_3_1 (P1,P2,P3,R : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_0_2 (R1,R2 : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_1_2 (P,R1,R2 : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_2_2 (P1,P2,R1,R2 : pwasm_valtype_t): Pwasm_functype_t;
+function wasm_functype_new_3_2 (P1,P2,P3,R1,R2 : pwasm_valtype_t): Pwasm_functype_t;
+procedure wasm_val_init_ptr(out_: Pwasm_val_t; P : Pointer);
+function wasm_val_ptr(val : Pwasm_val_t) : Pointer;
+
+
+procedure LoadWasmTime(const lib : string);
+procedure FreeWasmTime;
+function WasmTimeLoaded : Boolean;
+
+implementation
+
+uses
+  SysUtils, dynlibs;
+
+{ Converted static functions }
+
+function wasm_valkind_is_num(k: twasm_valkind_t) : boolean; 
+
+begin
+  result:= k < ord(WASM_ANYREF);
+end;
+
+function wasm_valkind_is_ref(k: twasm_valkind_t) : boolean; 
+begin
+  Result:= k >= ord(WASM_ANYREF);
+end;
+
+function wasm_valtype_is_num(t: Pwasm_valtype_t) : Boolean;
+
+begin
+  Result:=wasm_valkind_is_num(wasm_valtype_kind(t)); 
+end;
+
+function wasm_valtype_is_ref(t: Pwasm_valtype_t) : Boolean;
+ 
+begin
+  Result:=wasm_valkind_is_ref(wasm_valtype_kind(t));
+end;
+
+
+function wasm_valtype_new_i32 : Pwasm_valtype_t;
+begin
+  result:=wasm_valtype_new(Ord(WASM_I32));
+end;
+
+function wasm_valtype_new_i64 : Pwasm_valtype_t;
+begin
+  result:=wasm_valtype_new(Ord(WASM_I64));
+end;
+
+function wasm_valtype_new_f32 : Pwasm_valtype_t;
+begin
+  result:=wasm_valtype_new(Ord(WASM_F32));
+end;
+
+function wasm_valtype_new_f64 : Pwasm_valtype_t;
+begin
+  result:=wasm_valtype_new(Ord(WASM_F64));
+end;
+
+function wasm_valtype_new_anyref : Pwasm_valtype_t;
+begin
+  result:=wasm_valtype_new(Ord(WASM_ANYREF));
+end;
+
+function wasm_valtype_new_funcref : Pwasm_valtype_t;
+begin
+  result:=wasm_valtype_new(Ord(WASM_FUNCREF));
+end;
+
+function wasm_functype_new_0_0 : Pwasm_functype_t;
+
+var
+ params, results : Twasm_valtype_vec_t ;
+
+begin
+  wasm_valtype_vec_new_empty(@params);
+  wasm_valtype_vec_new_empty(@results);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+function wasm_functype_new_1_0 (P : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  ps : Array[0..0] of pwasm_valtype_t;
+
+begin
+  ps[0]:=P;
+  wasm_valtype_vec_new(@params,1,@ps);
+  wasm_valtype_vec_new_empty(@results);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+function wasm_functype_new_2_0 (P1,P2 : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  ps : Array[0..1] of pwasm_valtype_t;
+
+begin
+  ps[0]:=P1;
+  ps[1]:=P2;
+  wasm_valtype_vec_new(@params,2,@ps);
+  wasm_valtype_vec_new_empty(@results);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+function wasm_functype_new_3_0 (P1,p2,p3 : pwasm_valtype_t): Pwasm_functype_t;
+var
+  params, results : Twasm_valtype_vec_t ;
+  ps : Array[0..2] of pwasm_valtype_t;
+
+begin
+  ps[0]:=P1;
+  ps[1]:=P2;
+  ps[2]:=P3;
+  wasm_valtype_vec_new(@params,3,@ps);
+  wasm_valtype_vec_new_empty(@results);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+function wasm_functype_new_0_1 (R : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  rs : Array[0..0] of pwasm_valtype_t;
+
+begin
+  rs[0]:=R;
+  wasm_valtype_vec_new_empty(@params);
+  wasm_valtype_vec_new(@results,1,@rs);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+function wasm_functype_new_0_2 (R1,R2 : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  rs : Array[0..1] of pwasm_valtype_t;
+
+begin
+  rs[0]:=R1;
+  rs[1]:=R2;
+  wasm_valtype_vec_new_empty(@params);
+  wasm_valtype_vec_new(@results,2,@rs);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+
+function wasm_functype_new_1_1 (P,R : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  ps,rs : Array[0..0] of pwasm_valtype_t;
+
+begin
+  ps[0]:=P;
+  rs[0]:=R;
+  wasm_valtype_vec_new(@params,1,@ps);
+  wasm_valtype_vec_new(@results,1,@rs);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+function wasm_functype_new_2_1 (P1,P2,R : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  ps : Array[0..1] of pwasm_valtype_t;
+  rs : Array[0..0] of pwasm_valtype_t;
+
+begin
+  ps[0]:=P1;
+  ps[1]:=P2;
+  rs[0]:=R;
+  wasm_valtype_vec_new(@params,2,@ps);
+  wasm_valtype_vec_new(@results,1,@rs);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+
+function wasm_functype_new_1_2 (P,R1,R2 : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  ps : Array[0..0] of pwasm_valtype_t;
+  rs : Array[0..1] of pwasm_valtype_t;
+
+begin
+  ps[0]:=P;
+  rs[0]:=R1;
+  rs[1]:=R2;
+  wasm_valtype_vec_new(@params,1,@ps);
+  wasm_valtype_vec_new(@results,2,@rs);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+function wasm_functype_new_2_2 (P1,P2,R1,R2 : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  ps : Array[0..1] of pwasm_valtype_t;
+  rs : Array[0..1] of pwasm_valtype_t;
+
+begin
+  ps[0]:=P1;
+  ps[1]:=P2;
+  rs[0]:=R1;
+  rs[1]:=R2;
+  wasm_valtype_vec_new(@params,2,@ps);
+  wasm_valtype_vec_new(@results,2,@rs);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+function wasm_functype_new_3_2 (P1,P2,P3,R1,R2 : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  ps : Array[0..2] of pwasm_valtype_t;
+  rs : Array[0..1] of pwasm_valtype_t;
+
+begin
+  ps[0]:=P1;
+  ps[1]:=P2;
+  ps[2]:=P3;
+  rs[0]:=R1;
+  rs[1]:=R2;
+  wasm_valtype_vec_new(@params,3,@ps);
+  wasm_valtype_vec_new(@results,2,@rs);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+
+
+function wasm_functype_new_3_1 (P1,P2,P3,R : pwasm_valtype_t): Pwasm_functype_t;
+
+var
+  params, results : Twasm_valtype_vec_t ;
+  ps : Array[0..2] of pwasm_valtype_t;
+  rs : Array[0..0] of pwasm_valtype_t;
+
+begin
+  ps[0]:=P1;
+  ps[1]:=P2;
+  ps[2]:=P3;
+  rs[0]:=R;
+  wasm_valtype_vec_new(@params,3,@ps);
+  wasm_valtype_vec_new(@results,1,@rs);
+  Result:=wasm_functype_new(@params, @results);
+end;
+
+procedure wasm_val_init_ptr(out_: Pwasm_val_t; P : Pointer);
+
+begin
+  out_^.kind :=Ord(WASM_I64);
+  out_^.of_.i64 := PtrInt(p);
+end;
+
+function wasm_val_ptr(val : Pwasm_val_t) : Pointer;
+
+begin
+  Result:=Pointer(PtrInt(val^.of_.i64));
+end;
+
+{ ----------------------------------------------------------------------
+  Load library
+  ----------------------------------------------------------------------}
+
+
+var
+  hlib : tlibhandle;
+
+
+function WasmTimeLoaded : Boolean;
+
+begin
+  Result:=(Hlib<>NilHandle)
+end;
+procedure FreeWasmTime;
+
+begin
+  if WasmTimeLoaded then
+    begin
+    FreeLibrary(hlib);
+    HLib:=NilHandle;
+    end;
+  wasm_byte_vec_new_empty:=nil;
+  wasm_byte_vec_new_uninitialized:=nil;
+  wasm_byte_vec_new:=nil;
+  wasm_byte_vec_copy:=nil;
+  wasm_byte_vec_delete:=nil;
+  wasm_config_delete:=nil;
+  wasm_config_new:=nil;
+  wasm_engine_delete:=nil;
+  wasm_engine_new:=nil;
+  wasm_engine_new_with_config:=nil;
+  wasm_store_delete:=nil;
+  wasm_store_new:=nil;
+  wasm_valtype_delete:=nil;
+  wasm_valtype_vec_new_empty:=nil;
+  wasm_valtype_vec_new_uninitialized:=nil;
+  wasm_valtype_vec_new:=nil;
+  wasm_valtype_vec_copy:=nil;
+  wasm_valtype_vec_delete:=nil;
+  wasm_valtype_copy:=nil;
+  wasm_valtype_new:=nil;
+  wasm_valtype_kind:=nil;
+  wasm_functype_delete:=nil;
+  wasm_functype_vec_new_empty:=nil;
+  wasm_functype_vec_new_uninitialized:=nil;
+  wasm_functype_vec_new:=nil;
+  wasm_functype_vec_copy:=nil;
+  wasm_functype_vec_delete:=nil;
+  wasm_functype_copy:=nil;
+  wasm_functype_new:=nil;
+  wasm_functype_params:=nil;
+  wasm_functype_results:=nil;
+  wasm_globaltype_delete:=nil;
+  wasm_globaltype_vec_new_empty:=nil;
+  wasm_globaltype_vec_new_uninitialized:=nil;
+  wasm_globaltype_vec_new:=nil;
+  wasm_globaltype_vec_copy:=nil;
+  wasm_globaltype_vec_delete:=nil;
+  wasm_globaltype_copy:=nil;
+  wasm_globaltype_new:=nil;
+  wasm_globaltype_content:=nil;
+  wasm_globaltype_mutability:=nil;
+  wasm_tabletype_delete:=nil;
+  wasm_tabletype_vec_new_empty:=nil;
+  wasm_tabletype_vec_new_uninitialized:=nil;
+  wasm_tabletype_vec_new:=nil;
+  wasm_tabletype_vec_copy:=nil;
+  wasm_tabletype_vec_delete:=nil;
+  wasm_tabletype_copy:=nil;
+  wasm_tabletype_new:=nil;
+  wasm_tabletype_element:=nil;
+  wasm_tabletype_limits:=nil;
+  wasm_memorytype_delete:=nil;
+  wasm_memorytype_vec_new_empty:=nil;
+  wasm_memorytype_vec_new_uninitialized:=nil;
+  wasm_memorytype_vec_new:=nil;
+  wasm_memorytype_vec_copy:=nil;
+  wasm_memorytype_vec_delete:=nil;
+  wasm_memorytype_copy:=nil;
+  wasm_memorytype_new:=nil;
+  wasm_memorytype_limits:=nil;
+  wasm_externtype_delete:=nil;
+  wasm_externtype_vec_new_empty:=nil;
+  wasm_externtype_vec_new_uninitialized:=nil;
+  wasm_externtype_vec_new:=nil;
+  wasm_externtype_vec_copy:=nil;
+  wasm_externtype_vec_delete:=nil;
+  wasm_externtype_copy:=nil;
+  wasm_externtype_kind:=nil;
+  wasm_functype_as_externtype:=nil;
+  wasm_globaltype_as_externtype:=nil;
+  wasm_tabletype_as_externtype:=nil;
+  wasm_memorytype_as_externtype:=nil;
+  wasm_externtype_as_functype:=nil;
+  wasm_externtype_as_globaltype:=nil;
+  wasm_externtype_as_tabletype:=nil;
+  wasm_externtype_as_memorytype:=nil;
+  wasm_functype_as_externtype_const:=nil;
+  wasm_globaltype_as_externtype_const:=nil;
+  wasm_tabletype_as_externtype_const:=nil;
+  wasm_memorytype_as_externtype_const:=nil;
+  wasm_externtype_as_functype_const:=nil;
+  wasm_externtype_as_globaltype_const:=nil;
+  wasm_externtype_as_tabletype_const:=nil;
+  wasm_externtype_as_memorytype_const:=nil;
+  wasm_importtype_delete:=nil;
+  wasm_importtype_vec_new_empty:=nil;
+  wasm_importtype_vec_new_uninitialized:=nil;
+  wasm_importtype_vec_new:=nil;
+  wasm_importtype_vec_copy:=nil;
+  wasm_importtype_vec_delete:=nil;
+  wasm_importtype_copy:=nil;
+  wasm_importtype_new:=nil;
+  wasm_importtype_module:=nil;
+  wasm_importtype_name:=nil;
+  wasm_importtype_type:=nil;
+  wasm_exporttype_delete:=nil;
+  wasm_exporttype_vec_new_empty:=nil;
+  wasm_exporttype_vec_new_uninitialized:=nil;
+  wasm_exporttype_vec_new:=nil;
+  wasm_exporttype_vec_copy:=nil;
+  wasm_exporttype_vec_delete:=nil;
+  wasm_exporttype_copy:=nil;
+  wasm_exporttype_new:=nil;
+  wasm_exporttype_name:=nil;
+  wasm_exporttype_type:=nil;
+  wasm_val_delete:=nil;
+  wasm_val_copy:=nil;
+  wasm_val_vec_new_empty:=nil;
+  wasm_val_vec_new_uninitialized:=nil;
+  wasm_val_vec_new:=nil;
+  wasm_val_vec_copy:=nil;
+  wasm_val_vec_delete:=nil;
+  wasm_ref_delete:=nil;
+  wasm_ref_copy:=nil;
+  wasm_ref_same:=nil;
+  wasm_ref_get_host_info:=nil;
+  wasm_ref_set_host_info:=nil;
+  wasm_ref_set_host_info_with_finalizer:=nil;
+  wasm_frame_delete:=nil;
+  wasm_frame_vec_new_empty:=nil;
+  wasm_frame_vec_new_uninitialized:=nil;
+  wasm_frame_vec_new:=nil;
+  wasm_frame_vec_copy:=nil;
+  wasm_frame_vec_delete:=nil;
+  wasm_frame_copy:=nil;
+  wasm_frame_instance:=nil;
+  wasm_frame_func_index:=nil;
+  wasm_frame_func_offset:=nil;
+  wasm_frame_module_offset:=nil;
+  wasm_trap_delete:=nil;
+  wasm_trap_copy:=nil;
+  wasm_trap_same:=nil;
+  wasm_trap_get_host_info:=nil;
+  wasm_trap_set_host_info:=nil;
+  wasm_trap_set_host_info_with_finalizer:=nil;
+  wasm_trap_as_ref:=nil;
+  wasm_ref_as_trap:=nil;
+  wasm_trap_as_ref_const:=nil;
+  wasm_ref_as_trap_const:=nil;
+  wasm_trap_new:=nil;
+  wasm_trap_message:=nil;
+  wasm_trap_origin:=nil;
+  wasm_trap_trace:=nil;
+  wasm_foreign_delete:=nil;
+  wasm_foreign_copy:=nil;
+  wasm_foreign_same:=nil;
+  wasm_foreign_get_host_info:=nil;
+  wasm_foreign_set_host_info:=nil;
+  wasm_foreign_set_host_info_with_finalizer:=nil;
+  wasm_foreign_as_ref:=nil;
+  wasm_ref_as_foreign:=nil;
+  wasm_foreign_as_ref_const:=nil;
+  wasm_ref_as_foreign_const:=nil;
+  wasm_foreign_new:=nil;
+  wasm_module_delete:=nil;
+  wasm_module_copy:=nil;
+  wasm_module_same:=nil;
+  wasm_module_get_host_info:=nil;
+  wasm_module_set_host_info:=nil;
+  wasm_module_set_host_info_with_finalizer:=nil;
+  wasm_module_as_ref:=nil;
+  wasm_ref_as_module:=nil;
+  wasm_module_as_ref_const:=nil;
+  wasm_ref_as_module_const:=nil;
+  wasm_shared_module_delete:=nil;
+  wasm_module_share:=nil;
+  wasm_module_obtain:=nil;
+  wasm_module_new:=nil;
+  wasm_module_validate:=nil;
+  wasm_module_imports:=nil;
+  wasm_module_exports:=nil;
+  wasm_module_serialize:=nil;
+  wasm_module_deserialize:=nil;
+  wasm_func_delete:=nil;
+  wasm_func_copy:=nil;
+  wasm_func_same:=nil;
+  wasm_func_get_host_info:=nil;
+  wasm_func_set_host_info:=nil;
+  wasm_func_set_host_info_with_finalizer:=nil;
+  wasm_func_as_ref:=nil;
+  wasm_ref_as_func:=nil;
+  wasm_func_as_ref_const:=nil;
+  wasm_ref_as_func_const:=nil;
+  wasm_func_new:=nil;
+  wasm_func_new_with_env:=nil;
+  wasm_func_type:=nil;
+  wasm_func_param_arity:=nil;
+  wasm_func_result_arity:=nil;
+  wasm_func_call:=nil;
+  wasm_global_delete:=nil;
+  wasm_global_copy:=nil;
+  wasm_global_same:=nil;
+  wasm_global_get_host_info:=nil;
+  wasm_global_set_host_info:=nil;
+  wasm_global_set_host_info_with_finalizer:=nil;
+  wasm_global_as_ref:=nil;
+  wasm_ref_as_global:=nil;
+  wasm_global_as_ref_const:=nil;
+  wasm_ref_as_global_const:=nil;
+  wasm_global_new:=nil;
+  wasm_global_type:=nil;
+  wasm_global_get:=nil;
+  wasm_global_set:=nil;
+  wasm_table_delete:=nil;
+  wasm_table_copy:=nil;
+  wasm_table_same:=nil;
+  wasm_table_get_host_info:=nil;
+  wasm_table_set_host_info:=nil;
+  wasm_table_set_host_info_with_finalizer:=nil;
+  wasm_table_as_ref:=nil;
+  wasm_ref_as_table:=nil;
+  wasm_table_as_ref_const:=nil;
+  wasm_ref_as_table_const:=nil;
+  wasm_table_new:=nil;
+  wasm_table_type:=nil;
+  wasm_table_get:=nil;
+  wasm_table_set:=nil;
+  wasm_table_size:=nil;
+  wasm_table_grow:=nil;
+  wasm_memory_delete:=nil;
+  wasm_memory_copy:=nil;
+  wasm_memory_same:=nil;
+  wasm_memory_get_host_info:=nil;
+  wasm_memory_set_host_info:=nil;
+  wasm_memory_set_host_info_with_finalizer:=nil;
+  wasm_memory_as_ref:=nil;
+  wasm_ref_as_memory:=nil;
+  wasm_memory_as_ref_const:=nil;
+  wasm_ref_as_memory_const:=nil;
+  wasm_memory_new:=nil;
+  wasm_memory_type:=nil;
+  wasm_memory_data:=nil;
+  wasm_memory_data_size:=nil;
+  wasm_memory_size:=nil;
+  wasm_memory_grow:=nil;
+  wasm_extern_delete:=nil;
+  wasm_extern_copy:=nil;
+  wasm_extern_same:=nil;
+  wasm_extern_get_host_info:=nil;
+  wasm_extern_set_host_info:=nil;
+  wasm_extern_set_host_info_with_finalizer:=nil;
+  wasm_extern_as_ref:=nil;
+  wasm_ref_as_extern:=nil;
+  wasm_extern_as_ref_const:=nil;
+  wasm_ref_as_extern_const:=nil;
+  wasm_extern_vec_new_empty:=nil;
+  wasm_extern_vec_new_uninitialized:=nil;
+  wasm_extern_vec_new:=nil;
+  wasm_extern_vec_copy:=nil;
+  wasm_extern_vec_delete:=nil;
+  wasm_extern_kind:=nil;
+  wasm_extern_type:=nil;
+  wasm_func_as_extern:=nil;
+  wasm_global_as_extern:=nil;
+  wasm_table_as_extern:=nil;
+  wasm_memory_as_extern:=nil;
+  wasm_extern_as_func:=nil;
+  wasm_extern_as_global:=nil;
+  wasm_extern_as_table:=nil;
+  wasm_extern_as_memory:=nil;
+  wasm_func_as_extern_const:=nil;
+  wasm_global_as_extern_const:=nil;
+  wasm_table_as_extern_const:=nil;
+  wasm_memory_as_extern_const:=nil;
+  wasm_extern_as_func_const:=nil;
+  wasm_extern_as_global_const:=nil;
+  wasm_extern_as_table_const:=nil;
+  wasm_extern_as_memory_const:=nil;
+  wasm_instance_delete:=nil;
+  wasm_instance_copy:=nil;
+  wasm_instance_same:=nil;
+  wasm_instance_get_host_info:=nil;
+  wasm_instance_set_host_info:=nil;
+  wasm_instance_set_host_info_with_finalizer:=nil;
+  wasm_instance_as_ref:=nil;
+  wasm_ref_as_instance:=nil;
+  wasm_instance_as_ref_const:=nil;
+  wasm_ref_as_instance_const:=nil;
+  wasm_instance_new:=nil;
+  wasm_instance_exports:=nil;
+  wasi_config_delete:=nil;
+  wasi_config_new:=nil;
+  wasi_config_set_argv:=nil;
+  wasi_config_inherit_argv:=nil;
+  wasi_config_set_env:=nil;
+  wasi_config_inherit_env:=nil;
+  wasi_config_set_stdin_file:=nil;
+  wasi_config_inherit_stdin:=nil;
+  wasi_config_set_stdout_file:=nil;
+  wasi_config_inherit_stdout:=nil;
+  wasi_config_set_stderr_file:=nil;
+  wasi_config_inherit_stderr:=nil;
+  wasi_config_preopen_dir:=nil;
+  wasmtime_error_delete:=nil;
+  wasmtime_error_message:=nil;
+  wasmtime_config_debug_info_set:=nil;
+  wasmtime_config_interruptable_set:=nil;
+  wasmtime_config_consume_fuel_set:=nil;
+  wasmtime_config_max_wasm_stack_set:=nil;
+  wasmtime_config_wasm_threads_set:=nil;
+  wasmtime_config_wasm_reference_types_set:=nil;
+  wasmtime_config_wasm_simd_set:=nil;
+  wasmtime_config_wasm_bulk_memory_set:=nil;
+  wasmtime_config_wasm_multi_value_set:=nil;
+  wasmtime_config_wasm_multi_memory_set:=nil;
+  wasmtime_config_wasm_module_linking_set:=nil;
+  wasmtime_config_wasm_memory64_set:=nil;
+  wasmtime_config_strategy_set:=nil;
+  wasmtime_config_cranelift_debug_verifier_set:=nil;
+  wasmtime_config_cranelift_opt_level_set:=nil;
+  wasmtime_config_profiler_set:=nil;
+  wasmtime_config_static_memory_maximum_size_set:=nil;
+  wasmtime_config_static_memory_guard_size_set:=nil;
+  wasmtime_config_dynamic_memory_guard_size_set:=nil;
+  wasmtime_config_cache_config_load:=nil;
+  wasmtime_moduletype_delete:=nil;
+  wasmtime_moduletype_imports:=nil;
+  wasmtime_moduletype_exports:=nil;
+  wasmtime_moduletype_as_externtype:=nil;
+  wasmtime_externtype_as_moduletype:=nil;
+  wasmtime_module_new:=nil;
+  wasmtime_module_delete:=nil;
+  wasmtime_module_clone:=nil;
+  wasmtime_module_validate:=nil;
+  wasmtime_module_type:=nil;
+  wasmtime_module_serialize:=nil;
+  wasmtime_module_deserialize:=nil;
+  wasmtime_module_deserialize_file:=nil;
+  wasmtime_store_new:=nil;
+  wasmtime_store_context:=nil;
+  wasmtime_store_delete:=nil;
+  wasmtime_context_get_data:=nil;
+  wasmtime_context_set_data:=nil;
+  wasmtime_context_gc:=nil;
+  wasmtime_context_add_fuel:=nil;
+  wasmtime_context_fuel_consumed:=nil;
+  wasmtime_context_consume_fuel:=nil;
+  wasmtime_context_set_wasi:=nil;
+  wasmtime_interrupt_handle_new:=nil;
+  wasmtime_interrupt_handle_interrupt:=nil;
+  wasmtime_interrupt_handle_delete:=nil;
+  wasmtime_extern_delete:=nil;
+  wasmtime_extern_type:=nil;
+  wasmtime_externref_new:=nil;
+  wasmtime_externref_data:=nil;
+  wasmtime_externref_clone:=nil;
+  wasmtime_externref_delete:=nil;
+  wasmtime_externref_from_raw:=nil;
+  wasmtime_externref_to_raw:=nil;
+  wasmtime_val_delete:=nil;
+  wasmtime_val_copy:=nil;
+  wasmtime_func_new:=nil;
+  wasmtime_func_new_unchecked:=nil;
+  wasmtime_func_type:=nil;
+  wasmtime_func_call:=nil;
+  wasmtime_func_call_unchecked:=nil;
+  wasmtime_caller_export_get:=nil;
+  wasmtime_caller_context:=nil;
+  wasmtime_func_from_raw:=nil;
+  wasmtime_func_to_raw:=nil;
+  wasmtime_global_new:=nil;
+  wasmtime_global_type:=nil;
+  wasmtime_global_get:=nil;
+  wasmtime_global_set:=nil;
+  wasmtime_instancetype_delete:=nil;
+  wasmtime_instancetype_exports:=nil;
+  wasmtime_instancetype_as_externtype:=nil;
+  wasmtime_externtype_as_instancetype:=nil;
+  wasmtime_instance_new:=nil;
+  wasmtime_instance_type:=nil;
+  wasmtime_instance_export_get:=nil;
+  wasmtime_instance_export_nth:=nil;
+  wasmtime_linker_new:=nil;
+  wasmtime_linker_delete:=nil;
+  wasmtime_linker_allow_shadowing:=nil;
+  wasmtime_linker_define:=nil;
+  wasmtime_linker_define_func:=nil;
+  wasmtime_linker_define_func_unchecked:=nil;
+  wasmtime_linker_define_wasi:=nil;
+  wasmtime_linker_define_instance:=nil;
+  wasmtime_linker_instantiate:=nil;
+  wasmtime_linker_module:=nil;
+  wasmtime_linker_get_default:=nil;
+  wasmtime_linker_get:=nil;
+  wasmtime_memorytype_new:=nil;
+  wasmtime_memorytype_minimum:=nil;
+  wasmtime_memorytype_maximum:=nil;
+  wasmtime_memorytype_is64:=nil;
+  wasmtime_memory_new:=nil;
+  wasmtime_memory_type:=nil;
+  wasmtime_memory_data:=nil;
+  wasmtime_memory_data_size:=nil;
+  wasmtime_memory_size:=nil;
+  wasmtime_memory_grow:=nil;
+  wasmtime_table_new:=nil;
+  wasmtime_table_type:=nil;
+  wasmtime_table_get:=nil;
+  wasmtime_table_set:=nil;
+  wasmtime_table_size:=nil;
+  wasmtime_table_grow:=nil;
+  wasmtime_trap_new:=nil;
+  wasmtime_trap_code:=nil;
+  wasmtime_trap_exit_status:=nil;
+  wasmtime_frame_func_name:=nil;
+  wasmtime_frame_module_name:=nil;
+  wasmtime_wat2wasm:=nil;
+end;
+
+
+procedure LoadWasmTime(const lib : string);
+begin
+  Freewasmtime;
+  hlib:=LoadLibrary(lib);
+  if hlib=NilHandle then
+    raise Exception.Create(format('Could not load library: %s',[lib]));
+
+  pointer(wasm_byte_vec_new_empty):=GetProcAddress(hlib,'wasm_byte_vec_new_empty');
+  pointer(wasm_byte_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_byte_vec_new_uninitialized');
+  pointer(wasm_byte_vec_new):=GetProcAddress(hlib,'wasm_byte_vec_new');
+  pointer(wasm_byte_vec_copy):=GetProcAddress(hlib,'wasm_byte_vec_copy');
+  pointer(wasm_byte_vec_delete):=GetProcAddress(hlib,'wasm_byte_vec_delete');
+  pointer(wasm_config_delete):=GetProcAddress(hlib,'wasm_config_delete');
+  pointer(wasm_config_new):=GetProcAddress(hlib,'wasm_config_new');
+  pointer(wasm_engine_delete):=GetProcAddress(hlib,'wasm_engine_delete');
+  pointer(wasm_engine_new):=GetProcAddress(hlib,'wasm_engine_new');
+  pointer(wasm_engine_new_with_config):=GetProcAddress(hlib,'wasm_engine_new_with_config');
+  pointer(wasm_store_delete):=GetProcAddress(hlib,'wasm_store_delete');
+  pointer(wasm_store_new):=GetProcAddress(hlib,'wasm_store_new');
+  pointer(wasm_valtype_delete):=GetProcAddress(hlib,'wasm_valtype_delete');
+  pointer(wasm_valtype_vec_new_empty):=GetProcAddress(hlib,'wasm_valtype_vec_new_empty');
+  pointer(wasm_valtype_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_valtype_vec_new_uninitialized');
+  pointer(wasm_valtype_vec_new):=GetProcAddress(hlib,'wasm_valtype_vec_new');
+  pointer(wasm_valtype_vec_copy):=GetProcAddress(hlib,'wasm_valtype_vec_copy');
+  pointer(wasm_valtype_vec_delete):=GetProcAddress(hlib,'wasm_valtype_vec_delete');
+  pointer(wasm_valtype_copy):=GetProcAddress(hlib,'wasm_valtype_copy');
+  pointer(wasm_valtype_new):=GetProcAddress(hlib,'wasm_valtype_new');
+  pointer(wasm_valtype_kind):=GetProcAddress(hlib,'wasm_valtype_kind');
+  pointer(wasm_functype_delete):=GetProcAddress(hlib,'wasm_functype_delete');
+  pointer(wasm_functype_vec_new_empty):=GetProcAddress(hlib,'wasm_functype_vec_new_empty');
+  pointer(wasm_functype_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_functype_vec_new_uninitialized');
+  pointer(wasm_functype_vec_new):=GetProcAddress(hlib,'wasm_functype_vec_new');
+  pointer(wasm_functype_vec_copy):=GetProcAddress(hlib,'wasm_functype_vec_copy');
+  pointer(wasm_functype_vec_delete):=GetProcAddress(hlib,'wasm_functype_vec_delete');
+  pointer(wasm_functype_copy):=GetProcAddress(hlib,'wasm_functype_copy');
+  pointer(wasm_functype_new):=GetProcAddress(hlib,'wasm_functype_new');
+  pointer(wasm_functype_params):=GetProcAddress(hlib,'wasm_functype_params');
+  pointer(wasm_functype_results):=GetProcAddress(hlib,'wasm_functype_results');
+  pointer(wasm_globaltype_delete):=GetProcAddress(hlib,'wasm_globaltype_delete');
+  pointer(wasm_globaltype_vec_new_empty):=GetProcAddress(hlib,'wasm_globaltype_vec_new_empty');
+  pointer(wasm_globaltype_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_globaltype_vec_new_uninitialized');
+  pointer(wasm_globaltype_vec_new):=GetProcAddress(hlib,'wasm_globaltype_vec_new');
+  pointer(wasm_globaltype_vec_copy):=GetProcAddress(hlib,'wasm_globaltype_vec_copy');
+  pointer(wasm_globaltype_vec_delete):=GetProcAddress(hlib,'wasm_globaltype_vec_delete');
+  pointer(wasm_globaltype_copy):=GetProcAddress(hlib,'wasm_globaltype_copy');
+  pointer(wasm_globaltype_new):=GetProcAddress(hlib,'wasm_globaltype_new');
+  pointer(wasm_globaltype_content):=GetProcAddress(hlib,'wasm_globaltype_content');
+  pointer(wasm_globaltype_mutability):=GetProcAddress(hlib,'wasm_globaltype_mutability');
+  pointer(wasm_tabletype_delete):=GetProcAddress(hlib,'wasm_tabletype_delete');
+  pointer(wasm_tabletype_vec_new_empty):=GetProcAddress(hlib,'wasm_tabletype_vec_new_empty');
+  pointer(wasm_tabletype_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_tabletype_vec_new_uninitialized');
+  pointer(wasm_tabletype_vec_new):=GetProcAddress(hlib,'wasm_tabletype_vec_new');
+  pointer(wasm_tabletype_vec_copy):=GetProcAddress(hlib,'wasm_tabletype_vec_copy');
+  pointer(wasm_tabletype_vec_delete):=GetProcAddress(hlib,'wasm_tabletype_vec_delete');
+  pointer(wasm_tabletype_copy):=GetProcAddress(hlib,'wasm_tabletype_copy');
+  pointer(wasm_tabletype_new):=GetProcAddress(hlib,'wasm_tabletype_new');
+  pointer(wasm_tabletype_element):=GetProcAddress(hlib,'wasm_tabletype_element');
+  pointer(wasm_tabletype_limits):=GetProcAddress(hlib,'wasm_tabletype_limits');
+  pointer(wasm_memorytype_delete):=GetProcAddress(hlib,'wasm_memorytype_delete');
+  pointer(wasm_memorytype_vec_new_empty):=GetProcAddress(hlib,'wasm_memorytype_vec_new_empty');
+  pointer(wasm_memorytype_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_memorytype_vec_new_uninitialized');
+  pointer(wasm_memorytype_vec_new):=GetProcAddress(hlib,'wasm_memorytype_vec_new');
+  pointer(wasm_memorytype_vec_copy):=GetProcAddress(hlib,'wasm_memorytype_vec_copy');
+  pointer(wasm_memorytype_vec_delete):=GetProcAddress(hlib,'wasm_memorytype_vec_delete');
+  pointer(wasm_memorytype_copy):=GetProcAddress(hlib,'wasm_memorytype_copy');
+  pointer(wasm_memorytype_new):=GetProcAddress(hlib,'wasm_memorytype_new');
+  pointer(wasm_memorytype_limits):=GetProcAddress(hlib,'wasm_memorytype_limits');
+  pointer(wasm_externtype_delete):=GetProcAddress(hlib,'wasm_externtype_delete');
+  pointer(wasm_externtype_vec_new_empty):=GetProcAddress(hlib,'wasm_externtype_vec_new_empty');
+  pointer(wasm_externtype_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_externtype_vec_new_uninitialized');
+  pointer(wasm_externtype_vec_new):=GetProcAddress(hlib,'wasm_externtype_vec_new');
+  pointer(wasm_externtype_vec_copy):=GetProcAddress(hlib,'wasm_externtype_vec_copy');
+  pointer(wasm_externtype_vec_delete):=GetProcAddress(hlib,'wasm_externtype_vec_delete');
+  pointer(wasm_externtype_copy):=GetProcAddress(hlib,'wasm_externtype_copy');
+  pointer(wasm_externtype_kind):=GetProcAddress(hlib,'wasm_externtype_kind');
+  pointer(wasm_functype_as_externtype):=GetProcAddress(hlib,'wasm_functype_as_externtype');
+  pointer(wasm_globaltype_as_externtype):=GetProcAddress(hlib,'wasm_globaltype_as_externtype');
+  pointer(wasm_tabletype_as_externtype):=GetProcAddress(hlib,'wasm_tabletype_as_externtype');
+  pointer(wasm_memorytype_as_externtype):=GetProcAddress(hlib,'wasm_memorytype_as_externtype');
+  pointer(wasm_externtype_as_functype):=GetProcAddress(hlib,'wasm_externtype_as_functype');
+  pointer(wasm_externtype_as_globaltype):=GetProcAddress(hlib,'wasm_externtype_as_globaltype');
+  pointer(wasm_externtype_as_tabletype):=GetProcAddress(hlib,'wasm_externtype_as_tabletype');
+  pointer(wasm_externtype_as_memorytype):=GetProcAddress(hlib,'wasm_externtype_as_memorytype');
+  pointer(wasm_functype_as_externtype_const):=GetProcAddress(hlib,'wasm_functype_as_externtype_const');
+  pointer(wasm_globaltype_as_externtype_const):=GetProcAddress(hlib,'wasm_globaltype_as_externtype_const');
+  pointer(wasm_tabletype_as_externtype_const):=GetProcAddress(hlib,'wasm_tabletype_as_externtype_const');
+  pointer(wasm_memorytype_as_externtype_const):=GetProcAddress(hlib,'wasm_memorytype_as_externtype_const');
+  pointer(wasm_externtype_as_functype_const):=GetProcAddress(hlib,'wasm_externtype_as_functype_const');
+  pointer(wasm_externtype_as_globaltype_const):=GetProcAddress(hlib,'wasm_externtype_as_globaltype_const');
+  pointer(wasm_externtype_as_tabletype_const):=GetProcAddress(hlib,'wasm_externtype_as_tabletype_const');
+  pointer(wasm_externtype_as_memorytype_const):=GetProcAddress(hlib,'wasm_externtype_as_memorytype_const');
+  pointer(wasm_importtype_delete):=GetProcAddress(hlib,'wasm_importtype_delete');
+  pointer(wasm_importtype_vec_new_empty):=GetProcAddress(hlib,'wasm_importtype_vec_new_empty');
+  pointer(wasm_importtype_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_importtype_vec_new_uninitialized');
+  pointer(wasm_importtype_vec_new):=GetProcAddress(hlib,'wasm_importtype_vec_new');
+  pointer(wasm_importtype_vec_copy):=GetProcAddress(hlib,'wasm_importtype_vec_copy');
+  pointer(wasm_importtype_vec_delete):=GetProcAddress(hlib,'wasm_importtype_vec_delete');
+  pointer(wasm_importtype_copy):=GetProcAddress(hlib,'wasm_importtype_copy');
+  pointer(wasm_importtype_new):=GetProcAddress(hlib,'wasm_importtype_new');
+  pointer(wasm_importtype_module):=GetProcAddress(hlib,'wasm_importtype_module');
+  pointer(wasm_importtype_name):=GetProcAddress(hlib,'wasm_importtype_name');
+  pointer(wasm_importtype_type):=GetProcAddress(hlib,'wasm_importtype_type');
+  pointer(wasm_exporttype_delete):=GetProcAddress(hlib,'wasm_exporttype_delete');
+  pointer(wasm_exporttype_vec_new_empty):=GetProcAddress(hlib,'wasm_exporttype_vec_new_empty');
+  pointer(wasm_exporttype_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_exporttype_vec_new_uninitialized');
+  pointer(wasm_exporttype_vec_new):=GetProcAddress(hlib,'wasm_exporttype_vec_new');
+  pointer(wasm_exporttype_vec_copy):=GetProcAddress(hlib,'wasm_exporttype_vec_copy');
+  pointer(wasm_exporttype_vec_delete):=GetProcAddress(hlib,'wasm_exporttype_vec_delete');
+  pointer(wasm_exporttype_copy):=GetProcAddress(hlib,'wasm_exporttype_copy');
+  pointer(wasm_exporttype_new):=GetProcAddress(hlib,'wasm_exporttype_new');
+  pointer(wasm_exporttype_name):=GetProcAddress(hlib,'wasm_exporttype_name');
+  pointer(wasm_exporttype_type):=GetProcAddress(hlib,'wasm_exporttype_type');
+  pointer(wasm_val_delete):=GetProcAddress(hlib,'wasm_val_delete');
+  pointer(wasm_val_copy):=GetProcAddress(hlib,'wasm_val_copy');
+  pointer(wasm_val_vec_new_empty):=GetProcAddress(hlib,'wasm_val_vec_new_empty');
+  pointer(wasm_val_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_val_vec_new_uninitialized');
+  pointer(wasm_val_vec_new):=GetProcAddress(hlib,'wasm_val_vec_new');
+  pointer(wasm_val_vec_copy):=GetProcAddress(hlib,'wasm_val_vec_copy');
+  pointer(wasm_val_vec_delete):=GetProcAddress(hlib,'wasm_val_vec_delete');
+  pointer(wasm_ref_delete):=GetProcAddress(hlib,'wasm_ref_delete');
+  pointer(wasm_ref_copy):=GetProcAddress(hlib,'wasm_ref_copy');
+  pointer(wasm_ref_same):=GetProcAddress(hlib,'wasm_ref_same');
+  pointer(wasm_ref_get_host_info):=GetProcAddress(hlib,'wasm_ref_get_host_info');
+  pointer(wasm_ref_set_host_info):=GetProcAddress(hlib,'wasm_ref_set_host_info');
+  pointer(wasm_ref_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_ref_set_host_info_with_finalizer');
+  pointer(wasm_frame_delete):=GetProcAddress(hlib,'wasm_frame_delete');
+  pointer(wasm_frame_vec_new_empty):=GetProcAddress(hlib,'wasm_frame_vec_new_empty');
+  pointer(wasm_frame_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_frame_vec_new_uninitialized');
+  pointer(wasm_frame_vec_new):=GetProcAddress(hlib,'wasm_frame_vec_new');
+  pointer(wasm_frame_vec_copy):=GetProcAddress(hlib,'wasm_frame_vec_copy');
+  pointer(wasm_frame_vec_delete):=GetProcAddress(hlib,'wasm_frame_vec_delete');
+  pointer(wasm_frame_copy):=GetProcAddress(hlib,'wasm_frame_copy');
+  pointer(wasm_frame_instance):=GetProcAddress(hlib,'wasm_frame_instance');
+  pointer(wasm_frame_func_index):=GetProcAddress(hlib,'wasm_frame_func_index');
+  pointer(wasm_frame_func_offset):=GetProcAddress(hlib,'wasm_frame_func_offset');
+  pointer(wasm_frame_module_offset):=GetProcAddress(hlib,'wasm_frame_module_offset');
+  pointer(wasm_trap_delete):=GetProcAddress(hlib,'wasm_trap_delete');
+  pointer(wasm_trap_copy):=GetProcAddress(hlib,'wasm_trap_copy');
+  pointer(wasm_trap_same):=GetProcAddress(hlib,'wasm_trap_same');
+  pointer(wasm_trap_get_host_info):=GetProcAddress(hlib,'wasm_trap_get_host_info');
+  pointer(wasm_trap_set_host_info):=GetProcAddress(hlib,'wasm_trap_set_host_info');
+  pointer(wasm_trap_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_trap_set_host_info_with_finalizer');
+  pointer(wasm_trap_as_ref):=GetProcAddress(hlib,'wasm_trap_as_ref');
+  pointer(wasm_ref_as_trap):=GetProcAddress(hlib,'wasm_ref_as_trap');
+  pointer(wasm_trap_as_ref_const):=GetProcAddress(hlib,'wasm_trap_as_ref_const');
+  pointer(wasm_ref_as_trap_const):=GetProcAddress(hlib,'wasm_ref_as_trap_const');
+  pointer(wasm_trap_new):=GetProcAddress(hlib,'wasm_trap_new');
+  pointer(wasm_trap_message):=GetProcAddress(hlib,'wasm_trap_message');
+  pointer(wasm_trap_origin):=GetProcAddress(hlib,'wasm_trap_origin');
+  pointer(wasm_trap_trace):=GetProcAddress(hlib,'wasm_trap_trace');
+  pointer(wasm_foreign_delete):=GetProcAddress(hlib,'wasm_foreign_delete');
+  pointer(wasm_foreign_copy):=GetProcAddress(hlib,'wasm_foreign_copy');
+  pointer(wasm_foreign_same):=GetProcAddress(hlib,'wasm_foreign_same');
+  pointer(wasm_foreign_get_host_info):=GetProcAddress(hlib,'wasm_foreign_get_host_info');
+  pointer(wasm_foreign_set_host_info):=GetProcAddress(hlib,'wasm_foreign_set_host_info');
+  pointer(wasm_foreign_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_foreign_set_host_info_with_finalizer');
+  pointer(wasm_foreign_as_ref):=GetProcAddress(hlib,'wasm_foreign_as_ref');
+  pointer(wasm_ref_as_foreign):=GetProcAddress(hlib,'wasm_ref_as_foreign');
+  pointer(wasm_foreign_as_ref_const):=GetProcAddress(hlib,'wasm_foreign_as_ref_const');
+  pointer(wasm_ref_as_foreign_const):=GetProcAddress(hlib,'wasm_ref_as_foreign_const');
+  pointer(wasm_foreign_new):=GetProcAddress(hlib,'wasm_foreign_new');
+  pointer(wasm_module_delete):=GetProcAddress(hlib,'wasm_module_delete');
+  pointer(wasm_module_copy):=GetProcAddress(hlib,'wasm_module_copy');
+  pointer(wasm_module_same):=GetProcAddress(hlib,'wasm_module_same');
+  pointer(wasm_module_get_host_info):=GetProcAddress(hlib,'wasm_module_get_host_info');
+  pointer(wasm_module_set_host_info):=GetProcAddress(hlib,'wasm_module_set_host_info');
+  pointer(wasm_module_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_module_set_host_info_with_finalizer');
+  pointer(wasm_module_as_ref):=GetProcAddress(hlib,'wasm_module_as_ref');
+  pointer(wasm_ref_as_module):=GetProcAddress(hlib,'wasm_ref_as_module');
+  pointer(wasm_module_as_ref_const):=GetProcAddress(hlib,'wasm_module_as_ref_const');
+  pointer(wasm_ref_as_module_const):=GetProcAddress(hlib,'wasm_ref_as_module_const');
+  pointer(wasm_shared_module_delete):=GetProcAddress(hlib,'wasm_shared_module_delete');
+  pointer(wasm_module_share):=GetProcAddress(hlib,'wasm_module_share');
+  pointer(wasm_module_obtain):=GetProcAddress(hlib,'wasm_module_obtain');
+  pointer(wasm_module_new):=GetProcAddress(hlib,'wasm_module_new');
+  pointer(wasm_module_validate):=GetProcAddress(hlib,'wasm_module_validate');
+  pointer(wasm_module_imports):=GetProcAddress(hlib,'wasm_module_imports');
+  pointer(wasm_module_exports):=GetProcAddress(hlib,'wasm_module_exports');
+  pointer(wasm_module_serialize):=GetProcAddress(hlib,'wasm_module_serialize');
+  pointer(wasm_module_deserialize):=GetProcAddress(hlib,'wasm_module_deserialize');
+  pointer(wasm_func_delete):=GetProcAddress(hlib,'wasm_func_delete');
+  pointer(wasm_func_copy):=GetProcAddress(hlib,'wasm_func_copy');
+  pointer(wasm_func_same):=GetProcAddress(hlib,'wasm_func_same');
+  pointer(wasm_func_get_host_info):=GetProcAddress(hlib,'wasm_func_get_host_info');
+  pointer(wasm_func_set_host_info):=GetProcAddress(hlib,'wasm_func_set_host_info');
+  pointer(wasm_func_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_func_set_host_info_with_finalizer');
+  pointer(wasm_func_as_ref):=GetProcAddress(hlib,'wasm_func_as_ref');
+  pointer(wasm_ref_as_func):=GetProcAddress(hlib,'wasm_ref_as_func');
+  pointer(wasm_func_as_ref_const):=GetProcAddress(hlib,'wasm_func_as_ref_const');
+  pointer(wasm_ref_as_func_const):=GetProcAddress(hlib,'wasm_ref_as_func_const');
+  pointer(wasm_func_new):=GetProcAddress(hlib,'wasm_func_new');
+  pointer(wasm_func_new_with_env):=GetProcAddress(hlib,'wasm_func_new_with_env');
+  pointer(wasm_func_type):=GetProcAddress(hlib,'wasm_func_type');
+  pointer(wasm_func_param_arity):=GetProcAddress(hlib,'wasm_func_param_arity');
+  pointer(wasm_func_result_arity):=GetProcAddress(hlib,'wasm_func_result_arity');
+  pointer(wasm_func_call):=GetProcAddress(hlib,'wasm_func_call');
+  pointer(wasm_global_delete):=GetProcAddress(hlib,'wasm_global_delete');
+  pointer(wasm_global_copy):=GetProcAddress(hlib,'wasm_global_copy');
+  pointer(wasm_global_same):=GetProcAddress(hlib,'wasm_global_same');
+  pointer(wasm_global_get_host_info):=GetProcAddress(hlib,'wasm_global_get_host_info');
+  pointer(wasm_global_set_host_info):=GetProcAddress(hlib,'wasm_global_set_host_info');
+  pointer(wasm_global_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_global_set_host_info_with_finalizer');
+  pointer(wasm_global_as_ref):=GetProcAddress(hlib,'wasm_global_as_ref');
+  pointer(wasm_ref_as_global):=GetProcAddress(hlib,'wasm_ref_as_global');
+  pointer(wasm_global_as_ref_const):=GetProcAddress(hlib,'wasm_global_as_ref_const');
+  pointer(wasm_ref_as_global_const):=GetProcAddress(hlib,'wasm_ref_as_global_const');
+  pointer(wasm_global_new):=GetProcAddress(hlib,'wasm_global_new');
+  pointer(wasm_global_type):=GetProcAddress(hlib,'wasm_global_type');
+  pointer(wasm_global_get):=GetProcAddress(hlib,'wasm_global_get');
+  pointer(wasm_global_set):=GetProcAddress(hlib,'wasm_global_set');
+  pointer(wasm_table_delete):=GetProcAddress(hlib,'wasm_table_delete');
+  pointer(wasm_table_copy):=GetProcAddress(hlib,'wasm_table_copy');
+  pointer(wasm_table_same):=GetProcAddress(hlib,'wasm_table_same');
+  pointer(wasm_table_get_host_info):=GetProcAddress(hlib,'wasm_table_get_host_info');
+  pointer(wasm_table_set_host_info):=GetProcAddress(hlib,'wasm_table_set_host_info');
+  pointer(wasm_table_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_table_set_host_info_with_finalizer');
+  pointer(wasm_table_as_ref):=GetProcAddress(hlib,'wasm_table_as_ref');
+  pointer(wasm_ref_as_table):=GetProcAddress(hlib,'wasm_ref_as_table');
+  pointer(wasm_table_as_ref_const):=GetProcAddress(hlib,'wasm_table_as_ref_const');
+  pointer(wasm_ref_as_table_const):=GetProcAddress(hlib,'wasm_ref_as_table_const');
+  pointer(wasm_table_new):=GetProcAddress(hlib,'wasm_table_new');
+  pointer(wasm_table_type):=GetProcAddress(hlib,'wasm_table_type');
+  pointer(wasm_table_get):=GetProcAddress(hlib,'wasm_table_get');
+  pointer(wasm_table_set):=GetProcAddress(hlib,'wasm_table_set');
+  pointer(wasm_table_size):=GetProcAddress(hlib,'wasm_table_size');
+  pointer(wasm_table_grow):=GetProcAddress(hlib,'wasm_table_grow');
+  pointer(wasm_memory_delete):=GetProcAddress(hlib,'wasm_memory_delete');
+  pointer(wasm_memory_copy):=GetProcAddress(hlib,'wasm_memory_copy');
+  pointer(wasm_memory_same):=GetProcAddress(hlib,'wasm_memory_same');
+  pointer(wasm_memory_get_host_info):=GetProcAddress(hlib,'wasm_memory_get_host_info');
+  pointer(wasm_memory_set_host_info):=GetProcAddress(hlib,'wasm_memory_set_host_info');
+  pointer(wasm_memory_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_memory_set_host_info_with_finalizer');
+  pointer(wasm_memory_as_ref):=GetProcAddress(hlib,'wasm_memory_as_ref');
+  pointer(wasm_ref_as_memory):=GetProcAddress(hlib,'wasm_ref_as_memory');
+  pointer(wasm_memory_as_ref_const):=GetProcAddress(hlib,'wasm_memory_as_ref_const');
+  pointer(wasm_ref_as_memory_const):=GetProcAddress(hlib,'wasm_ref_as_memory_const');
+  pointer(wasm_memory_new):=GetProcAddress(hlib,'wasm_memory_new');
+  pointer(wasm_memory_type):=GetProcAddress(hlib,'wasm_memory_type');
+  pointer(wasm_memory_data):=GetProcAddress(hlib,'wasm_memory_data');
+  pointer(wasm_memory_data_size):=GetProcAddress(hlib,'wasm_memory_data_size');
+  pointer(wasm_memory_size):=GetProcAddress(hlib,'wasm_memory_size');
+  pointer(wasm_memory_grow):=GetProcAddress(hlib,'wasm_memory_grow');
+  pointer(wasm_extern_delete):=GetProcAddress(hlib,'wasm_extern_delete');
+  pointer(wasm_extern_copy):=GetProcAddress(hlib,'wasm_extern_copy');
+  pointer(wasm_extern_same):=GetProcAddress(hlib,'wasm_extern_same');
+  pointer(wasm_extern_get_host_info):=GetProcAddress(hlib,'wasm_extern_get_host_info');
+  pointer(wasm_extern_set_host_info):=GetProcAddress(hlib,'wasm_extern_set_host_info');
+  pointer(wasm_extern_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_extern_set_host_info_with_finalizer');
+  pointer(wasm_extern_as_ref):=GetProcAddress(hlib,'wasm_extern_as_ref');
+  pointer(wasm_ref_as_extern):=GetProcAddress(hlib,'wasm_ref_as_extern');
+  pointer(wasm_extern_as_ref_const):=GetProcAddress(hlib,'wasm_extern_as_ref_const');
+  pointer(wasm_ref_as_extern_const):=GetProcAddress(hlib,'wasm_ref_as_extern_const');
+  pointer(wasm_extern_vec_new_empty):=GetProcAddress(hlib,'wasm_extern_vec_new_empty');
+  pointer(wasm_extern_vec_new_uninitialized):=GetProcAddress(hlib,'wasm_extern_vec_new_uninitialized');
+  pointer(wasm_extern_vec_new):=GetProcAddress(hlib,'wasm_extern_vec_new');
+  pointer(wasm_extern_vec_copy):=GetProcAddress(hlib,'wasm_extern_vec_copy');
+  pointer(wasm_extern_vec_delete):=GetProcAddress(hlib,'wasm_extern_vec_delete');
+  pointer(wasm_extern_kind):=GetProcAddress(hlib,'wasm_extern_kind');
+  pointer(wasm_extern_type):=GetProcAddress(hlib,'wasm_extern_type');
+  pointer(wasm_func_as_extern):=GetProcAddress(hlib,'wasm_func_as_extern');
+  pointer(wasm_global_as_extern):=GetProcAddress(hlib,'wasm_global_as_extern');
+  pointer(wasm_table_as_extern):=GetProcAddress(hlib,'wasm_table_as_extern');
+  pointer(wasm_memory_as_extern):=GetProcAddress(hlib,'wasm_memory_as_extern');
+  pointer(wasm_extern_as_func):=GetProcAddress(hlib,'wasm_extern_as_func');
+  pointer(wasm_extern_as_global):=GetProcAddress(hlib,'wasm_extern_as_global');
+  pointer(wasm_extern_as_table):=GetProcAddress(hlib,'wasm_extern_as_table');
+  pointer(wasm_extern_as_memory):=GetProcAddress(hlib,'wasm_extern_as_memory');
+  pointer(wasm_func_as_extern_const):=GetProcAddress(hlib,'wasm_func_as_extern_const');
+  pointer(wasm_global_as_extern_const):=GetProcAddress(hlib,'wasm_global_as_extern_const');
+  pointer(wasm_table_as_extern_const):=GetProcAddress(hlib,'wasm_table_as_extern_const');
+  pointer(wasm_memory_as_extern_const):=GetProcAddress(hlib,'wasm_memory_as_extern_const');
+  pointer(wasm_extern_as_func_const):=GetProcAddress(hlib,'wasm_extern_as_func_const');
+  pointer(wasm_extern_as_global_const):=GetProcAddress(hlib,'wasm_extern_as_global_const');
+  pointer(wasm_extern_as_table_const):=GetProcAddress(hlib,'wasm_extern_as_table_const');
+  pointer(wasm_extern_as_memory_const):=GetProcAddress(hlib,'wasm_extern_as_memory_const');
+  pointer(wasm_instance_delete):=GetProcAddress(hlib,'wasm_instance_delete');
+  pointer(wasm_instance_copy):=GetProcAddress(hlib,'wasm_instance_copy');
+  pointer(wasm_instance_same):=GetProcAddress(hlib,'wasm_instance_same');
+  pointer(wasm_instance_get_host_info):=GetProcAddress(hlib,'wasm_instance_get_host_info');
+  pointer(wasm_instance_set_host_info):=GetProcAddress(hlib,'wasm_instance_set_host_info');
+  pointer(wasm_instance_set_host_info_with_finalizer):=GetProcAddress(hlib,'wasm_instance_set_host_info_with_finalizer');
+  pointer(wasm_instance_as_ref):=GetProcAddress(hlib,'wasm_instance_as_ref');
+  pointer(wasm_ref_as_instance):=GetProcAddress(hlib,'wasm_ref_as_instance');
+  pointer(wasm_instance_as_ref_const):=GetProcAddress(hlib,'wasm_instance_as_ref_const');
+  pointer(wasm_ref_as_instance_const):=GetProcAddress(hlib,'wasm_ref_as_instance_const');
+  pointer(wasm_instance_new):=GetProcAddress(hlib,'wasm_instance_new');
+  pointer(wasm_instance_exports):=GetProcAddress(hlib,'wasm_instance_exports');
+  pointer(wasi_config_delete):=GetProcAddress(hlib,'wasi_config_delete');
+  pointer(wasi_config_new):=GetProcAddress(hlib,'wasi_config_new');
+  pointer(wasi_config_set_argv):=GetProcAddress(hlib,'wasi_config_set_argv');
+  pointer(wasi_config_inherit_argv):=GetProcAddress(hlib,'wasi_config_inherit_argv');
+  pointer(wasi_config_set_env):=GetProcAddress(hlib,'wasi_config_set_env');
+  pointer(wasi_config_inherit_env):=GetProcAddress(hlib,'wasi_config_inherit_env');
+  pointer(wasi_config_set_stdin_file):=GetProcAddress(hlib,'wasi_config_set_stdin_file');
+  pointer(wasi_config_inherit_stdin):=GetProcAddress(hlib,'wasi_config_inherit_stdin');
+  pointer(wasi_config_set_stdout_file):=GetProcAddress(hlib,'wasi_config_set_stdout_file');
+  pointer(wasi_config_inherit_stdout):=GetProcAddress(hlib,'wasi_config_inherit_stdout');
+  pointer(wasi_config_set_stderr_file):=GetProcAddress(hlib,'wasi_config_set_stderr_file');
+  pointer(wasi_config_inherit_stderr):=GetProcAddress(hlib,'wasi_config_inherit_stderr');
+  pointer(wasi_config_preopen_dir):=GetProcAddress(hlib,'wasi_config_preopen_dir');
+  pointer(wasmtime_error_delete):=GetProcAddress(hlib,'wasmtime_error_delete');
+  pointer(wasmtime_error_message):=GetProcAddress(hlib,'wasmtime_error_message');
+  pointer(wasmtime_config_debug_info_set):=GetProcAddress(hlib,'wasmtime_config_debug_info_set');
+  pointer(wasmtime_config_interruptable_set):=GetProcAddress(hlib,'wasmtime_config_interruptable_set');
+  pointer(wasmtime_config_consume_fuel_set):=GetProcAddress(hlib,'wasmtime_config_consume_fuel_set');
+  pointer(wasmtime_config_max_wasm_stack_set):=GetProcAddress(hlib,'wasmtime_config_max_wasm_stack_set');
+  pointer(wasmtime_config_wasm_threads_set):=GetProcAddress(hlib,'wasmtime_config_wasm_threads_set');
+  pointer(wasmtime_config_wasm_reference_types_set):=GetProcAddress(hlib,'wasmtime_config_wasm_reference_types_set');
+  pointer(wasmtime_config_wasm_simd_set):=GetProcAddress(hlib,'wasmtime_config_wasm_simd_set');
+  pointer(wasmtime_config_wasm_bulk_memory_set):=GetProcAddress(hlib,'wasmtime_config_wasm_bulk_memory_set');
+  pointer(wasmtime_config_wasm_multi_value_set):=GetProcAddress(hlib,'wasmtime_config_wasm_multi_value_set');
+  pointer(wasmtime_config_wasm_multi_memory_set):=GetProcAddress(hlib,'wasmtime_config_wasm_multi_memory_set');
+  pointer(wasmtime_config_wasm_module_linking_set):=GetProcAddress(hlib,'wasmtime_config_wasm_module_linking_set');
+  pointer(wasmtime_config_wasm_memory64_set):=GetProcAddress(hlib,'wasmtime_config_wasm_memory64_set');
+  pointer(wasmtime_config_strategy_set):=GetProcAddress(hlib,'wasmtime_config_strategy_set');
+  pointer(wasmtime_config_cranelift_debug_verifier_set):=GetProcAddress(hlib,'wasmtime_config_cranelift_debug_verifier_set');
+  pointer(wasmtime_config_cranelift_opt_level_set):=GetProcAddress(hlib,'wasmtime_config_cranelift_opt_level_set');
+  pointer(wasmtime_config_profiler_set):=GetProcAddress(hlib,'wasmtime_config_profiler_set');
+  pointer(wasmtime_config_static_memory_maximum_size_set):=GetProcAddress(hlib,'wasmtime_config_static_memory_maximum_size_set');
+  pointer(wasmtime_config_static_memory_guard_size_set):=GetProcAddress(hlib,'wasmtime_config_static_memory_guard_size_set');
+  pointer(wasmtime_config_dynamic_memory_guard_size_set):=GetProcAddress(hlib,'wasmtime_config_dynamic_memory_guard_size_set');
+  pointer(wasmtime_config_cache_config_load):=GetProcAddress(hlib,'wasmtime_config_cache_config_load');
+  pointer(wasmtime_moduletype_delete):=GetProcAddress(hlib,'wasmtime_moduletype_delete');
+  pointer(wasmtime_moduletype_imports):=GetProcAddress(hlib,'wasmtime_moduletype_imports');
+  pointer(wasmtime_moduletype_exports):=GetProcAddress(hlib,'wasmtime_moduletype_exports');
+  pointer(wasmtime_moduletype_as_externtype):=GetProcAddress(hlib,'wasmtime_moduletype_as_externtype');
+  pointer(wasmtime_externtype_as_moduletype):=GetProcAddress(hlib,'wasmtime_externtype_as_moduletype');
+  pointer(wasmtime_module_new):=GetProcAddress(hlib,'wasmtime_module_new');
+  pointer(wasmtime_module_delete):=GetProcAddress(hlib,'wasmtime_module_delete');
+  pointer(wasmtime_module_clone):=GetProcAddress(hlib,'wasmtime_module_clone');
+  pointer(wasmtime_module_validate):=GetProcAddress(hlib,'wasmtime_module_validate');
+  pointer(wasmtime_module_type):=GetProcAddress(hlib,'wasmtime_module_type');
+  pointer(wasmtime_module_serialize):=GetProcAddress(hlib,'wasmtime_module_serialize');
+  pointer(wasmtime_module_deserialize):=GetProcAddress(hlib,'wasmtime_module_deserialize');
+  pointer(wasmtime_module_deserialize_file):=GetProcAddress(hlib,'wasmtime_module_deserialize_file');
+  pointer(wasmtime_store_new):=GetProcAddress(hlib,'wasmtime_store_new');
+  pointer(wasmtime_store_context):=GetProcAddress(hlib,'wasmtime_store_context');
+  pointer(wasmtime_store_delete):=GetProcAddress(hlib,'wasmtime_store_delete');
+  pointer(wasmtime_context_get_data):=GetProcAddress(hlib,'wasmtime_context_get_data');
+  pointer(wasmtime_context_set_data):=GetProcAddress(hlib,'wasmtime_context_set_data');
+  pointer(wasmtime_context_gc):=GetProcAddress(hlib,'wasmtime_context_gc');
+  pointer(wasmtime_context_add_fuel):=GetProcAddress(hlib,'wasmtime_context_add_fuel');
+  pointer(wasmtime_context_fuel_consumed):=GetProcAddress(hlib,'wasmtime_context_fuel_consumed');
+  pointer(wasmtime_context_consume_fuel):=GetProcAddress(hlib,'wasmtime_context_consume_fuel');
+  pointer(wasmtime_context_set_wasi):=GetProcAddress(hlib,'wasmtime_context_set_wasi');
+  pointer(wasmtime_interrupt_handle_new):=GetProcAddress(hlib,'wasmtime_interrupt_handle_new');
+  pointer(wasmtime_interrupt_handle_interrupt):=GetProcAddress(hlib,'wasmtime_interrupt_handle_interrupt');
+  pointer(wasmtime_interrupt_handle_delete):=GetProcAddress(hlib,'wasmtime_interrupt_handle_delete');
+  pointer(wasmtime_extern_delete):=GetProcAddress(hlib,'wasmtime_extern_delete');
+  pointer(wasmtime_extern_type):=GetProcAddress(hlib,'wasmtime_extern_type');
+  pointer(wasmtime_externref_new):=GetProcAddress(hlib,'wasmtime_externref_new');
+  pointer(wasmtime_externref_data):=GetProcAddress(hlib,'wasmtime_externref_data');
+  pointer(wasmtime_externref_clone):=GetProcAddress(hlib,'wasmtime_externref_clone');
+  pointer(wasmtime_externref_delete):=GetProcAddress(hlib,'wasmtime_externref_delete');
+  pointer(wasmtime_externref_from_raw):=GetProcAddress(hlib,'wasmtime_externref_from_raw');
+  pointer(wasmtime_externref_to_raw):=GetProcAddress(hlib,'wasmtime_externref_to_raw');
+  pointer(wasmtime_val_delete):=GetProcAddress(hlib,'wasmtime_val_delete');
+  pointer(wasmtime_val_copy):=GetProcAddress(hlib,'wasmtime_val_copy');
+  pointer(wasmtime_func_new):=GetProcAddress(hlib,'wasmtime_func_new');
+  pointer(wasmtime_func_new_unchecked):=GetProcAddress(hlib,'wasmtime_func_new_unchecked');
+  pointer(wasmtime_func_type):=GetProcAddress(hlib,'wasmtime_func_type');
+  pointer(wasmtime_func_call):=GetProcAddress(hlib,'wasmtime_func_call');
+  pointer(wasmtime_func_call_unchecked):=GetProcAddress(hlib,'wasmtime_func_call_unchecked');
+  pointer(wasmtime_caller_export_get):=GetProcAddress(hlib,'wasmtime_caller_export_get');
+  pointer(wasmtime_caller_context):=GetProcAddress(hlib,'wasmtime_caller_context');
+  pointer(wasmtime_func_from_raw):=GetProcAddress(hlib,'wasmtime_func_from_raw');
+  pointer(wasmtime_func_to_raw):=GetProcAddress(hlib,'wasmtime_func_to_raw');
+  pointer(wasmtime_global_new):=GetProcAddress(hlib,'wasmtime_global_new');
+  pointer(wasmtime_global_type):=GetProcAddress(hlib,'wasmtime_global_type');
+  pointer(wasmtime_global_get):=GetProcAddress(hlib,'wasmtime_global_get');
+  pointer(wasmtime_global_set):=GetProcAddress(hlib,'wasmtime_global_set');
+  pointer(wasmtime_instancetype_delete):=GetProcAddress(hlib,'wasmtime_instancetype_delete');
+  pointer(wasmtime_instancetype_exports):=GetProcAddress(hlib,'wasmtime_instancetype_exports');
+  pointer(wasmtime_instancetype_as_externtype):=GetProcAddress(hlib,'wasmtime_instancetype_as_externtype');
+  pointer(wasmtime_externtype_as_instancetype):=GetProcAddress(hlib,'wasmtime_externtype_as_instancetype');
+  pointer(wasmtime_instance_new):=GetProcAddress(hlib,'wasmtime_instance_new');
+  pointer(wasmtime_instance_type):=GetProcAddress(hlib,'wasmtime_instance_type');
+  pointer(wasmtime_instance_export_get):=GetProcAddress(hlib,'wasmtime_instance_export_get');
+  pointer(wasmtime_instance_export_nth):=GetProcAddress(hlib,'wasmtime_instance_export_nth');
+  pointer(wasmtime_linker_new):=GetProcAddress(hlib,'wasmtime_linker_new');
+  pointer(wasmtime_linker_delete):=GetProcAddress(hlib,'wasmtime_linker_delete');
+  pointer(wasmtime_linker_allow_shadowing):=GetProcAddress(hlib,'wasmtime_linker_allow_shadowing');
+  pointer(wasmtime_linker_define):=GetProcAddress(hlib,'wasmtime_linker_define');
+  pointer(wasmtime_linker_define_func):=GetProcAddress(hlib,'wasmtime_linker_define_func');
+  pointer(wasmtime_linker_define_func_unchecked):=GetProcAddress(hlib,'wasmtime_linker_define_func_unchecked');
+  pointer(wasmtime_linker_define_wasi):=GetProcAddress(hlib,'wasmtime_linker_define_wasi');
+  pointer(wasmtime_linker_define_instance):=GetProcAddress(hlib,'wasmtime_linker_define_instance');
+  pointer(wasmtime_linker_instantiate):=GetProcAddress(hlib,'wasmtime_linker_instantiate');
+  pointer(wasmtime_linker_module):=GetProcAddress(hlib,'wasmtime_linker_module');
+  pointer(wasmtime_linker_get_default):=GetProcAddress(hlib,'wasmtime_linker_get_default');
+  pointer(wasmtime_linker_get):=GetProcAddress(hlib,'wasmtime_linker_get');
+  pointer(wasmtime_memorytype_new):=GetProcAddress(hlib,'wasmtime_memorytype_new');
+  pointer(wasmtime_memorytype_minimum):=GetProcAddress(hlib,'wasmtime_memorytype_minimum');
+  pointer(wasmtime_memorytype_maximum):=GetProcAddress(hlib,'wasmtime_memorytype_maximum');
+  pointer(wasmtime_memorytype_is64):=GetProcAddress(hlib,'wasmtime_memorytype_is64');
+  pointer(wasmtime_memory_new):=GetProcAddress(hlib,'wasmtime_memory_new');
+  pointer(wasmtime_memory_type):=GetProcAddress(hlib,'wasmtime_memory_type');
+  pointer(wasmtime_memory_data):=GetProcAddress(hlib,'wasmtime_memory_data');
+  pointer(wasmtime_memory_data_size):=GetProcAddress(hlib,'wasmtime_memory_data_size');
+  pointer(wasmtime_memory_size):=GetProcAddress(hlib,'wasmtime_memory_size');
+  pointer(wasmtime_memory_grow):=GetProcAddress(hlib,'wasmtime_memory_grow');
+  pointer(wasmtime_table_new):=GetProcAddress(hlib,'wasmtime_table_new');
+  pointer(wasmtime_table_type):=GetProcAddress(hlib,'wasmtime_table_type');
+  pointer(wasmtime_table_get):=GetProcAddress(hlib,'wasmtime_table_get');
+  pointer(wasmtime_table_set):=GetProcAddress(hlib,'wasmtime_table_set');
+  pointer(wasmtime_table_size):=GetProcAddress(hlib,'wasmtime_table_size');
+  pointer(wasmtime_table_grow):=GetProcAddress(hlib,'wasmtime_table_grow');
+  pointer(wasmtime_trap_new):=GetProcAddress(hlib,'wasmtime_trap_new');
+  pointer(wasmtime_trap_code):=GetProcAddress(hlib,'wasmtime_trap_code');
+  pointer(wasmtime_trap_exit_status):=GetProcAddress(hlib,'wasmtime_trap_exit_status');
+  pointer(wasmtime_frame_func_name):=GetProcAddress(hlib,'wasmtime_frame_func_name');
+  pointer(wasmtime_frame_module_name):=GetProcAddress(hlib,'wasmtime_frame_module_name');
+  pointer(wasmtime_wat2wasm):=GetProcAddress(hlib,'wasmtime_wat2wasm');
+end;
+
+
+end.