From e93e3c895e968f21ff1e5a815f652fe37c52cd77 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Mon, 1 Jan 2024 17:30:01 -0800 Subject: [PATCH] Update preloaded directories, allow Emscripten runtime to exit, set MAIKO_ENABLE_NETHUB Compiling with -DMAIKO_ENABLE_NETHUB makes it possible to test out having a WebSocket server that could pass packets back and forth to the Dodo NetHub. Setting Emscripten link-time option for EXIT_RUNTIME allows the runtime code to shutdown when you exit Medley via a (LOGOUT) Set up preloads for all the parts of the Medley directory that MEDLEYDIR-INIT expects to be there. The resulting ldesdl.data is (at this time) 128 MB. It can be installed gzipped if using nginx or some other web server that supports pre-zipped static files. It would be better to have these as lazy-loading files, but the setup for that is complicated. Another alternative to embedding all the data would be if a WebSocket to XNS/Nethub gateway were written and deployed. --- bin/makefile-emscripten.wasm-wasm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bin/makefile-emscripten.wasm-wasm b/bin/makefile-emscripten.wasm-wasm index 64b631a..8d88423 100644 --- a/bin/makefile-emscripten.wasm-wasm +++ b/bin/makefile-emscripten.wasm-wasm @@ -8,16 +8,25 @@ XFLAGS = -DSDL -sUSE_SDL=2 # OPTFLAGS is normally -O2. OPTFLAGS = -O2 -DFLAGS = $(XFLAGS) -DRELEASE=351 +DFLAGS = $(XFLAGS) -DRELEASE=351 -DMAIKO_ENABLE_NETHUB MEDLEY?=../../medley SYSOUT?=$(MEDLEY)/loadups/full.sysout LD = emcc -LDFLAGS = -sUSE_SDL=2 -sASYNCIFY -sALLOW_MEMORY_GROWTH \ +LDFLAGS = -sUSE_SDL=2 -sASYNCIFY -sALLOW_MEMORY_GROWTH -sEXIT_RUNTIME=1 \ --preload-file $(SYSOUT)@medley/loadups/full.sysout \ - --preload-file $(MEDLEY)/greetfiles/EMSCRIPTEN-INIT.LCOM@usr/local/lde/site-init.lisp \ - --preload-file $(MEDLEY)/lispusers/BACKGROUND-YIELD.LCOM@medley/lispusers/BACKGROUND-YIELD.LCOM + --preload-file $(MEDLEY)/loadups/whereis.hash@medley/loadups/whereis.hash \ + --preload-file $(MEDLEY)/greetfiles/MEDLEYDIR-INIT.LCOM@usr/local/lde/site-init.lisp \ + --preload-file $(MEDLEY)/docs/@medley/docs \ + --preload-file $(MEDLEY)/doctools/@medley/doctools \ + --preload-file $(MEDLEY)/greetfiles/@medley/greetfiles \ + --preload-file $(MEDLEY)/internal/@medley/internal \ + --preload-file $(MEDLEY)/sources/@medley/sources \ + --preload-file $(MEDLEY)/library/@medley/library \ + --preload-file $(MEDLEY)/lispusers/@medley/lispusers \ + --preload-file $(MEDLEY)/fonts/@medley/fonts + LDELDFLAGS = OBJECTDIR = ../$(RELEASENAME)/