Here are my notes on setting up EMACS and SBCL for windows to work with CYGWIN. Once you have done this you can then install Hunchentoot. Hunchentoot is a web server that works quite well with SBCL. After following these instructions you should have a working lisp web server to play with.
Install CYGWIN into c:\cygwin and EMACS and SBCL into c:\home. Before you start cygwin edit your cygwin.bat file. I use the ‘C’ shell so my cygwin.bat file looks like this:
@echo off
C:
chdir C:\cygwin\bin
tcsh -l
Start CYGWIN and change to the root (‘/’) directory. Delete the existing home directory and create a symbolic link pointing to c:\home. At the SHELL prompt type
rmdir home
ln –s c:\home /home
In your home directory, mine is called VID, edit your .cshrc file and create a .emacs file containing the following:
;
(setq inferior-lisp-program “/home/sbcl/sbcl.exe
–core /home/sbcl/sbcl.core”)
(add-to-list `load-path “/home/sbcl/slime/”)
(require ’slime)
(slime-setup)
My .cshrc file looks like this:
alias emacs “/home/emacs/bin/runemacs.exe”
set path=($path /home/vid/bin)
In your HOME directory, create a bin directory. Change to this directory and create a file called sbcl containing:
#!/bin/csh
/cygdrive/c/home/sbcl/sbcl.exe –core c:\\home\\sbcl\\sbcl.core $*
Then at the shell prompt type
chmod +x sbcl; rehash
Now in your bin directory create a file called start-server containing
#!/bin/csh
sbcl –userinit /home/vid/bin/hunchentoot-test.lisp
The hunchentoot-test.lisp file that you need to create in your bin directory should contain the following:
(require :asdf)
(asdf:oos ‘asdf:load-op :hunchentoot)
(asdf:oos ‘asdf:load-op :hunchentoot-test)
(hunchentoot:start-server :port 4242)
You also need to edit the file c:\home\emacs\site-lisp\site-start.lisp. Mine contains just one line:
(setenv “HOME” “c:\\home\\vid\\”)
Download and install the following packages into c:\home\sbcl:
cffi
cffi-examples
cffi-tests
chunga
cl+ssl (see below)
cl-base64
cl-fad
cl-ppcre
cl-wh
flexi-streams
hunchentoot
hunchentoot-test
md5
rfc2388
slime
trivial-gray-streams
url-rewrite
You can download these packages from cliki. Put each of the downloaded packages into c:\home\sbcl and them just type
tar -xvzf <package-name.tar.gz>
You will need a different copy of cl+ssl. You can download cl+ssl from here. I made some minor changes to the original package so that the correct libraries are loaded by cffi. These libraries, libssl32.dll and libeay32.dll are included in the gzipped tar file clssl.tar.gz.
You will have to create the directories, cffi-examples, cffi-tests and hunchentoot-test, yourself. For simplicity I just copied cffi to cffi-test and to cffi-examples. Likewise I copied hunchentoot to hunchentoot–test. From a CYGWIN shell just type
cd /home/sbcl
cp –r cffi cffi-test
cp –r cffi cffi-examples
cp –r hunchentoot hunchentoot-test
Now you can do the following:
1) start cygwin and at the shell prompt type start-server. This will start hunchentoot. Point your browser at http://localhost:4242/
2) run emacs with sbcl as the inferior-lisp-program. When emacs has started type M-x slime. Sbcl should start.