mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-02-18 13:10:48 -08:00
Merge branch 'emscripten' into 'develop'
Preliminary support for the emscripten target See merge request embeddable-common-lisp/ecl!277
This commit is contained in:
commit
a4b69e5c04
14 changed files with 8635 additions and 6744 deletions
79
INSTALL
79
INSTALL
|
|
@ -110,3 +110,82 @@ Hint provided by Pascal J. Bourguignon.
|
|||
#+END_SRC
|
||||
4. Library and assets in the ecl-iOS directory are ready to run on
|
||||
the iOS system.
|
||||
|
||||
* Cross-compile for the WASM platform (via emscripten)
|
||||
|
||||
Emscripten target is a little fickle so keep in mind that:
|
||||
|
||||
- disable-shared is needed, because emcc does not recognize libecl.so (?)
|
||||
|
||||
- disable-tcp is needed, because accept can't be found (related to
|
||||
disable-shared? lack of -lsockets or something in this spirit?)
|
||||
|
||||
- select for interactive streams does not work, because reading operations are
|
||||
blocking (as they should be!), so there is no EOF returned -- clear-input will
|
||||
hang without a proper file-cnt
|
||||
|
||||
- to build emscripten you need to use their SDK that provides the toolchain, and
|
||||
set the environment variable EMSDK_PATH
|
||||
|
||||
- the optimization level -O0 is forced because otherwsise binaryen miscompiles
|
||||
ECL
|
||||
|
||||
1. Build the host ECL
|
||||
|
||||
#+begin_src shell-script
|
||||
./configure ABI=32 CFLAGS="-m32 -g -O2" LDFLAGS="-m32 -g -O2" \
|
||||
--prefix=`pwd`/ecl-emscripten-host --disable-threads
|
||||
|
||||
make -j16 && make install
|
||||
rm -rf build/
|
||||
#+end_src
|
||||
|
||||
2. Configure the toolchain
|
||||
|
||||
Install the Emscripten SDK using the official instructions:
|
||||
|
||||
https://emscripten.org/docs/getting_started/downloads.html
|
||||
|
||||
These build instructions were tested against ~emsdk 3.1.41~. If things doesn't
|
||||
work try that version instead of ~latest~.
|
||||
|
||||
After that activate the toolchain and configure build flags:
|
||||
|
||||
#+begin_src shell-script
|
||||
source ${EMSDK_PATH}/emsdk_env.sh
|
||||
export ECL_TO_RUN=`pwd`/ecl-emscripten-host/bin/ecl
|
||||
# You may customize various emscripten flags here, i.e:
|
||||
# export LDFLAGS="-sASYNCIFY=1"
|
||||
#+end_src
|
||||
|
||||
3. Build the core environment and install it
|
||||
|
||||
#+begin_src shell-script
|
||||
emconfigure ./configure \
|
||||
--host=wasm32-unknown-emscripten \
|
||||
--build=x86_64-pc-linux-gnu \
|
||||
--with-cross-config=`pwd`/src/util/wasm32-unknown-emscripten.cross_config \
|
||||
--prefix=`pwd`/ecl-emscripten \
|
||||
--disable-shared \
|
||||
--with-tcp=no \
|
||||
--with-cmp=no
|
||||
|
||||
emmake make && emmake make install
|
||||
|
||||
# some files need to be copied manually
|
||||
cp build/bin/ecl.js build/bin/ecl.wasm ecl-emscripten/bin
|
||||
#+end_src
|
||||
|
||||
4. ECL may be hosted on a web page. Assuming that you have quicklisp installed:
|
||||
|
||||
#+begin_src shell-script
|
||||
export WEBSERVER=`pwd`/src/util/webserver.lisp
|
||||
pushd ecl-emscripten/bin
|
||||
lisp --load $WEBSERVER
|
||||
# After the server is loaded run:
|
||||
# firefox localhost:8888/ecl.html
|
||||
popd
|
||||
#+end_src
|
||||
|
||||
If the output does not show on the webpage then open the javascript console.
|
||||
This is a default html website produced by emscripten.
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ CTAGS = @CTAGS@
|
|||
ETAGS = @ETAGS@
|
||||
RANLIB = @RANLIB@
|
||||
AR = @AR@
|
||||
ECL_MIN = @ECL_MIN@
|
||||
DPP = dpp$(EXE)
|
||||
ECL_MIN = ecl_min$(EXE)
|
||||
ECL = ecl$(EXE)
|
||||
|
||||
# ==================== Where To Install Things ====================
|
||||
|
|
|
|||
12
src/aclocal.m4
vendored
12
src/aclocal.m4
vendored
|
|
@ -254,6 +254,7 @@ AC_SUBST(INSTALL_TARGET)dnl Which type of installation: flat directory or unix l
|
|||
AC_SUBST(thehost)
|
||||
AC_SUBST(ECL_GC_DIR)dnl Which version of the Boehm-Weiser library to use
|
||||
AC_SUBST(ECL_DEFAULT_C_STACK_SIZE)dnl Default size of the C stack in bytes
|
||||
AC_SUBST(ECL_MIN,ecl_min)
|
||||
ECL_DEFAULT_C_STACK_SIZE=1048576 dnl Default to 1 MB if we can't set the stack size at runtime
|
||||
ECL_GC_DIR=bdwgc
|
||||
ECL_LDRPATH=''
|
||||
|
|
@ -519,6 +520,17 @@ case "${host}" in
|
|||
CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DANDROID -DPLATFORM_ANDROID -DUSE_GET_STACKBASE_FOR_MAIN -DIGNORE_DYNAMIC_LOADING -DNO_GETCONTEXT -DHAVE_GETTIMEOFDAY -DHAVE_SIGPROCMASK ${CFLAGS}"
|
||||
ECL_ADD_FEATURE([android])
|
||||
;;
|
||||
wasm32-unknown-emscripten)
|
||||
# Binaryen miscompiles ECL at non-zero optimization levels.
|
||||
CFLAGS="${CFLAGS} -DECL_C_COMPATIBLE_VARIADIC_DISPATCH -O0"
|
||||
# The default stack size is 64KB, that's too little for ECL.
|
||||
LDFLAGS="${LDFLAGS} -sSTACK_SIZE=1048576"
|
||||
ECL_MIN="ecl_min.html"
|
||||
EXEEXT=".html"
|
||||
enable_threads='no'
|
||||
enable_libffi='no'
|
||||
enable_gmp='portable'
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${host_cpu}" in
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ clean:
|
|||
# Build rules
|
||||
|
||||
$(DPP): $(srcdir)/dpp.c $(srcdir)/symbols_list.h
|
||||
if test -f ../CROSS-DPP; then touch dpp; else \
|
||||
if test -f ../CROSS-DPP; then touch $(DPP); else \
|
||||
$(TRUE_CC) -I$(srcdir) -I@true_builddir@ -I./ $(srcdir)/dpp.c @CPPFLAGS@ @CFLAGS@ @ECL_CFLAGS@ @LDFLAGS@ -o $@ ; \
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
(c::update-compiler-features
|
||||
:executable
|
||||
#+(or windows cygwin mingw32) "build:ecl_min.exe"
|
||||
#-(or windows cygwin mingw32) "build:ecl_min")
|
||||
#-(or windows cygwin mingw32) "build:@ECL_MIN@")
|
||||
(format t "~&;;; System features: ~A~%" c::*compiler-features*))
|
||||
|
||||
;;;
|
||||
|
|
|
|||
1200
src/config.guess
vendored
1200
src/config.guess
vendored
File diff suppressed because it is too large
Load diff
655
src/config.sub
vendored
655
src/config.sub
vendored
File diff suppressed because it is too large
Load diff
8846
src/configure
vendored
8846
src/configure
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -3,7 +3,7 @@
|
|||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* Define to 1 if the `closedir' function returns void instead of `int'. */
|
||||
/* Define to 1 if the `closedir' function returns void instead of int. */
|
||||
#undef CLOSEDIR_VOID
|
||||
|
||||
/* ECL_AVOID_FPE_H */
|
||||
|
|
@ -406,9 +406,6 @@
|
|||
/* Define to 1 if you have the `memmove' function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `memset' function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
|
|
@ -504,6 +501,9 @@
|
|||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
|
|
@ -642,10 +642,13 @@
|
|||
/* Define to the type of arg 5 for `select'. */
|
||||
#undef SELECT_TYPE_ARG5
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
/* Define to 1 if all of the C90 standard headers exist (not just the ones
|
||||
required in a freestanding environment). This macro is provided for
|
||||
backward compatibility; new code need not use it. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. This
|
||||
macro is obsolete. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
||||
|
|
@ -736,7 +739,7 @@
|
|||
/* Define to rpl_malloc if the replacement function should be used. */
|
||||
#undef malloc
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
/* Define as a signed integer type capable of holding a process identifier. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define to rpl_realloc if the replacement function should be used. */
|
||||
|
|
|
|||
1516
src/gmp/config.guess
vendored
1516
src/gmp/config.guess
vendored
File diff suppressed because it is too large
Load diff
2855
src/gmp/config.sub
vendored
2855
src/gmp/config.sub
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2018-03-11.20; # UTC
|
||||
scriptversion=2020-11-14.01; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
|
|
@ -69,6 +69,11 @@ posix_mkdir=
|
|||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
# Create dirs (including intermediate dirs) using mode 755.
|
||||
# This is like GNU 'install' as of coreutils 8.32 (2020).
|
||||
mkdir_umask=22
|
||||
|
||||
backupsuffix=
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
|
|
@ -99,18 +104,28 @@ Options:
|
|||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-C install only if different (preserve data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-p pass -p to $cpprog.
|
||||
-s $stripprog installed files.
|
||||
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
|
||||
By default, rm is invoked with -f; when overridden with RMPROG,
|
||||
it's up to you to specify -f if you want it.
|
||||
|
||||
If -S is not specified, no backups are attempted.
|
||||
|
||||
Email bug reports to bug-automake@gnu.org.
|
||||
Automake home page: https://www.gnu.org/software/automake/
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
|
|
@ -137,8 +152,13 @@ while test $# -ne 0; do
|
|||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-p) cpprog="$cpprog -p";;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-S) backupsuffix="$2"
|
||||
shift;;
|
||||
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
|
|
@ -255,6 +275,10 @@ do
|
|||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
# Don't chown directories that already exist.
|
||||
if test $dstdir_status = 0; then
|
||||
chowncmd=""
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
|
|
@ -301,22 +325,6 @@ do
|
|||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
|
|
@ -326,52 +334,49 @@ do
|
|||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
# Note that $RANDOM variable is not portable (e.g. dash); Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
# The $RANDOM variable is not portable (e.g., dash). Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
|
||||
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
trap '
|
||||
ret=$?
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
|
||||
exit $ret
|
||||
' 0
|
||||
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p' feature.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p'.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac
|
||||
|
||||
if
|
||||
|
|
@ -382,7 +387,7 @@ do
|
|||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
|
|
@ -411,7 +416,7 @@ do
|
|||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
(umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
|
|
@ -451,7 +456,18 @@ do
|
|||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
(umask $cp_umask &&
|
||||
{ test -z "$stripcmd" || {
|
||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
||||
# which would cause strip to fail.
|
||||
if test -z "$doit"; then
|
||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
||||
else
|
||||
$doit touch "$dsttmp"
|
||||
fi
|
||||
}
|
||||
} &&
|
||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
|
|
@ -477,6 +493,13 @@ do
|
|||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# If $backupsuffix is set, and the file being installed
|
||||
# already exists, attempt a backup. Don't worry if it fails,
|
||||
# e.g., if mv doesn't support -f.
|
||||
if test -n "$backupsuffix" && test -f "$dst"; then
|
||||
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
|
|
@ -491,9 +514,9 @@ do
|
|||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
$doit $rmcmd "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
|
|
|
|||
21
src/util/wasm32-unknown-emscripten.cross_config
Normal file
21
src/util/wasm32-unknown-emscripten.cross_config
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
CL_FIXNUM_TYPE=int
|
||||
CL_FIXNUM_BITS=32
|
||||
CL_FIXNUM_MAX=536870911L
|
||||
CL_FIXNUM_MIN=-536870912L
|
||||
CL_INT_BITS=32
|
||||
CL_LONG_BITS=32
|
||||
ECL_STACK_DIR=down
|
||||
ECL_BIGENDIAN=no
|
||||
ECL_NEWLINE=LF
|
||||
ECL_FILE_CNT=0
|
||||
ECL_STDINT_HEADER="#include <stdint.h>"
|
||||
ECL_UINT8_T=uint8_t
|
||||
ECL_UINT16_T=uint16_t
|
||||
ECL_UINT32_T=uint32_t
|
||||
ECL_UINT64_T=uint64_t
|
||||
ECL_INT8_T=int8_t
|
||||
ECL_INT16_T=int16_t
|
||||
ECL_INT32_T=int32_t
|
||||
ECL_INT64_T=int64_t
|
||||
ECL_LONG_LONG_BITS=64
|
||||
ECL_WORKING_ENVIRON=yes
|
||||
15
src/util/webserver.lisp
Normal file
15
src/util/webserver.lisp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
;;; bsd-2-clause, (c) 2022, Daniel Kochmański
|
||||
|
||||
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||
(ql:quickload "hunchentoot"))
|
||||
|
||||
(defpackage #:webserver
|
||||
(:use #:cl #:hunchentoot))
|
||||
(in-package #:webserver)
|
||||
|
||||
(defvar *acceptor*
|
||||
(make-instance 'hunchentoot:easy-acceptor :port 8888))
|
||||
|
||||
(print `(serving ,(ext:getcwd)))
|
||||
(push (create-folder-dispatcher-and-handler "/" (uiop/os:getcwd)) *dispatch-table*)
|
||||
(start *acceptor*)
|
||||
Loading…
Add table
Add a link
Reference in a new issue